diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 7672b945..007612fb 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,4 +32,7 @@ jobs: # Check that go fmt ./... produces a zero diff; clean up any changes afterwards. go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) # Check that go fix ./... produces a zero diff; clean up any changes afterwards. - go fix ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) + # + # Renable this after https://github.com/golang/go/commit/7fd62ba821b1044e8e4077df052b0a1232672d57 + # has been released. + # go fix ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code) diff --git a/.golangci.yml b/.golangci.yml index 44382f6f..a65dfc2b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,6 +32,18 @@ linters-settings: lines: 160 statements: 70 + # https://github.com/daixiang0/gci + # ensure import order is consistent + # gci write --custom-order -s standard -s default -s blank -s dot -s "prefix(github.com/go-vela)" . + gci: + custom-order: true + sections: + - standard + - default + - blank + - dot + - prefix(github.com/go-vela) + # https://github.com/denis-tingaikin/go-header goheader: template: |- @@ -57,46 +69,46 @@ linters: # enable a specific set of linters to run enable: - - bidichk # checks for dangerous unicode character sequences - - bodyclose # checks whether HTTP response body is closed successfully - - contextcheck # check the function whether use a non-inherited context - - deadcode # finds unused code - - dupl # code clone detection - - errcheck # checks for unchecked errors - - errorlint # find misuses of errors - - exportloopref # check for exported loop vars - - funlen # detects long functions - - goconst # finds repeated strings that could be replaced by a constant - - gocyclo # computes and checks the cyclomatic complexity of functions - - godot # checks if comments end in a period - - gofmt # checks whether code was gofmt-ed - - goheader # checks is file header matches to pattern - - goimports # fixes imports and formats code in same style as gofmt - - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod - - goprintffuncname # checks that printf-like functions are named with f at the end - - gosec # inspects code for security problems - - gosimple # linter that specializes in simplifying a code - - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string - - ineffassign # detects when assignments to existing variables aren't used - - makezero # finds slice declarations with non-zero initial length - - misspell # finds commonly misspelled English words in comments - - nakedret # finds naked returns in functions greater than a specified function length - - nilerr # finds the code that returns nil even if it checks that the error is not nil - - noctx # noctx finds sending http request without context.Context - - nolintlint # reports ill-formed or insufficient nolint directives - - revive # linter for go - - staticcheck # applies static analysis checks, go vet on steroids - - structcheck # finds unused struct fields - - stylecheck # replacement for golint - - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 - - typecheck # parses and type-checks go code, like the front-end of a go compiler - - unconvert # remove unnecessary type conversions - - unparam # reports unused function parameters - - unused # checks for unused constants, variables, functions and types - - varcheck # finds unused global variables and constants - - whitespace # detects leading and trailing whitespace - - wsl # forces code to use empty lines - + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - contextcheck # check the function whether use a non-inherited context + - deadcode # finds unused code + - dupl # code clone detection + - errcheck # checks for unchecked errors + - errorlint # find misuses of errors + - exportloopref # check for exported loop vars + - funlen # detects long functions + - gci # consistent import ordering + - goconst # finds repeated strings that could be replaced by a constant + - gocyclo # computes and checks the cyclomatic complexity of functions + - godot # checks if comments end in a period + - gofmt # checks whether code was gofmt-ed + - goheader # checks is file header matches to pattern + - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects code for security problems + - gosimple # linter that specializes in simplifying a code + - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string + - ineffassign # detects when assignments to existing variables aren't used + - makezero # finds slice declarations with non-zero initial length + - misspell # finds commonly misspelled English words in comments + - nakedret # finds naked returns in functions greater than a specified function length + - nilerr # finds the code that returns nil even if it checks that the error is not nil + - noctx # noctx finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives + - revive # linter for go + - staticcheck # applies static analysis checks, go vet on steroids + - structcheck # finds unused struct fields + - stylecheck # replacement for golint + - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 + - typecheck # parses and type-checks go code, like the front-end of a go compiler + - unconvert # remove unnecessary type conversions + - unparam # reports unused function parameters + - unused # checks for unused constants, variables, functions and types + - varcheck # finds unused global variables and constants + - whitespace # detects leading and trailing whitespace + - wsl # forces code to use empty lines + # static list of linters we know golangci can run but we've # chosen to leave disabled for now # - asciicheck - non-critical @@ -109,13 +121,13 @@ linters: # - exhaustivestruct - style preference # - forbidigo - unused # - forcetypeassert - unused - # - gci - use goimports # - gochecknoinits - unused # - gochecknoglobals - global variables allowed # - gocognit - unused complexity metric # - gocritic - style preference # - godox - to be used in the future # - goerr113 - to be used in the future + # - goimports - use gci # - golint - archived, replaced with revive # - gofumpt - use gofmt # - gomnd - get too many false-positives diff --git a/Makefile b/Makefile index 979732df..e4811e60 100644 --- a/Makefile +++ b/Makefile @@ -290,3 +290,24 @@ bump-deps-full: check @echo @echo "### Upgrading all dependencies" @go get -t -u ./... + +# The `lint` target is intended to lint the +# Go source code with golangci-lint. +# +# Usage: `make lint` +.PHONY: lint +lint: + @echo + @echo "### Linting Go Code" + @golangci-lint run ./... + +# The `lintfix` target is intended to lint the +# Go source code with golangci-lint and apply +# any fixes that can be automatically applied. +# +# Usage: `make lintfix` +.PHONY: lintfix +lintfix: + @echo + @echo "### Fixing Go code with linter" + @golangci-lint run ./... --fix diff --git a/action/build/approve.go b/action/build/approve.go index b48b36bb..82801b74 100644 --- a/action/build/approve.go +++ b/action/build/approve.go @@ -5,11 +5,10 @@ package build import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Approve approves a build based off the provided configuration. diff --git a/action/build/approve_test.go b/action/build/approve_test.go index 2b944277..c8a7aea7 100644 --- a/action/build/approve_test.go +++ b/action/build/approve_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestBuild_Config_Approve(t *testing.T) { diff --git a/action/build/cancel.go b/action/build/cancel.go index fd4520b7..36e22ce6 100644 --- a/action/build/cancel.go +++ b/action/build/cancel.go @@ -4,11 +4,10 @@ package build import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Cancel cancels a build based off the provided configuration. diff --git a/action/build/cancel_test.go b/action/build/cancel_test.go index 53e8eb5f..d5bf0243 100644 --- a/action/build/cancel_test.go +++ b/action/build/cancel_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestBuild_Config_Cancel(t *testing.T) { diff --git a/action/build/get.go b/action/build/get.go index acbccc55..0f748886 100644 --- a/action/build/get.go +++ b/action/build/get.go @@ -3,11 +3,10 @@ package build import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of builds based off the provided configuration. diff --git a/action/build/get_test.go b/action/build/get_test.go index da96083c..ce1820c9 100644 --- a/action/build/get_test.go +++ b/action/build/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestBuild_Config_Get(t *testing.T) { diff --git a/action/build/restart.go b/action/build/restart.go index b3cc1204..215799de 100644 --- a/action/build/restart.go +++ b/action/build/restart.go @@ -4,11 +4,10 @@ package build import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Restart restarts a build based off the provided configuration. diff --git a/action/build/restart_test.go b/action/build/restart_test.go index 371e1043..aead3c32 100644 --- a/action/build/restart_test.go +++ b/action/build/restart_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestBuild_Config_Restart(t *testing.T) { diff --git a/action/build/table.go b/action/build/table.go index dc05f9c4..1ba2ce4e 100644 --- a/action/build/table.go +++ b/action/build/table.go @@ -7,10 +7,11 @@ import ( "time" "github.com/dustin/go-humanize" - "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" "github.com/gosuri/uitable" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/build/view.go b/action/build/view.go index e83e9ca9..de955050 100644 --- a/action/build/view.go +++ b/action/build/view.go @@ -4,11 +4,10 @@ package build import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a build based off the provided configuration. diff --git a/action/build/view_test.go b/action/build/view_test.go index 71f94a27..3a2a9b64 100644 --- a/action/build/view_test.go +++ b/action/build/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestBuild_Config_View(t *testing.T) { diff --git a/action/completion/generate.go b/action/completion/generate.go index fb700850..81ebebf1 100644 --- a/action/completion/generate.go +++ b/action/completion/generate.go @@ -5,9 +5,9 @@ package completion import ( "fmt" - "github.com/go-vela/cli/internal/output" - "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" ) // Generate produces a script used to enable diff --git a/action/config/generate.go b/action/config/generate.go index dc22cb1a..fb3b3fc2 100644 --- a/action/config/generate.go +++ b/action/config/generate.go @@ -5,11 +5,9 @@ package config import ( "path/filepath" + "github.com/sirupsen/logrus" "github.com/spf13/afero" - yaml "gopkg.in/yaml.v3" - - "github.com/sirupsen/logrus" ) // create filesystem based on the operating system diff --git a/action/config/load.go b/action/config/load.go index a5cd1780..2027e525 100644 --- a/action/config/load.go +++ b/action/config/load.go @@ -5,15 +5,12 @@ package config import ( "strings" - "github.com/go-vela/cli/internal" - "github.com/sirupsen/logrus" - "github.com/spf13/afero" - "github.com/urfave/cli/v2" - yaml "gopkg.in/yaml.v3" + + "github.com/go-vela/cli/internal" ) // Load reads the config file and sets the values based off the provided configuration. diff --git a/action/config/load_test.go b/action/config/load_test.go index 0b03f56b..95d588a3 100644 --- a/action/config/load_test.go +++ b/action/config/load_test.go @@ -6,10 +6,10 @@ import ( "flag" "testing" - "github.com/go-vela/cli/test" "github.com/spf13/afero" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/test" ) func TestConfig_Config_Load(t *testing.T) { diff --git a/action/config/remove.go b/action/config/remove.go index 906ac0da..cb9fc008 100644 --- a/action/config/remove.go +++ b/action/config/remove.go @@ -5,13 +5,11 @@ package config import ( "strings" - "github.com/go-vela/cli/internal" - + "github.com/sirupsen/logrus" "github.com/spf13/afero" - yaml "gopkg.in/yaml.v3" - "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal" ) // Remove deletes one or more fields from the config file based off the provided configuration. diff --git a/action/config/update.go b/action/config/update.go index 4a865107..597780d3 100644 --- a/action/config/update.go +++ b/action/config/update.go @@ -5,13 +5,11 @@ package config import ( "strings" - "github.com/go-vela/cli/internal" - + "github.com/sirupsen/logrus" "github.com/spf13/afero" - yaml "gopkg.in/yaml.v3" - "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal" ) // Update modifies one or more fields from the config file based off the provided configuration. diff --git a/action/config/view.go b/action/config/view.go index 4edae0fe..cdaad518 100644 --- a/action/config/view.go +++ b/action/config/view.go @@ -3,11 +3,10 @@ package config import ( - "github.com/go-vela/cli/internal/output" - + "github.com/sirupsen/logrus" "github.com/spf13/afero" - "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" ) // View inspects the config file based off the provided configuration. diff --git a/action/deployment/add.go b/action/deployment/add.go index 1e24e8ca..b58b05c6 100644 --- a/action/deployment/add.go +++ b/action/deployment/add.go @@ -3,13 +3,11 @@ package deployment import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" ) // Add creates a deployment based off the provided configuration. diff --git a/action/deployment/get.go b/action/deployment/get.go index 9a5c4e34..23b0fd4e 100644 --- a/action/deployment/get.go +++ b/action/deployment/get.go @@ -3,11 +3,10 @@ package deployment import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of deployments based off the provided configuration. diff --git a/action/deployment/get_test.go b/action/deployment/get_test.go index 9c5144cd..a20d42e5 100644 --- a/action/deployment/get_test.go +++ b/action/deployment/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestDeployment_Config_Get(t *testing.T) { diff --git a/action/deployment/table.go b/action/deployment/table.go index 25b6c35a..c8eb9649 100644 --- a/action/deployment/table.go +++ b/action/deployment/table.go @@ -5,13 +5,11 @@ package deployment import ( "sort" - "github.com/go-vela/cli/internal/output" - - "github.com/go-vela/types/library" - "github.com/gosuri/uitable" - "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/deployment/view.go b/action/deployment/view.go index fb71b903..e45abc44 100644 --- a/action/deployment/view.go +++ b/action/deployment/view.go @@ -3,11 +3,10 @@ package deployment import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a deployment based off the provided configuration. diff --git a/action/deployment/view_test.go b/action/deployment/view_test.go index 50e172ee..948994a5 100644 --- a/action/deployment/view_test.go +++ b/action/deployment/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestDeployment_Config_View(t *testing.T) { diff --git a/action/docs/generate.go b/action/docs/generate.go index 1783bf26..ef444fb0 100644 --- a/action/docs/generate.go +++ b/action/docs/generate.go @@ -5,10 +5,10 @@ package docs import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" - "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" ) // Generate produces documentation for the CLI. diff --git a/action/hook/get.go b/action/hook/get.go index 6d48bb7c..c6687eae 100644 --- a/action/hook/get.go +++ b/action/hook/get.go @@ -3,11 +3,10 @@ package hook import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of build hooks based on the provided configuration. diff --git a/action/hook/get_test.go b/action/hook/get_test.go index 7e92e288..f2bb4266 100644 --- a/action/hook/get_test.go +++ b/action/hook/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestHook_Config_Get(t *testing.T) { diff --git a/action/hook/table.go b/action/hook/table.go index 163467a3..24a9f81d 100644 --- a/action/hook/table.go +++ b/action/hook/table.go @@ -6,14 +6,12 @@ import ( "sort" "time" - "github.com/go-vela/cli/internal/output" - - "github.com/go-vela/types/library" - "github.com/dustin/go-humanize" "github.com/gosuri/uitable" - "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/hook/view.go b/action/hook/view.go index 74915db7..c8fa3f65 100644 --- a/action/hook/view.go +++ b/action/hook/view.go @@ -3,11 +3,10 @@ package hook import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a hook based off the provided configuration. diff --git a/action/hook/view_test.go b/action/hook/view_test.go index 779d324c..41f0f10a 100644 --- a/action/hook/view_test.go +++ b/action/hook/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestHook_Config_View(t *testing.T) { diff --git a/action/load.go b/action/load.go index 284a8f49..e86b10fd 100644 --- a/action/load.go +++ b/action/load.go @@ -3,12 +3,11 @@ package action import ( - "github.com/go-vela/cli/action/config" - "github.com/go-vela/cli/internal" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/action/config" + "github.com/go-vela/cli/internal" ) // Load imports the configuration file for the CLI. diff --git a/action/load_test.go b/action/load_test.go index 5308ff38..233e3a3a 100644 --- a/action/load_test.go +++ b/action/load_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestAction_Load(t *testing.T) { diff --git a/action/log/get.go b/action/log/get.go index 80d02e4f..7cb65626 100644 --- a/action/log/get.go +++ b/action/log/get.go @@ -3,11 +3,10 @@ package log import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of build logs based on the provided configuration. diff --git a/action/log/get_test.go b/action/log/get_test.go index 14f0f99e..1239637b 100644 --- a/action/log/get_test.go +++ b/action/log/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestLog_Config_Get(t *testing.T) { diff --git a/action/log/view.go b/action/log/view.go index a89ea0e0..4db41eca 100644 --- a/action/log/view.go +++ b/action/log/view.go @@ -3,11 +3,10 @@ package log import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // ViewService inspects a service log based on the provided configuration. diff --git a/action/log/view_test.go b/action/log/view_test.go index 9c017a16..c206fdf0 100644 --- a/action/log/view_test.go +++ b/action/log/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestLog_Config_ViewService(t *testing.T) { diff --git a/action/login/login.go b/action/login/login.go index 44b8f96d..94ec91be 100644 --- a/action/login/login.go +++ b/action/login/login.go @@ -7,10 +7,10 @@ import ( "net/http" "strconv" - "github.com/go-vela/sdk-go/vela" + "github.com/cli/browser" "github.com/sirupsen/logrus" - "github.com/cli/browser" + "github.com/go-vela/sdk-go/vela" ) // Config represents the configuration necessary diff --git a/action/login/prompt.go b/action/login/prompt.go index 4da80e67..44dd599b 100644 --- a/action/login/prompt.go +++ b/action/login/prompt.go @@ -7,7 +7,6 @@ import ( "io" "github.com/manifoldco/promptui" - "github.com/sirupsen/logrus" ) diff --git a/action/pipeline/compile.go b/action/pipeline/compile.go index 29373219..6be84004 100644 --- a/action/pipeline/compile.go +++ b/action/pipeline/compile.go @@ -4,11 +4,10 @@ package pipeline import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Compile compiles a pipeline based off the provided configuration. diff --git a/action/pipeline/compile_test.go b/action/pipeline/compile_test.go index 5d755bd6..7bff8ebe 100644 --- a/action/pipeline/compile_test.go +++ b/action/pipeline/compile_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestPipeline_Config_Compile(t *testing.T) { diff --git a/action/pipeline/exec.go b/action/pipeline/exec.go index d3ecfe90..5f120e89 100644 --- a/action/pipeline/exec.go +++ b/action/pipeline/exec.go @@ -10,14 +10,14 @@ import ( "path/filepath" "syscall" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/version" "github.com/go-vela/server/compiler" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/worker/executor" "github.com/go-vela/worker/runtime" - - "github.com/sirupsen/logrus" ) // Exec executes a pipeline based off the provided configuration. diff --git a/action/pipeline/expand.go b/action/pipeline/expand.go index bbf7a6e2..0ab4e866 100644 --- a/action/pipeline/expand.go +++ b/action/pipeline/expand.go @@ -4,11 +4,10 @@ package pipeline import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Expand expands a pipeline based off the provided configuration. diff --git a/action/pipeline/expand_test.go b/action/pipeline/expand_test.go index 9f4a6014..8788e6ef 100644 --- a/action/pipeline/expand_test.go +++ b/action/pipeline/expand_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestPipeline_Config_Expand(t *testing.T) { diff --git a/action/pipeline/generate.go b/action/pipeline/generate.go index a68d946c..8bddf9fe 100644 --- a/action/pipeline/generate.go +++ b/action/pipeline/generate.go @@ -6,11 +6,9 @@ import ( "os" "path/filepath" - "github.com/spf13/afero" - "github.com/buildkite/yaml" - "github.com/sirupsen/logrus" + "github.com/spf13/afero" ) // create filesystem based on the operating system diff --git a/action/pipeline/get.go b/action/pipeline/get.go index 19669061..fbf7a10b 100644 --- a/action/pipeline/get.go +++ b/action/pipeline/get.go @@ -3,11 +3,10 @@ package pipeline import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of pipelines based on the provided configuration. diff --git a/action/pipeline/get_test.go b/action/pipeline/get_test.go index 91b27ae0..de9903f1 100644 --- a/action/pipeline/get_test.go +++ b/action/pipeline/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestPipeline_Config_Get(t *testing.T) { diff --git a/action/pipeline/stage.go b/action/pipeline/stage.go index f963c8b2..84341d1a 100644 --- a/action/pipeline/stage.go +++ b/action/pipeline/stage.go @@ -3,9 +3,9 @@ package pipeline import ( - "github.com/go-vela/types/yaml" - "github.com/sirupsen/logrus" + + "github.com/go-vela/types/yaml" ) func stages(pipelineType string) *yaml.Build { diff --git a/action/pipeline/step.go b/action/pipeline/step.go index 3e0de5a3..ffaa3079 100644 --- a/action/pipeline/step.go +++ b/action/pipeline/step.go @@ -3,9 +3,9 @@ package pipeline import ( - "github.com/go-vela/types/yaml" - "github.com/sirupsen/logrus" + + "github.com/go-vela/types/yaml" ) func steps(pipelineType string) *yaml.Build { diff --git a/action/pipeline/table.go b/action/pipeline/table.go index 7cb27d9c..9d0dec41 100644 --- a/action/pipeline/table.go +++ b/action/pipeline/table.go @@ -5,13 +5,11 @@ package pipeline import ( "sort" - "github.com/go-vela/cli/internal/output" - - "github.com/go-vela/types/library" - "github.com/gosuri/uitable" - "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/pipeline/validate.go b/action/pipeline/validate.go index 46a592a2..00b96a01 100644 --- a/action/pipeline/validate.go +++ b/action/pipeline/validate.go @@ -8,16 +8,15 @@ import ( "path/filepath" "strings" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/compiler" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/types/yaml" - - "github.com/go-vela/server/compiler" - - "github.com/sirupsen/logrus" ) // Validate verifies the configuration provided. diff --git a/action/pipeline/validate_test.go b/action/pipeline/validate_test.go index f8f53dc3..b05ca794 100644 --- a/action/pipeline/validate_test.go +++ b/action/pipeline/validate_test.go @@ -9,11 +9,11 @@ import ( "path" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/sdk-go/vela" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestPipeline_Config_Validate(t *testing.T) { diff --git a/action/pipeline/view.go b/action/pipeline/view.go index b197af36..1e77fb7d 100644 --- a/action/pipeline/view.go +++ b/action/pipeline/view.go @@ -3,11 +3,10 @@ package pipeline import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a pipeline based off the provided configuration. diff --git a/action/pipeline/view_test.go b/action/pipeline/view_test.go index ed1f5c11..fbc9e04c 100644 --- a/action/pipeline/view_test.go +++ b/action/pipeline/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestPipeline_Config_View(t *testing.T) { diff --git a/action/repo/add.go b/action/repo/add.go index 9b4dd21a..88e0f660 100644 --- a/action/repo/add.go +++ b/action/repo/add.go @@ -6,13 +6,11 @@ package repo import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" ) // Add creates a repository based off the provided configuration. diff --git a/action/repo/add_test.go b/action/repo/add_test.go index 3f2234f4..c09c3947 100644 --- a/action/repo/add_test.go +++ b/action/repo/add_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Add(t *testing.T) { diff --git a/action/repo/chown.go b/action/repo/chown.go index bc4cecd5..d996a311 100644 --- a/action/repo/chown.go +++ b/action/repo/chown.go @@ -4,11 +4,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Chown changes ownership of a repository based off the provided configuration. diff --git a/action/repo/chown_test.go b/action/repo/chown_test.go index 63e4face..02bd79fb 100644 --- a/action/repo/chown_test.go +++ b/action/repo/chown_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Chown(t *testing.T) { diff --git a/action/repo/get.go b/action/repo/get.go index 7e53a3c2..1af81ee7 100644 --- a/action/repo/get.go +++ b/action/repo/get.go @@ -3,11 +3,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of repositories based off the provided configuration. diff --git a/action/repo/get_test.go b/action/repo/get_test.go index 1e38735d..f6b8268b 100644 --- a/action/repo/get_test.go +++ b/action/repo/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Get(t *testing.T) { diff --git a/action/repo/remove.go b/action/repo/remove.go index 3ae448a5..0e2fe608 100644 --- a/action/repo/remove.go +++ b/action/repo/remove.go @@ -4,11 +4,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Remove deletes a repository based off the provided configuration. diff --git a/action/repo/remove_test.go b/action/repo/remove_test.go index c702ab16..4f23ac09 100644 --- a/action/repo/remove_test.go +++ b/action/repo/remove_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Remove(t *testing.T) { diff --git a/action/repo/repair.go b/action/repo/repair.go index 2eeafa3a..4b67fa60 100644 --- a/action/repo/repair.go +++ b/action/repo/repair.go @@ -4,11 +4,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Repair recreates a repository webhook based off the provided configuration. diff --git a/action/repo/repair_test.go b/action/repo/repair_test.go index 05f851ad..62ec5b8f 100644 --- a/action/repo/repair_test.go +++ b/action/repo/repair_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Repair(t *testing.T) { diff --git a/action/repo/sync.go b/action/repo/sync.go index ad18661f..b7e837ab 100644 --- a/action/repo/sync.go +++ b/action/repo/sync.go @@ -2,11 +2,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Sync synchronizes a single repository in the Vela Database with the SCM. diff --git a/action/repo/sync_test.go b/action/repo/sync_test.go index 879ca69f..57f10401 100644 --- a/action/repo/sync_test.go +++ b/action/repo/sync_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Sync(t *testing.T) { diff --git a/action/repo/table.go b/action/repo/table.go index f093a514..6cdfedc2 100644 --- a/action/repo/table.go +++ b/action/repo/table.go @@ -5,13 +5,11 @@ package repo import ( "strings" - "github.com/go-vela/cli/internal/output" - - "github.com/go-vela/types/library" - "github.com/gosuri/uitable" - "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the @@ -46,7 +44,6 @@ func table(repos *[]library.Repo) error { for _, r := range *repos { logrus.Tracef("adding repo %s to repo table", r.GetFullName()) - //nolint:gosec // ignore memory aliasing e := strings.Join(r.AllowEvents.List(), ",") // add a row to the table with the specified values @@ -93,7 +90,6 @@ func wideTable(repos *[]library.Repo) error { for _, r := range *repos { logrus.Tracef("adding repo %s to wide repo table", r.GetFullName()) - //nolint:gosec // ignore memory aliasing e := strings.Join(r.AllowEvents.List(), ",") // add a row to the table with the specified values diff --git a/action/repo/update.go b/action/repo/update.go index 07c7c70a..99401c0b 100644 --- a/action/repo/update.go +++ b/action/repo/update.go @@ -6,13 +6,11 @@ package repo import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" ) // Update modifies a repository based off the provided configuration. diff --git a/action/repo/update_test.go b/action/repo/update_test.go index 05a27cc7..c1e2f525 100644 --- a/action/repo/update_test.go +++ b/action/repo/update_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_Update(t *testing.T) { diff --git a/action/repo/validate.go b/action/repo/validate.go index 461f8e65..00988547 100644 --- a/action/repo/validate.go +++ b/action/repo/validate.go @@ -5,8 +5,9 @@ package repo import ( "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // Validate verifies the configuration provided. diff --git a/action/repo/view.go b/action/repo/view.go index 446343aa..005d58ca 100644 --- a/action/repo/view.go +++ b/action/repo/view.go @@ -3,11 +3,10 @@ package repo import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a repository based off the provided configuration. diff --git a/action/repo/view_test.go b/action/repo/view_test.go index a3b06491..9efe0af1 100644 --- a/action/repo/view_test.go +++ b/action/repo/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestRepo_Config_View(t *testing.T) { diff --git a/action/schedule/add.go b/action/schedule/add.go index 27d8b958..8f0d7a70 100644 --- a/action/schedule/add.go +++ b/action/schedule/add.go @@ -4,10 +4,11 @@ package schedule import ( + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Add creates a schedule based off the provided configuration. diff --git a/action/schedule/get.go b/action/schedule/get.go index 8baa3c59..cb39bade 100644 --- a/action/schedule/get.go +++ b/action/schedule/get.go @@ -3,9 +3,10 @@ package schedule import ( + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/sirupsen/logrus" ) // Get captures a list of schedules based off the provided configuration. diff --git a/action/schedule/remove.go b/action/schedule/remove.go index 6fc30a5d..11c67750 100644 --- a/action/schedule/remove.go +++ b/action/schedule/remove.go @@ -3,9 +3,10 @@ package schedule import ( + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/sirupsen/logrus" ) // Remove deletes a schedule based off the provided configuration. diff --git a/action/schedule/table.go b/action/schedule/table.go index a3ff6a5d..b934054a 100644 --- a/action/schedule/table.go +++ b/action/schedule/table.go @@ -6,10 +6,11 @@ import ( "time" "github.com/dustin/go-humanize" - "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" "github.com/gosuri/uitable" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/schedule/update.go b/action/schedule/update.go index 7748bb62..afadd42b 100644 --- a/action/schedule/update.go +++ b/action/schedule/update.go @@ -4,10 +4,11 @@ package schedule import ( + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Update modifies a schedule based off the provided configuration. diff --git a/action/schedule/view.go b/action/schedule/view.go index 379b5750..8be1997e 100644 --- a/action/schedule/view.go +++ b/action/schedule/view.go @@ -3,9 +3,10 @@ package schedule import ( + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/sirupsen/logrus" ) // View inspects a schedule based off the provided configuration. diff --git a/action/secret/add.go b/action/secret/add.go index 8a2e4331..0b37230e 100644 --- a/action/secret/add.go +++ b/action/secret/add.go @@ -9,16 +9,13 @@ import ( "path/filepath" "strings" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + yaml "gopkg.in/yaml.v3" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" - - yaml "gopkg.in/yaml.v3" ) // Add creates a secret based on the provided configuration. diff --git a/action/secret/add_test.go b/action/secret/add_test.go index 04acff84..273aeb26 100644 --- a/action/secret/add_test.go +++ b/action/secret/add_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestSecret_Config_Add(t *testing.T) { diff --git a/action/secret/get.go b/action/secret/get.go index 39ccf7a6..7eb1e3fe 100644 --- a/action/secret/get.go +++ b/action/secret/get.go @@ -5,13 +5,11 @@ package secret import ( "strings" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" - - "github.com/sirupsen/logrus" ) // Get captures a list of secrets based on the provided configuration. diff --git a/action/secret/get_test.go b/action/secret/get_test.go index d236ce7e..ba6a8035 100644 --- a/action/secret/get_test.go +++ b/action/secret/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestSecret_Config_Get(t *testing.T) { diff --git a/action/secret/remove.go b/action/secret/remove.go index cadde930..01aa0a0d 100644 --- a/action/secret/remove.go +++ b/action/secret/remove.go @@ -5,13 +5,11 @@ package secret import ( "strings" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" - - "github.com/sirupsen/logrus" ) // Remove deletes a secret based on the provided configuration. diff --git a/action/secret/remove_test.go b/action/secret/remove_test.go index 7cb94627..14707da7 100644 --- a/action/secret/remove_test.go +++ b/action/secret/remove_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestSecret_Config_Remove(t *testing.T) { diff --git a/action/secret/table.go b/action/secret/table.go index 849e4417..0e481e5a 100644 --- a/action/secret/table.go +++ b/action/secret/table.go @@ -6,14 +6,12 @@ import ( "fmt" "strings" - "github.com/go-vela/cli/internal/output" + "github.com/gosuri/uitable" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/gosuri/uitable" - - "github.com/sirupsen/logrus" ) // table is a helper function to output the diff --git a/action/secret/update.go b/action/secret/update.go index b1b64972..d03b6047 100644 --- a/action/secret/update.go +++ b/action/secret/update.go @@ -9,16 +9,13 @@ import ( "path/filepath" "strings" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + yaml "gopkg.in/yaml.v3" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" - - yaml "gopkg.in/yaml.v3" ) // Update modifies a secret based on the provided configuration. diff --git a/action/secret/update_test.go b/action/secret/update_test.go index 9326c095..8d8332e3 100644 --- a/action/secret/update_test.go +++ b/action/secret/update_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestSecret_Config_Update(t *testing.T) { diff --git a/action/secret/validate.go b/action/secret/validate.go index ee180c6d..79dda5c5 100644 --- a/action/secret/validate.go +++ b/action/secret/validate.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" ) // Validate verifies the configuration provided. diff --git a/action/secret/view.go b/action/secret/view.go index 043a9836..a84e9392 100644 --- a/action/secret/view.go +++ b/action/secret/view.go @@ -7,16 +7,14 @@ import ( "os" "strings" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v3" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" pyaml "github.com/go-vela/types/yaml" - - "github.com/sirupsen/logrus" ) // View inspects a secret based on the provided configuration. diff --git a/action/secret/view_test.go b/action/secret/view_test.go index 9cfbbd4b..e6f56dd3 100644 --- a/action/secret/view_test.go +++ b/action/secret/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestSecret_Config_View(t *testing.T) { diff --git a/action/service/get.go b/action/service/get.go index 45392ce8..1c73ec73 100644 --- a/action/service/get.go +++ b/action/service/get.go @@ -3,11 +3,10 @@ package service import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of services based on the provided configuration. diff --git a/action/service/get_test.go b/action/service/get_test.go index 47f6d994..461b2111 100644 --- a/action/service/get_test.go +++ b/action/service/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestService_Config_Get(t *testing.T) { diff --git a/action/service/table.go b/action/service/table.go index 9cbebb61..2e33935f 100644 --- a/action/service/table.go +++ b/action/service/table.go @@ -7,10 +7,11 @@ import ( "time" "github.com/dustin/go-humanize" - "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" "github.com/gosuri/uitable" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/service/view.go b/action/service/view.go index 03f8de63..785b4483 100644 --- a/action/service/view.go +++ b/action/service/view.go @@ -3,11 +3,10 @@ package service import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a service based on the provided configuration. diff --git a/action/service/view_test.go b/action/service/view_test.go index 5cdf8b40..2e3dbf2a 100644 --- a/action/service/view_test.go +++ b/action/service/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestService_Config_View(t *testing.T) { diff --git a/action/step/get.go b/action/step/get.go index c91d343c..9811fcdc 100644 --- a/action/step/get.go +++ b/action/step/get.go @@ -3,11 +3,10 @@ package step import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of steps based on the provided configuration. diff --git a/action/step/get_test.go b/action/step/get_test.go index 14ad2ec9..aa0f8de8 100644 --- a/action/step/get_test.go +++ b/action/step/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestStep_Config_Get(t *testing.T) { diff --git a/action/step/table.go b/action/step/table.go index dbfaafbd..0412d201 100644 --- a/action/step/table.go +++ b/action/step/table.go @@ -7,10 +7,11 @@ import ( "time" "github.com/dustin/go-humanize" - "github.com/go-vela/cli/internal/output" - "github.com/go-vela/types/library" "github.com/gosuri/uitable" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + "github.com/go-vela/types/library" ) // table is a helper function to output the diff --git a/action/step/view.go b/action/step/view.go index 2dbc91fe..3e90cd57 100644 --- a/action/step/view.go +++ b/action/step/view.go @@ -3,11 +3,10 @@ package step import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a step based on the provided configuration. diff --git a/action/step/view_test.go b/action/step/view_test.go index 6eb9ead8..9130ddae 100644 --- a/action/step/view_test.go +++ b/action/step/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestStep_Config_View(t *testing.T) { diff --git a/action/worker/add.go b/action/worker/add.go index c0e713bb..d2172566 100644 --- a/action/worker/add.go +++ b/action/worker/add.go @@ -10,11 +10,10 @@ import ( "strings" "time" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Add creates a worker based off the provided configuration. diff --git a/action/worker/add_test.go b/action/worker/add_test.go index 021a7f77..f5c14a45 100644 --- a/action/worker/add_test.go +++ b/action/worker/add_test.go @@ -7,10 +7,10 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/worker/mock/worker" "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" + "github.com/go-vela/worker/mock/worker" ) func TestWorker_Config_Add(t *testing.T) { diff --git a/action/worker/get.go b/action/worker/get.go index 72a5744c..39decb23 100644 --- a/action/worker/get.go +++ b/action/worker/get.go @@ -5,11 +5,10 @@ package worker import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // Get captures a list of workers based off the provided configuration. diff --git a/action/worker/get_test.go b/action/worker/get_test.go index 7aff4b88..2812ad00 100644 --- a/action/worker/get_test.go +++ b/action/worker/get_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestWorker_Config_Get(t *testing.T) { diff --git a/action/worker/table.go b/action/worker/table.go index ed65617e..c2b6bad9 100644 --- a/action/worker/table.go +++ b/action/worker/table.go @@ -5,12 +5,12 @@ package worker import ( "time" - "github.com/go-vela/cli/internal/output" - api "github.com/go-vela/server/api/types" - "github.com/dustin/go-humanize" "github.com/gosuri/uitable" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal/output" + api "github.com/go-vela/server/api/types" ) // table is a helper function to output the diff --git a/action/worker/update.go b/action/worker/update.go index d86a526a..e46ace98 100644 --- a/action/worker/update.go +++ b/action/worker/update.go @@ -3,12 +3,11 @@ package worker import ( - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" api "github.com/go-vela/server/api/types" - - "github.com/sirupsen/logrus" ) // Update modifies a worker based off the provided configuration. diff --git a/action/worker/update_test.go b/action/worker/update_test.go index 0d916e47..cfa17513 100644 --- a/action/worker/update_test.go +++ b/action/worker/update_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestWorker_Config_Update(t *testing.T) { diff --git a/action/worker/validate.go b/action/worker/validate.go index eae4896d..6666a7b7 100644 --- a/action/worker/validate.go +++ b/action/worker/validate.go @@ -6,8 +6,9 @@ import ( "fmt" "net/url" - "github.com/go-vela/cli/internal" "github.com/sirupsen/logrus" + + "github.com/go-vela/cli/internal" ) // Validate verifies the configuration provided. diff --git a/action/worker/view.go b/action/worker/view.go index 2e625e36..d6430812 100644 --- a/action/worker/view.go +++ b/action/worker/view.go @@ -5,11 +5,10 @@ package worker import ( "fmt" - "github.com/go-vela/cli/internal/output" + "github.com/sirupsen/logrus" + "github.com/go-vela/cli/internal/output" "github.com/go-vela/sdk-go/vela" - - "github.com/sirupsen/logrus" ) // View inspects a worker based off the provided configuration. diff --git a/action/worker/view_test.go b/action/worker/view_test.go index d27e0394..0c57125f 100644 --- a/action/worker/view_test.go +++ b/action/worker/view_test.go @@ -6,9 +6,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/mock/server" - "github.com/go-vela/sdk-go/vela" + "github.com/go-vela/server/mock/server" ) func TestWorker_Config_View(t *testing.T) { diff --git a/cmd/vela-cli/add.go b/cmd/vela-cli/add.go index ea6a893f..7171ebdd 100644 --- a/cmd/vela-cli/add.go +++ b/cmd/vela-cli/add.go @@ -3,12 +3,13 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/deployment" "github.com/go-vela/cli/command/repo" "github.com/go-vela/cli/command/schedule" "github.com/go-vela/cli/command/secret" "github.com/go-vela/cli/command/worker" - "github.com/urfave/cli/v2" ) // addCmds defines the commands for creating resources. diff --git a/cmd/vela-cli/approve.go b/cmd/vela-cli/approve.go index b545e374..65f00cc1 100644 --- a/cmd/vela-cli/approve.go +++ b/cmd/vela-cli/approve.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/build" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/build" ) // approveCmds defines the commands for approving resources. diff --git a/cmd/vela-cli/cancel.go b/cmd/vela-cli/cancel.go index 5cb5f61d..f07a2782 100644 --- a/cmd/vela-cli/cancel.go +++ b/cmd/vela-cli/cancel.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/build" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/build" ) // cancelCmds defines the commands for canceling resources. diff --git a/cmd/vela-cli/chown.go b/cmd/vela-cli/chown.go index 0f7dba32..eef0b983 100644 --- a/cmd/vela-cli/chown.go +++ b/cmd/vela-cli/chown.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/repo" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/repo" ) // chownCmds defines the commands for changing ownership of a resource. diff --git a/cmd/vela-cli/compile.go b/cmd/vela-cli/compile.go index 09b79fb3..5dd30698 100644 --- a/cmd/vela-cli/compile.go +++ b/cmd/vela-cli/compile.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/pipeline" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/pipeline" ) // compileCmds defines the commands for compiling resources. diff --git a/cmd/vela-cli/exec.go b/cmd/vela-cli/exec.go index b71de1d2..9e0f4412 100644 --- a/cmd/vela-cli/exec.go +++ b/cmd/vela-cli/exec.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/pipeline" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/pipeline" ) // execCmds defines the commands for executing resources. diff --git a/cmd/vela-cli/expand.go b/cmd/vela-cli/expand.go index 9b6d40e3..ef377305 100644 --- a/cmd/vela-cli/expand.go +++ b/cmd/vela-cli/expand.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/pipeline" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/pipeline" ) // expandCmds defines the commands for expanding resources. diff --git a/cmd/vela-cli/generate.go b/cmd/vela-cli/generate.go index 1bed4dfd..7a025f89 100644 --- a/cmd/vela-cli/generate.go +++ b/cmd/vela-cli/generate.go @@ -3,12 +3,12 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/completion" "github.com/go-vela/cli/command/config" "github.com/go-vela/cli/command/docs" "github.com/go-vela/cli/command/pipeline" - - "github.com/urfave/cli/v2" ) // generateCmds defines the commands for producing resources. diff --git a/cmd/vela-cli/get.go b/cmd/vela-cli/get.go index 36a9b0a1..8fca110a 100644 --- a/cmd/vela-cli/get.go +++ b/cmd/vela-cli/get.go @@ -3,6 +3,8 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/build" "github.com/go-vela/cli/command/deployment" "github.com/go-vela/cli/command/hook" @@ -14,7 +16,6 @@ import ( "github.com/go-vela/cli/command/service" "github.com/go-vela/cli/command/step" "github.com/go-vela/cli/command/worker" - "github.com/urfave/cli/v2" ) // getCmds defines the commands for getting a list of resources. diff --git a/cmd/vela-cli/load.go b/cmd/vela-cli/load.go index 5c844efc..e73af5e1 100644 --- a/cmd/vela-cli/load.go +++ b/cmd/vela-cli/load.go @@ -3,12 +3,11 @@ package main import ( - "github.com/go-vela/cli/action/config" - "github.com/go-vela/cli/internal" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/action/config" + "github.com/go-vela/cli/internal" ) // load is a helper function that loads the necessary configuration for the CLI. diff --git a/cmd/vela-cli/main.go b/cmd/vela-cli/main.go index 7d5b09b5..e2028e68 100644 --- a/cmd/vela-cli/main.go +++ b/cmd/vela-cli/main.go @@ -7,14 +7,13 @@ import ( "os" "time" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/login" _version "github.com/go-vela/cli/command/version" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/version" - - "github.com/sirupsen/logrus" - - "github.com/urfave/cli/v2" ) func main() { diff --git a/cmd/vela-cli/remove.go b/cmd/vela-cli/remove.go index 0585b5ec..622b7463 100644 --- a/cmd/vela-cli/remove.go +++ b/cmd/vela-cli/remove.go @@ -3,11 +3,12 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/config" "github.com/go-vela/cli/command/repo" "github.com/go-vela/cli/command/schedule" "github.com/go-vela/cli/command/secret" - "github.com/urfave/cli/v2" ) // removeCmds defines the commands for deleting resources. diff --git a/cmd/vela-cli/repair.go b/cmd/vela-cli/repair.go index ca08f976..ca1430ea 100644 --- a/cmd/vela-cli/repair.go +++ b/cmd/vela-cli/repair.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/repo" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/repo" ) // repairCmds defines the commands for repairing resources. diff --git a/cmd/vela-cli/restart.go b/cmd/vela-cli/restart.go index 0150071f..13bde6cf 100644 --- a/cmd/vela-cli/restart.go +++ b/cmd/vela-cli/restart.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/build" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/build" ) // restartCmds defines the commands for restarting resources. diff --git a/cmd/vela-cli/sync.go b/cmd/vela-cli/sync.go index 381fdca6..554ee767 100644 --- a/cmd/vela-cli/sync.go +++ b/cmd/vela-cli/sync.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/repo" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/repo" ) // syncCmds defines the commands for syncing resources. diff --git a/cmd/vela-cli/update.go b/cmd/vela-cli/update.go index 71ff021b..5c1e76d7 100644 --- a/cmd/vela-cli/update.go +++ b/cmd/vela-cli/update.go @@ -3,12 +3,13 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/config" "github.com/go-vela/cli/command/repo" "github.com/go-vela/cli/command/schedule" "github.com/go-vela/cli/command/secret" "github.com/go-vela/cli/command/worker" - "github.com/urfave/cli/v2" ) // updateCmds defines the commands for modifying resources. diff --git a/cmd/vela-cli/validate.go b/cmd/vela-cli/validate.go index 1e63d2f9..9f66e7de 100644 --- a/cmd/vela-cli/validate.go +++ b/cmd/vela-cli/validate.go @@ -3,9 +3,9 @@ package main import ( - "github.com/go-vela/cli/command/pipeline" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/command/pipeline" ) // validateCmds defines the commands for validating resources. diff --git a/cmd/vela-cli/view.go b/cmd/vela-cli/view.go index 71210323..5414481b 100644 --- a/cmd/vela-cli/view.go +++ b/cmd/vela-cli/view.go @@ -3,6 +3,8 @@ package main import ( + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/command/build" "github.com/go-vela/cli/command/config" "github.com/go-vela/cli/command/deployment" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/cli/command/service" "github.com/go-vela/cli/command/step" "github.com/go-vela/cli/command/worker" - "github.com/urfave/cli/v2" ) // viewCmds defines the commands for inspecting resources. diff --git a/command/build/approve.go b/command/build/approve.go index 4357ecdb..94ca60b6 100644 --- a/command/build/approve.go +++ b/command/build/approve.go @@ -5,12 +5,12 @@ package build import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/build" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandApprove defines the command for Approveing a build. diff --git a/command/build/approve_test.go b/command/build/approve_test.go index 78448856..5636a99f 100644 --- a/command/build/approve_test.go +++ b/command/build/approve_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestBuild_Approve(t *testing.T) { diff --git a/command/build/cancel.go b/command/build/cancel.go index 03c4a435..819865a5 100644 --- a/command/build/cancel.go +++ b/command/build/cancel.go @@ -6,12 +6,12 @@ package build import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/build" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandCancel defines the command for canceling a build. diff --git a/command/build/cancel_test.go b/command/build/cancel_test.go index f8406c9b..775b9ab7 100644 --- a/command/build/cancel_test.go +++ b/command/build/cancel_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestBuild_Cancel(t *testing.T) { diff --git a/command/build/get.go b/command/build/get.go index f6f518db..c36af74e 100644 --- a/command/build/get.go +++ b/command/build/get.go @@ -5,12 +5,12 @@ package build import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/build" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of builds. diff --git a/command/build/get_test.go b/command/build/get_test.go index 5a8ec1d1..e621579c 100644 --- a/command/build/get_test.go +++ b/command/build/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestBuild_Get(t *testing.T) { diff --git a/command/build/restart.go b/command/build/restart.go index 1f8a99c6..43fef6ca 100644 --- a/command/build/restart.go +++ b/command/build/restart.go @@ -6,12 +6,12 @@ package build import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/build" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandRestart defines the command for restarting a build. diff --git a/command/build/restart_test.go b/command/build/restart_test.go index c5a65259..62d79516 100644 --- a/command/build/restart_test.go +++ b/command/build/restart_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestBuild_Restart(t *testing.T) { diff --git a/command/build/view.go b/command/build/view.go index 3ed188fd..332fd259 100644 --- a/command/build/view.go +++ b/command/build/view.go @@ -5,12 +5,12 @@ package build import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/build" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a build. diff --git a/command/build/view_test.go b/command/build/view_test.go index 43ad28af..fc8dca1a 100644 --- a/command/build/view_test.go +++ b/command/build/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestBuild_View(t *testing.T) { diff --git a/command/completion/generate.go b/command/completion/generate.go index 4fd98250..b1b371e5 100644 --- a/command/completion/generate.go +++ b/command/completion/generate.go @@ -5,11 +5,11 @@ package completion import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/completion" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandGenerate defines the command for producing an auto completion script. diff --git a/command/config/generate.go b/command/config/generate.go index d4ec94d7..2d7e2623 100644 --- a/command/config/generate.go +++ b/command/config/generate.go @@ -5,10 +5,10 @@ package config import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action/config" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandGenerate defines the command for producing the config file. diff --git a/command/config/remove.go b/command/config/remove.go index a1cfba7b..dea65738 100644 --- a/command/config/remove.go +++ b/command/config/remove.go @@ -5,10 +5,10 @@ package config import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action/config" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandRemove defines the command for deleting one or more fields from the config file. diff --git a/command/config/update.go b/command/config/update.go index f5a1eb18..d5a2add5 100644 --- a/command/config/update.go +++ b/command/config/update.go @@ -5,10 +5,10 @@ package config import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action/config" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandUpdate defines the command for modifying one or more fields from the config file. diff --git a/command/config/view.go b/command/config/view.go index f64cf634..ce5f3fb2 100644 --- a/command/config/view.go +++ b/command/config/view.go @@ -5,10 +5,10 @@ package config import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action/config" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting the config file. diff --git a/command/deployment/add.go b/command/deployment/add.go index 0ac5b077..930d0826 100644 --- a/command/deployment/add.go +++ b/command/deployment/add.go @@ -7,14 +7,14 @@ import ( "os" "strings" + "github.com/joho/godotenv" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/deployment" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" "github.com/go-vela/types/raw" - "github.com/joho/godotenv" - - "github.com/urfave/cli/v2" ) // CommandAdd defines the command for creating a deployment. diff --git a/command/deployment/add_test.go b/command/deployment/add_test.go index 713c160c..6579c6d7 100644 --- a/command/deployment/add_test.go +++ b/command/deployment/add_test.go @@ -8,11 +8,11 @@ import ( "reflect" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" "github.com/go-vela/types/raw" - - "github.com/urfave/cli/v2" ) func TestDeployment_Add(t *testing.T) { diff --git a/command/deployment/get.go b/command/deployment/get.go index ce5002e7..6dacdcdc 100644 --- a/command/deployment/get.go +++ b/command/deployment/get.go @@ -5,12 +5,12 @@ package deployment import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/deployment" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of deployments. diff --git a/command/deployment/get_test.go b/command/deployment/get_test.go index 1e9408e0..c6e0ea69 100644 --- a/command/deployment/get_test.go +++ b/command/deployment/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestDeployment_Get(t *testing.T) { diff --git a/command/deployment/view.go b/command/deployment/view.go index 936741ff..9d14d720 100644 --- a/command/deployment/view.go +++ b/command/deployment/view.go @@ -5,12 +5,12 @@ package deployment import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/deployment" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a deployment. diff --git a/command/deployment/view_test.go b/command/deployment/view_test.go index 8e5d51de..1545a88b 100644 --- a/command/deployment/view_test.go +++ b/command/deployment/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestDeployment_View(t *testing.T) { diff --git a/command/docs/generate.go b/command/docs/generate.go index 95dabf55..d4f2c177 100644 --- a/command/docs/generate.go +++ b/command/docs/generate.go @@ -5,11 +5,11 @@ package docs import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/docs" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandGenerate defines the command for producing documentation. diff --git a/command/hook/get.go b/command/hook/get.go index fb99a348..a1b2fb84 100644 --- a/command/hook/get.go +++ b/command/hook/get.go @@ -5,12 +5,12 @@ package hook import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/hook" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of hooks. diff --git a/command/hook/get_test.go b/command/hook/get_test.go index 7899391d..c1ea14c7 100644 --- a/command/hook/get_test.go +++ b/command/hook/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestHook_Get(t *testing.T) { diff --git a/command/hook/view.go b/command/hook/view.go index 3af39755..9fce8e0f 100644 --- a/command/hook/view.go +++ b/command/hook/view.go @@ -5,12 +5,12 @@ package hook import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/hook" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a hook. diff --git a/command/hook/view_test.go b/command/hook/view_test.go index a4d281d2..15a5f8bf 100644 --- a/command/hook/view_test.go +++ b/command/hook/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestHook_View(t *testing.T) { diff --git a/command/log/get.go b/command/log/get.go index 518856ef..a4c09ddc 100644 --- a/command/log/get.go +++ b/command/log/get.go @@ -5,12 +5,12 @@ package log import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/log" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of build logs. diff --git a/command/log/get_test.go b/command/log/get_test.go index 6f8c8682..2b9ba1fb 100644 --- a/command/log/get_test.go +++ b/command/log/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestLog_Get(t *testing.T) { diff --git a/command/log/view.go b/command/log/view.go index be24ab67..226fb999 100644 --- a/command/log/view.go +++ b/command/log/view.go @@ -5,12 +5,12 @@ package log import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/log" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a log. diff --git a/command/log/view_test.go b/command/log/view_test.go index e0dfca34..cb7358d7 100644 --- a/command/log/view_test.go +++ b/command/log/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestLog_View(t *testing.T) { diff --git a/command/login/login.go b/command/login/login.go index 14559497..0ffd4761 100644 --- a/command/login/login.go +++ b/command/login/login.go @@ -6,14 +6,14 @@ import ( "fmt" "os" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/config" "github.com/go-vela/cli/action/login" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/sirupsen/logrus" - - "github.com/urfave/cli/v2" ) // CommandLogin defines the command for authenticating and logging in to Vela. diff --git a/command/pipeline/compile.go b/command/pipeline/compile.go index 160b5fd2..c83ddd5c 100644 --- a/command/pipeline/compile.go +++ b/command/pipeline/compile.go @@ -6,12 +6,12 @@ package pipeline import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandCompile defines the command for compiling a pipeline. diff --git a/command/pipeline/compile_test.go b/command/pipeline/compile_test.go index 759aafc4..8c378e88 100644 --- a/command/pipeline/compile_test.go +++ b/command/pipeline/compile_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestPipeline_Compile(t *testing.T) { diff --git a/command/pipeline/exec.go b/command/pipeline/exec.go index 633d022d..f6f2221a 100644 --- a/command/pipeline/exec.go +++ b/command/pipeline/exec.go @@ -7,16 +7,16 @@ import ( "os" "strings" + "github.com/joho/godotenv" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" - - "github.com/joho/godotenv" - "github.com/urfave/cli/v2" ) // CommandExec defines the command for executing a pipeline. diff --git a/command/pipeline/expand.go b/command/pipeline/expand.go index 698762bd..f10c7083 100644 --- a/command/pipeline/expand.go +++ b/command/pipeline/expand.go @@ -6,12 +6,12 @@ package pipeline import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandExpand defines the command for expanding a pipeline. diff --git a/command/pipeline/expand_test.go b/command/pipeline/expand_test.go index 540cbbca..9f6224c1 100644 --- a/command/pipeline/expand_test.go +++ b/command/pipeline/expand_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestPipeline_Expand(t *testing.T) { diff --git a/command/pipeline/generate.go b/command/pipeline/generate.go index 71e3ab78..edbba170 100644 --- a/command/pipeline/generate.go +++ b/command/pipeline/generate.go @@ -5,10 +5,10 @@ package pipeline import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" - - "github.com/urfave/cli/v2" ) // CommandGenerate defines the command for producing a pipeline. diff --git a/command/pipeline/get.go b/command/pipeline/get.go index 21802536..d33ed017 100644 --- a/command/pipeline/get.go +++ b/command/pipeline/get.go @@ -5,12 +5,12 @@ package pipeline import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of pipelines. diff --git a/command/pipeline/get_test.go b/command/pipeline/get_test.go index d2c21f8b..92bbbefc 100644 --- a/command/pipeline/get_test.go +++ b/command/pipeline/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestPipeline_Get(t *testing.T) { diff --git a/command/pipeline/validate.go b/command/pipeline/validate.go index 28f532cf..a5aac5b5 100644 --- a/command/pipeline/validate.go +++ b/command/pipeline/validate.go @@ -5,17 +5,16 @@ package pipeline import ( "fmt" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" - "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/util" - - "github.com/urfave/cli/v2" + "github.com/go-vela/types/constants" ) // CommandValidate defines the command for verifying a pipeline. diff --git a/command/pipeline/validate_test.go b/command/pipeline/validate_test.go index 3585760d..da4a052c 100644 --- a/command/pipeline/validate_test.go +++ b/command/pipeline/validate_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestPipeline_Validate(t *testing.T) { diff --git a/command/pipeline/view.go b/command/pipeline/view.go index e7728e81..a74fbe22 100644 --- a/command/pipeline/view.go +++ b/command/pipeline/view.go @@ -6,12 +6,12 @@ package pipeline import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/pipeline" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a pipeline. diff --git a/command/pipeline/view_test.go b/command/pipeline/view_test.go index 7e6b7d30..36cbee97 100644 --- a/command/pipeline/view_test.go +++ b/command/pipeline/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestPipeline_View(t *testing.T) { diff --git a/command/repo/add.go b/command/repo/add.go index 2fdc5ee2..dc101b53 100644 --- a/command/repo/add.go +++ b/command/repo/add.go @@ -6,14 +6,13 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandAdd defines the command for creating a repository. diff --git a/command/repo/add_test.go b/command/repo/add_test.go index 48eeeab2..65f5543e 100644 --- a/command/repo/add_test.go +++ b/command/repo/add_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Add(t *testing.T) { diff --git a/command/repo/chown.go b/command/repo/chown.go index b8d147a2..2d833482 100644 --- a/command/repo/chown.go +++ b/command/repo/chown.go @@ -6,12 +6,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandChown defines the command for changing ownership of a repository. diff --git a/command/repo/chown_test.go b/command/repo/chown_test.go index 2cfa89a4..5aa9969c 100644 --- a/command/repo/chown_test.go +++ b/command/repo/chown_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Chown(t *testing.T) { diff --git a/command/repo/get.go b/command/repo/get.go index 96611b96..e48fe7bc 100644 --- a/command/repo/get.go +++ b/command/repo/get.go @@ -5,12 +5,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of repositories. diff --git a/command/repo/get_test.go b/command/repo/get_test.go index c0c0bfd3..39b703c8 100644 --- a/command/repo/get_test.go +++ b/command/repo/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Get(t *testing.T) { diff --git a/command/repo/remove.go b/command/repo/remove.go index ce99574a..207abff6 100644 --- a/command/repo/remove.go +++ b/command/repo/remove.go @@ -6,12 +6,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandRemove defines the command for removing a repository. diff --git a/command/repo/remove_test.go b/command/repo/remove_test.go index d7e7537f..0849a366 100644 --- a/command/repo/remove_test.go +++ b/command/repo/remove_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Remove(t *testing.T) { diff --git a/command/repo/repair.go b/command/repo/repair.go index 5398b037..082bea20 100644 --- a/command/repo/repair.go +++ b/command/repo/repair.go @@ -6,12 +6,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandRepair defines the command for repairing settings of a repository. diff --git a/command/repo/repair_test.go b/command/repo/repair_test.go index 2c2ba797..5fd05e3e 100644 --- a/command/repo/repair_test.go +++ b/command/repo/repair_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Repair(t *testing.T) { diff --git a/command/repo/sync.go b/command/repo/sync.go index 1ab9b397..47817b7c 100644 --- a/command/repo/sync.go +++ b/command/repo/sync.go @@ -5,12 +5,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandSync defines the command for syncing Vela Database with SCM repositories. diff --git a/command/repo/sync_test.go b/command/repo/sync_test.go index 6f94b115..948ce5de 100644 --- a/command/repo/sync_test.go +++ b/command/repo/sync_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Sync(t *testing.T) { diff --git a/command/repo/update.go b/command/repo/update.go index 12fb3f7b..aa3ed6d4 100644 --- a/command/repo/update.go +++ b/command/repo/update.go @@ -6,14 +6,13 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandUpdate defines the command for modifying a repository. diff --git a/command/repo/update_test.go b/command/repo/update_test.go index 4205ca70..802bf54c 100644 --- a/command/repo/update_test.go +++ b/command/repo/update_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_Update(t *testing.T) { diff --git a/command/repo/view.go b/command/repo/view.go index 926ea513..775a1aa8 100644 --- a/command/repo/view.go +++ b/command/repo/view.go @@ -5,12 +5,12 @@ package repo import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/repo" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a repository. diff --git a/command/repo/view_test.go b/command/repo/view_test.go index cf25e74a..568cd367 100644 --- a/command/repo/view_test.go +++ b/command/repo/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestRepo_View(t *testing.T) { diff --git a/command/schedule/add.go b/command/schedule/add.go index ff4c5514..d7c1fd09 100644 --- a/command/schedule/add.go +++ b/command/schedule/add.go @@ -6,11 +6,12 @@ package schedule import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/schedule" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/urfave/cli/v2" ) // CommandAdd defines the command for creating a schedule. diff --git a/command/schedule/add_test.go b/command/schedule/add_test.go index b60d5e96..ec23a48b 100644 --- a/command/schedule/add_test.go +++ b/command/schedule/add_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestSchedule_Add(t *testing.T) { diff --git a/command/schedule/get.go b/command/schedule/get.go index e8c3029e..3fe0f11f 100644 --- a/command/schedule/get.go +++ b/command/schedule/get.go @@ -5,11 +5,12 @@ package schedule import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/schedule" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of schedules. diff --git a/command/schedule/get_test.go b/command/schedule/get_test.go index 610401b5..84c470c0 100644 --- a/command/schedule/get_test.go +++ b/command/schedule/get_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestSchedule_Get(t *testing.T) { diff --git a/command/schedule/remove.go b/command/schedule/remove.go index 827ff518..dc592e9f 100644 --- a/command/schedule/remove.go +++ b/command/schedule/remove.go @@ -6,11 +6,12 @@ package schedule import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/schedule" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/urfave/cli/v2" ) // CommandRemove defines the command for removing a schedule. diff --git a/command/schedule/remove_test.go b/command/schedule/remove_test.go index 63d0e4b8..3bf36b2d 100644 --- a/command/schedule/remove_test.go +++ b/command/schedule/remove_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestSchedule_Remove(t *testing.T) { diff --git a/command/schedule/update.go b/command/schedule/update.go index 9eda9c42..d77c66d1 100644 --- a/command/schedule/update.go +++ b/command/schedule/update.go @@ -6,11 +6,12 @@ package schedule import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/schedule" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/urfave/cli/v2" ) // CommandUpdate defines the command for modifying a schedule. diff --git a/command/schedule/update_test.go b/command/schedule/update_test.go index 1bc1a2c2..4ba3561b 100644 --- a/command/schedule/update_test.go +++ b/command/schedule/update_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestSchedule_Update(t *testing.T) { diff --git a/command/schedule/view.go b/command/schedule/view.go index 10f4877f..fb614a9f 100644 --- a/command/schedule/view.go +++ b/command/schedule/view.go @@ -6,11 +6,12 @@ package schedule import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/schedule" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a schedule. diff --git a/command/schedule/view_test.go b/command/schedule/view_test.go index 62c320ed..00495f01 100644 --- a/command/schedule/view_test.go +++ b/command/schedule/view_test.go @@ -7,9 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - "github.com/urfave/cli/v2" ) func TestSchedule_View(t *testing.T) { diff --git a/command/secret/add.go b/command/secret/add.go index ebf3b592..4329dfdc 100644 --- a/command/secret/add.go +++ b/command/secret/add.go @@ -6,14 +6,13 @@ import ( "fmt" "slices" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/secret" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandAdd defines the command for creating a secret. @@ -147,7 +146,7 @@ DOCUMENTATION: // helper function to capture the provided input // and create the object used to create a secret. // -//nolint:dupl // ignore similar code with update + func add(c *cli.Context) error { // load variables from the config file err := action.Load(c) diff --git a/command/secret/add_test.go b/command/secret/add_test.go index fdf96361..44bd4a33 100644 --- a/command/secret/add_test.go +++ b/command/secret/add_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestSecret_Add(t *testing.T) { diff --git a/command/secret/get.go b/command/secret/get.go index 64003406..cdde0c0e 100644 --- a/command/secret/get.go +++ b/command/secret/get.go @@ -5,14 +5,13 @@ package secret import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/secret" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for inspecting a secret. diff --git a/command/secret/get_test.go b/command/secret/get_test.go index fa0d8e65..55e3a146 100644 --- a/command/secret/get_test.go +++ b/command/secret/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestSecret_Get(t *testing.T) { diff --git a/command/secret/remove.go b/command/secret/remove.go index 7e4e27c8..3b0a7155 100644 --- a/command/secret/remove.go +++ b/command/secret/remove.go @@ -6,14 +6,13 @@ package secret import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/secret" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandRemove defines the command for inspecting a secret. diff --git a/command/secret/remove_test.go b/command/secret/remove_test.go index dfbe6470..3018c54e 100644 --- a/command/secret/remove_test.go +++ b/command/secret/remove_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestSecret_Remove(t *testing.T) { diff --git a/command/secret/update.go b/command/secret/update.go index ddd8327e..4e4e28ee 100644 --- a/command/secret/update.go +++ b/command/secret/update.go @@ -6,14 +6,13 @@ import ( "fmt" "slices" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/secret" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandUpdate defines the command for updating a secret. @@ -147,7 +146,7 @@ DOCUMENTATION: // helper function to capture the provided input // and create the object used to modify a secret. // -//nolint:dupl // ignore similar code with add + func update(c *cli.Context) error { // load variables from the config file err := action.Load(c) diff --git a/command/secret/update_test.go b/command/secret/update_test.go index fca99765..b39c6c73 100644 --- a/command/secret/update_test.go +++ b/command/secret/update_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestSecret_Update(t *testing.T) { diff --git a/command/secret/view.go b/command/secret/view.go index aa0e7b29..7a42c12d 100644 --- a/command/secret/view.go +++ b/command/secret/view.go @@ -6,14 +6,13 @@ package secret import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/secret" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - "github.com/go-vela/types/constants" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a secret. diff --git a/command/secret/view_test.go b/command/secret/view_test.go index 5e479a8c..03d10cb1 100644 --- a/command/secret/view_test.go +++ b/command/secret/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestSecret_View(t *testing.T) { diff --git a/command/service/get.go b/command/service/get.go index 36a7fcff..c5c7e9cb 100644 --- a/command/service/get.go +++ b/command/service/get.go @@ -5,12 +5,12 @@ package service import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/service" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of services. diff --git a/command/service/get_test.go b/command/service/get_test.go index d5e0b37f..63189e82 100644 --- a/command/service/get_test.go +++ b/command/service/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestService_Get(t *testing.T) { diff --git a/command/service/view.go b/command/service/view.go index 698b5730..cf4cef0a 100644 --- a/command/service/view.go +++ b/command/service/view.go @@ -5,12 +5,12 @@ package service import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/service" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a service. diff --git a/command/service/view_test.go b/command/service/view_test.go index b5ff95fe..e158a20f 100644 --- a/command/service/view_test.go +++ b/command/service/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestService_View(t *testing.T) { diff --git a/command/step/get.go b/command/step/get.go index c1efa631..9237813d 100644 --- a/command/step/get.go +++ b/command/step/get.go @@ -5,12 +5,12 @@ package step import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/step" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of steps. diff --git a/command/step/get_test.go b/command/step/get_test.go index 63b0ad0e..db0608c3 100644 --- a/command/step/get_test.go +++ b/command/step/get_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestStep_Get(t *testing.T) { diff --git a/command/step/view.go b/command/step/view.go index e06029a2..884d0415 100644 --- a/command/step/view.go +++ b/command/step/view.go @@ -5,12 +5,12 @@ package step import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/step" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a step. diff --git a/command/step/view_test.go b/command/step/view_test.go index 7ee84677..45fce996 100644 --- a/command/step/view_test.go +++ b/command/step/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestStep_View(t *testing.T) { diff --git a/command/version/version.go b/command/version/version.go index d1091116..9e3f7c32 100644 --- a/command/version/version.go +++ b/command/version/version.go @@ -5,12 +5,12 @@ package version import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/output" "github.com/go-vela/cli/version" - - "github.com/urfave/cli/v2" ) // CommandVersion defines the command for returning version information on the CLI. diff --git a/command/worker/add.go b/command/worker/add.go index c572aae3..76136175 100644 --- a/command/worker/add.go +++ b/command/worker/add.go @@ -1,18 +1,17 @@ // SPDX-License-Identifier: Apache-2.0 -//nolint:dupl // ignore similar code with update package worker import ( "fmt" "net/url" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/worker" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandAdd defines the command for adding a worker. diff --git a/command/worker/add_test.go b/command/worker/add_test.go index 736e3d14..311718c2 100644 --- a/command/worker/add_test.go +++ b/command/worker/add_test.go @@ -7,11 +7,11 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" "github.com/go-vela/worker/mock/worker" - - "github.com/urfave/cli/v2" ) func TestWorker_Add(t *testing.T) { diff --git a/command/worker/get.go b/command/worker/get.go index cd91868e..69462386 100644 --- a/command/worker/get.go +++ b/command/worker/get.go @@ -7,12 +7,12 @@ import ( "strconv" "time" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/worker" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandGet defines the command for capturing a list of workers. diff --git a/command/worker/get_test.go b/command/worker/get_test.go index a16cf72c..12a059b9 100644 --- a/command/worker/get_test.go +++ b/command/worker/get_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestWorker_Get(t *testing.T) { diff --git a/command/worker/update.go b/command/worker/update.go index 822029d1..2f48d0fc 100644 --- a/command/worker/update.go +++ b/command/worker/update.go @@ -6,12 +6,12 @@ import ( "fmt" "strconv" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/worker" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandUpdate defines the command for modifying a worker. diff --git a/command/worker/update_test.go b/command/worker/update_test.go index 9d0bf436..e27983fa 100644 --- a/command/worker/update_test.go +++ b/command/worker/update_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestWorker_Update(t *testing.T) { diff --git a/command/worker/view.go b/command/worker/view.go index eccd56e7..c7f39efb 100644 --- a/command/worker/view.go +++ b/command/worker/view.go @@ -5,12 +5,12 @@ package worker import ( "fmt" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/action" "github.com/go-vela/cli/action/worker" "github.com/go-vela/cli/internal" "github.com/go-vela/cli/internal/client" - - "github.com/urfave/cli/v2" ) // CommandView defines the command for inspecting a worker. @@ -67,7 +67,7 @@ DOCUMENTATION: // helper function to capture the provided input // and create the object used to inspect a worker. // -//nolint:dupl // ignore similar code with chown, get, remove and repair + func view(c *cli.Context) error { // load variables from the config file err := action.Load(c) diff --git a/command/worker/view_test.go b/command/worker/view_test.go index 237200c9..5c15edf9 100644 --- a/command/worker/view_test.go +++ b/command/worker/view_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestWorker_View(t *testing.T) { diff --git a/go.mod b/go.mod index da1332d2..4e1b6462 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/go-vela/cli -go 1.21 +go 1.21.9 require ( github.com/Masterminds/semver/v3 v3.2.1 diff --git a/internal/client/client.go b/internal/client/client.go index c1ce0aa1..67988050 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -7,13 +7,11 @@ import ( "net/url" "runtime" - "github.com/go-vela/cli/internal" - - "github.com/go-vela/sdk-go/vela" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/cli/internal" + "github.com/go-vela/sdk-go/vela" ) // Parse digests the provided urfave/cli context diff --git a/internal/client/client_test.go b/internal/client/client_test.go index d26da310..a79e95cb 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -7,10 +7,10 @@ import ( "net/http/httptest" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/cli/test" "github.com/go-vela/server/mock/server" - - "github.com/urfave/cli/v2" ) func TestClient_Parse(t *testing.T) { diff --git a/internal/output/dump.go b/internal/output/dump.go index 662cdfc2..7b7f3d11 100644 --- a/internal/output/dump.go +++ b/internal/output/dump.go @@ -6,7 +6,6 @@ import ( "os" "github.com/davecgh/go-spew/spew" - "github.com/sirupsen/logrus" ) diff --git a/internal/output/spew.go b/internal/output/spew.go index e8fe893b..9f4518a6 100644 --- a/internal/output/spew.go +++ b/internal/output/spew.go @@ -6,7 +6,6 @@ import ( "os" "github.com/davecgh/go-spew/spew" - "github.com/sirupsen/logrus" ) diff --git a/internal/output/yaml.go b/internal/output/yaml.go index 7074df4f..21c2a642 100644 --- a/internal/output/yaml.go +++ b/internal/output/yaml.go @@ -6,9 +6,8 @@ import ( "fmt" "os" - "gopkg.in/yaml.v3" - "github.com/sirupsen/logrus" + "gopkg.in/yaml.v3" ) // YAML parses the provided input and diff --git a/version/version.go b/version/version.go index f6dfde32..f363d79b 100644 --- a/version/version.go +++ b/version/version.go @@ -7,8 +7,9 @@ import ( "runtime" "github.com/Masterminds/semver/v3" - "github.com/go-vela/types/version" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/version" ) var (