diff --git a/.golangci.yaml b/.golangci.yaml index f2dd296..16fafd8 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,27 +1,17 @@ -# TODO: enable this when we have coverage on docstring comments -#issues: +issues: + max-same-issues: 25 + + # TODO: enable this when we have coverage on docstring comments # # The list of ids of default excludes to include or disable. # include: # - EXC0002 # disable excluding of issues about comments from golint -linters-settings: - funlen: - # Checks the number of lines in a function. - # If lower than 0, disable the check. - # Default: 60 - lines: 80 - # Checks the number of statements in a function. - # If lower than 0, disable the check. - # Default: 40 - statements: 60 - linters: # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint disable-all: true enable: - asciicheck - bodyclose - - depguard - dogsled - dupl - errcheck @@ -40,7 +30,6 @@ linters: - ineffassign - misspell - nakedret - - nolintlint - revive - staticcheck - stylecheck @@ -50,23 +39,44 @@ linters: - unused - whitespace +linters-settings: + funlen: + # Checks the number of lines in a function. + # If lower than 0, disable the check. + # Default: 60 + lines: 80 + # Checks the number of statements in a function. + # If lower than 0, disable the check. + # Default: 40 + statements: 60 +output: + uniq-by-line: false +run: + timeout: 10m + # do not enable... +# - deadcode # The owner seems to have abandoned the linter. Replaced by "unused". +# - depguard # We don't have a configuration for this yet +# - goprintffuncname # does not catch all cases and there are exceptions +# - nakedret # does not catch all cases and should not fail a build # - gochecknoglobals # - gochecknoinits # this is too aggressive +# - rowserrcheck disabled per generics https://github.com/golangci/golangci-lint/issues/2649 # - godot # - godox # - goerr113 -# - golint # deprecated -# - gomnd # this is too aggressive -# - interfacer # this is a good idea, but is no longer supported and is prone to false positives -# - lll # without a way to specify per-line exception cases, this is not usable -# - maligned # this is an excellent linter, but tricky to optimize and we are not sensitive to memory layout optimizations +# - goimports # we're using gosimports now instead to account for extra whitespaces (see https://github.com/golang/go/issues/20818) +# - golint # deprecated +# - gomnd # this is too aggressive +# - interfacer # this is a good idea, but is no longer supported and is prone to false positives +# - lll # without a way to specify per-line exception cases, this is not usable +# - maligned # this is an excellent linter, but tricky to optimize and we are not sensitive to memory layout optimizations # - nestif +# - nolintlint # as of go1.19 this conflicts with the behavior of gofmt, which is a deal-breaker (lint-fix will still fail when running lint) # - prealloc # following this rule isn't consistently a good idea, as it sometimes forces unnecessary allocations that result in less idiomatic code +# - rowserrcheck # not in a repo with sql, so this is not useful # - scopelint # deprecated +# - structcheck # The owner seems to have abandoned the linter. Replaced by "unused". # - testpackage +# - varcheck # The owner seems to have abandoned the linter. Replaced by "unused". # - wsl # this doens't have an auto-fixer yet and is pretty noisy (https://github.com/bombsimon/wsl/issues/90) -# - varcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. -# - deadcode # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. -# - structcheck # deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. -# - rowserrcheck # we're not using sql.Rows at all in the codebase \ No newline at end of file diff --git a/Makefile b/Makefile index ff8acfb..9e2ce11 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ LINT_CMD = $(TEMP_DIR)/golangci-lint run --tests=false --timeout=2m --config .go GOIMPORTS_CMD = $(TEMP_DIR)/gosimports -local github.com/anchore # Tool versions ################################# -GOLANG_CI_VERSION = v1.52.2 +GOLANG_CI_VERSION = v1.55.1 GOBOUNCER_VERSION = v0.4.0 GOSIMPORTS_VERSION = v0.3.8 diff --git a/go.mod b/go.mod index fb2e66f..698e165 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/anchore/clio go 1.18 require ( - github.com/anchore/fangs v0.0.0-20230807173929-13c94c86f47e + github.com/anchore/fangs v0.0.0-20240215005329-6b6c25b340ce github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a github.com/google/go-cmp v0.6.0 github.com/gookit/color v1.5.4 @@ -53,5 +53,3 @@ require ( golang.org/x/text v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) - -replace github.com/anchore/fangs => ../fangs diff --git a/go.sum b/go.sum index ef5736c..f1f0492 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls= github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E= +github.com/anchore/fangs v0.0.0-20240215005329-6b6c25b340ce h1:hyiwsH4q81oE1Mkxb9HJFZ++F3g2E0Gb8Vlalqm6PPQ= +github.com/anchore/fangs v0.0.0-20240215005329-6b6c25b340ce/go.mod h1:supVCDeubm8EHH8Ko8NO6hwB21NqJH6o0pWOu3AAWEo= github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a h1:nJ2G8zWKASyVClGVgG7sfM5mwoZlZ2zYpIzN2OhjWkw= github.com/anchore/go-logger v0.0.0-20230725134548-c21dafa1ec5a/go.mod h1:ubLFmlsv8/DFUQrZwY5syT5/8Er3ugSr4rDFwHsE3hg= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=