diff --git a/.golangci.yml b/.golangci.yml index 946fbc0ef64..c0f1402c993 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,19 +24,27 @@ issues: # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + exclude-files: + - ".*\\.hcl2spec\\.go$" + # - lib/bad.go + linters: disable-all: true enable: - - deadcode - - errcheck + # - deadcode + # - errcheck - goimports - - gosimple - - govet - - ineffassign - - staticcheck - - unconvert - - unused - - varcheck + # - gosimple + # - govet + # - ineffassign + # - staticcheck + # - unconvert + # - unused + # - varcheck fast: true # options for analysis running @@ -65,18 +73,6 @@ run: # - src/external_libs # - autogenerated_by_my_lib - # default is true. Enables skipping of directories: - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - skip-dirs-use-default: true - - # which files to skip: they will be analyzed, but issues from them - # won't be reported. Default value is empty list, but there is - # no need to include all autogenerated files, we confidently recognize - # autogenerated files. If it's not please let us know. - skip-files: - - ".*\\.hcl2spec\\.go$" - # - lib/bad.go - # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes @@ -90,7 +86,8 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: colored-line-number + formats: + - format: colored-line-number # print lines of code with issue, default is true print-issued-lines: true @@ -113,11 +110,6 @@ linters-settings: # default is false: such cases aren't reported by default. check-blank: false - # [deprecated] comma-separated list of pairs of the form pkg:regex - # the regex is used to ignore names within pkg. (default "fmt:.*"). - # see https://github.com/kisielk/errcheck#the-deprecated-method for details - ignore: fmt:.*,io/ioutil:^Read.*,io:Close - # path to a file containing a list of functions to exclude from checking # see https://github.com/kisielk/errcheck#excluding-functions for details #exclude: /path/to/file.txt diff --git a/Makefile b/Makefile index c6f145f3c1f..f47966d61de 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ install-gen-deps: ## Install dependencies for code generation install-lint-deps: ## Install linter dependencies @echo "==> Updating linter dependencies..." - @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.46.0 + @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.58.0 dev: ## Build and install a development build @grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \