diff --git a/.circleci/config.yml b/.circleci/config.yml index 4019700..2dc2dc0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ # syntax, such as anchors, will be fixed automatically. version: 2.1 orbs: - shared: getoutreach/shared@2.17.0 + shared: getoutreach/shared@dev:first queue: eddiewebb/queue@1.8.4 parameters: @@ -16,7 +16,6 @@ contexts: &contexts - ghaccesstoken - docker-registry - npm-credentials - - prismacloud-credentials - vault-dev - confluence - circleci-credentials diff --git a/.tool-versions b/.tool-versions index d1afcfe..c83d7bd 100644 --- a/.tool-versions +++ b/.tool-versions @@ -4,10 +4,10 @@ # you are reducing compatibility guarantees. ## <> ## <> -golang 1.19.11 terraform 1.4.4 protoc 21.5 nodejs 18.14.1 +golang 1.20.7 # Note: Versions in this block do not override the default versions above # but sometimes you have to declare additional versions of the same tool # while leaving the 'default' version intact for the infra. diff --git a/.vscode/launch.json b/.vscode/launch.json index 9bd3e40..327c1b7 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -38,14 +38,14 @@ // Maps the go module cache on the host to the persistent volume used by devspaces. // See the value of `go env GOMODCACHE` on the host and devspace. { - "from": "${env:HOME}/.asdf/installs/golang/1.19.11/packages/pkg/mod", + "from": "${env:HOME}/.asdf/installs/golang/1.20.7/packages/pkg/mod", "to": "/tmp/cache/go/mod/" }, { // Maps the standard library location on the host to the location in the devspace. // This enables debugging standard library code. - "from": "${env:HOME}/.asdf/installs/golang/1.19.11/go/src", - "to": "/home/dev/.asdf/installs/golang/1.19.11/go/src" + "from": "${env:HOME}/.asdf/installs/golang/1.20.7/go/src", + "to": "/home/dev/.asdf/installs/golang/1.20.7/go/src" } ] }, diff --git a/.vscode/settings.json b/.vscode/settings.json index 8b2f154..4ea5c26 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,6 +14,7 @@ }, "go.buildTags": "or_dev", "go.testTags": "or_test,or_int,or_e2e", + "files.trimTrailingWhitespace": true, // This prevents 99% of issues with linters :) "editor.formatOnSave": true, "shellcheck.customArgs": ["-P", "SCRIPTDIR", "-x"], diff --git a/go.mod b/go.mod index 3889e81..d223c39 100644 --- a/go.mod +++ b/go.mod @@ -3,18 +3,20 @@ module github.com/getoutreach/lintroller go 1.19 require ( - github.com/getoutreach/gobox v1.71.0 + github.com/getoutreach/gobox v1.73.2 github.com/pkg/errors v0.9.1 golang.org/x/tools v0.12.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.0 ) -require github.com/rogpeppe/go-internal v1.9.0 // indirect +require ( + github.com/kr/pretty v0.3.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect +) require ( github.com/google/go-cmp v0.5.9 // indirect - github.com/kr/text v0.2.0 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/sys v0.11.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/go.sum b/go.sum index bb0f6df..ffb1750 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,19 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/getoutreach/gobox v1.71.0 h1:5T3G94y6aG7lqnfzXzMhuR/hw0VnNGwU7VQLml+Lwsw= -github.com/getoutreach/gobox v1.71.0/go.mod h1:NMFEug44bFUQnpGTS9vov/WsZK36fnQFLDl+3p/yeas= +github.com/getoutreach/gobox v1.73.2 h1:LDTPzWHj37d/GsYCPJIHHais+f+7aUP8ZS9YuU+qJXU= +github.com/getoutreach/gobox v1.73.2/go.mod h1:Kx002WFAj+lUVqo7LLxSaQ1w2Mcqg1gefd+qQKr/QGM= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= @@ -21,8 +24,10 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= diff --git a/opslevel.yml b/opslevel.yml index 28b294f..cef782c 100644 --- a/opslevel.yml +++ b/opslevel.yml @@ -38,7 +38,7 @@ service: - key: stencil_version value: "v1.36.0" - key: golang_version - value: "1.19.11" + value: "1.20.7" - key: cli value: "false" - key: service diff --git a/scripts/golangci.yml b/scripts/golangci.yml index 2e08fc0..bac9f3e 100644 --- a/scripts/golangci.yml +++ b/scripts/golangci.yml @@ -9,18 +9,42 @@ linters-settings: govet: check-shadowing: true revive: - confidence: 0 + rules: + # Enable the default golint rules. We must include these because + # we configure a single rule, which disables the default rules. + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: unreachable-code + - name: redefines-builtin-id + # While we agree with this rule, right now it would break too many + # projects. So, we disable it by default. + - name: unused-parameter + disabled: true gocyclo: min-complexity: 25 - maligned: - suggest-new: true dupl: threshold: 100 goconst: min-len: 3 min-occurrences: 3 - misspell: - locale: US lll: line-length: 140 gocritic: @@ -84,7 +108,6 @@ issues: linters: - gocyclo - errcheck - - dupl - gosec - funlen - gochecknoglobals # Globals in test files are tolerated. diff --git a/service.yaml b/service.yaml index 6b5bc3c..ae10877 100644 --- a/service.yaml +++ b/service.yaml @@ -16,6 +16,9 @@ arguments: modules: - name: github.com/getoutreach/stencil-base - name: github.com/getoutreach/stencil-golang + channel: unstable + - name: github.com/getoutreach/devbase + channel: main - name: github.com/getoutreach/stencil-outreach - name: github.com/getoutreach/stencil-circleci - name: github.com/getoutreach/stencil-actions diff --git a/stencil.lock b/stencil.lock index fa1f309..ad79ff0 100644 --- a/stencil.lock +++ b/stencil.lock @@ -2,7 +2,7 @@ version: v1.36.0 modules: - name: github.com/getoutreach/devbase url: https://github.com/getoutreach/devbase - version: v2.17.0 + version: main - name: github.com/getoutreach/stencil-actions url: https://github.com/getoutreach/stencil-actions version: v0.3.0 @@ -17,7 +17,7 @@ modules: version: v1.8.0 - name: github.com/getoutreach/stencil-golang url: https://github.com/getoutreach/stencil-golang - version: v1.13.2 + version: unstable - name: github.com/getoutreach/stencil-outreach url: https://github.com/getoutreach/stencil-outreach version: v0.12.2