diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index af5ad5120..bc87e2fb5 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -127,10 +127,10 @@ jobs: - run: go version - run: go mod tidy - name: golangci-lint - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc #v3 + uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 #v9.2.0 with: skip-pkg-cache: true - version: v1.64.2 + version: v2.11.3 args: -c .golangci.yml --timeout 5m only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml index 6e90bdd56..f584ca617 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,17 +1,10 @@ # .golangci.yml - +version: "2" run: timeout: 5m - issues: - exclude-dirs: - - test/testdata_etc - - internal/cache - - internal/renameio - - internal/robustio linters: - disable-all: true enable: - bodyclose - depguard @@ -23,107 +16,108 @@ linters: - goconst - gocritic - gocyclo - - gofmt - - goimports - ineffassign - mnd # replacement for gomnd - nakedret - revive # replacement for golint - rowserrcheck - staticcheck - - stylecheck - - typecheck - unconvert - unparam - unused # covers deadcode/varcheck/structcheck - whitespace - -linters.settings: - depguard: - list-type: blacklist - rules: - main: - allow: - - $gostd - - github.com/checkmarx/ast-cli/internal - - github.com/gookit/color - - github.com/CheckmarxDev/containers-resolver/pkg/containerResolver - - github.com/Checkmarx/manifest-parser/pkg/parser/models - - github.com/Checkmarx/manifest-parser/pkg/parser - - github.com/Checkmarx/secret-detection/pkg/hooks/pre-commit - - github.com/Checkmarx/secret-detection/pkg/hooks/pre-receive - - github.com/Checkmarx/gen-ai-prompts/prompts/sast_result_remediation - - github.com/spf13/viper - - github.com/checkmarx/2ms/v3/lib/reporting - - github.com/checkmarx/2ms/v3/lib/secrets - - github.com/checkmarx/2ms/v3/pkg - - github.com/Checkmarx/gen-ai-wrapper - - github.com/spf13/cobra - - github.com/pkg/errors - - github.com/google - - github.com/MakeNowJust/heredoc - - github.com/jsumners/go-getport - - github.com/stretchr/testify/assert - - github.com/gofrs/flock - - github.com/golang-jwt/jwt/v5 - - github.com/Checkmarx/containers-images-extractor/pkg/imagesExtractor - - github.com/Checkmarx/containers-types/types - dupl: - threshold: 500 - funlen: - lines: 200 - statements: 100 - goconst: - min-len: 2 - min-occurrences: 2 - gocritic: - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - disabled-checks: - - dupImport # https://github.com/go-critic/go-critic/issues/845 - - ifElseChain - - octalLiteral - - whyNoLint - - wrapperFunc - gocyclo: - min-complexity: 15 - goimports: - local-prefixes: github.com/golangci/golangci-lint - mnd: - settings: - mnd: - checks: argument,case,condition,return - revive: + exclusions: + paths: + - test/testdata_etc + - internal/cache + - internal/renameio + - internal/robustio rules: - - name: exported - arguments: - - disableStutteringCheck - govet: - settings: - printf: - funcs: - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - lll: - line-length: 185 - maligned: - suggest-new: true - misspell: - locale: US + - path: _test\.go + linters: + - mnd + settings: + depguard: + rules: + main: + list-mode: lax + allow: + - $gostd + - github.com/checkmarx/ast-cli/internal + - github.com/gookit/color + - github.com/CheckmarxDev/containers-resolver/pkg/containerResolver + - github.com/Checkmarx/manifest-parser/pkg/parser/models + - github.com/Checkmarx/manifest-parser/pkg/parser + - github.com/Checkmarx/secret-detection/pkg/hooks/pre-commit + - github.com/Checkmarx/secret-detection/pkg/hooks/pre-receive + - github.com/Checkmarx/gen-ai-prompts/prompts/sast_result_remediation + - github.com/spf13/viper + - github.com/checkmarx/2ms/v3/lib/reporting + - github.com/checkmarx/2ms/v3/lib/secrets + - github.com/checkmarx/2ms/v3/pkg + - github.com/Checkmarx/gen-ai-wrapper + - github.com/spf13/cobra + - github.com/pkg/errors + - github.com/google + - github.com/MakeNowJust/heredoc + - github.com/jsumners/go-getport + - github.com/stretchr/testify/assert + - github.com/gofrs/flock + - github.com/golang-jwt/jwt/v5 + - github.com/Checkmarx/containers-images-extractor/pkg/imagesExtractor + - github.com/Checkmarx/containers-types/types + dupl: + threshold: 500 + funlen: + lines: 200 + statements: 100 + goconst: + min-len: 2 + min-occurrences: 2 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + disabled-checks: + - dupImport # https://github.com/go-critic/go-critic/issues/845 + - ifElseChain + - octalLiteral + - whyNoLint + - wrapperFunc + gocyclo: + min-complexity: 15 + mnd: + checks: + - argument + - case + - condition + - return + revive: + rules: + - name: exported + arguments: + - disableStutteringCheck + govet: + settings: + printf: + funcs: + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf + lll: + line-length: 185 + misspell: + locale: US -issues: - exclude-rules: - - path: _test\.go - linters: - - mnd - -service: - golangci-lint-version: 1.64.2 - prepare: - - echo "No special prep steps needed" +formatters: + enable: + - gofmt + - goimports + settings: + goimports: + local-prefixes: + - github.com/golangci/golangci-lint diff --git a/go.mod b/go.mod index ac5bb290b..e2c14ffe5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/checkmarx/ast-cli -go 1.24.13 +go 1.25.8 require ( @@ -8,7 +8,7 @@ require ( github.com/Checkmarx/containers-types v1.0.9 github.com/Checkmarx/gen-ai-prompts v0.0.0-20240807143411-708ceec12b63 github.com/Checkmarx/gen-ai-wrapper v1.0.3 - github.com/Checkmarx/manifest-parser v0.1.1 + github.com/Checkmarx/manifest-parser v0.1.2 github.com/Checkmarx/secret-detection v1.2.1 github.com/MakeNowJust/heredoc v1.0.0 github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 diff --git a/go.sum b/go.sum index bcfbd0012..db2028549 100644 --- a/go.sum +++ b/go.sum @@ -77,8 +77,8 @@ github.com/Checkmarx/gen-ai-prompts v0.0.0-20240807143411-708ceec12b63 h1:SCuTcE github.com/Checkmarx/gen-ai-prompts v0.0.0-20240807143411-708ceec12b63/go.mod h1:MI6lfLerXU+5eTV/EPTDavgnV3owz3GPT4g/msZBWPo= github.com/Checkmarx/gen-ai-wrapper v1.0.3 h1:p7lc/U4dFltsIxAEeWeDNW4+8ovvlJvdb5pVBLcbKs8= github.com/Checkmarx/gen-ai-wrapper v1.0.3/go.mod h1:xwRLefezwNNnRGu1EjGS6wNiR9FVV/eP9D+oXwLViVM= -github.com/Checkmarx/manifest-parser v0.1.1 h1:Yp/fy0NjeLxxcS8y9AA9yIzWafC/Zeqn36YjVSe91DU= -github.com/Checkmarx/manifest-parser v0.1.1/go.mod h1:hh5FX5FdDieU8CKQEkged4hfOaSylpJzub8PRFXa4kA= +github.com/Checkmarx/manifest-parser v0.1.2 h1:Sh2xkpeOWKu56Y7wo+ljckNGHAQX1uITEeH3cI2T0pg= +github.com/Checkmarx/manifest-parser v0.1.2/go.mod h1:hh5FX5FdDieU8CKQEkged4hfOaSylpJzub8PRFXa4kA= github.com/Checkmarx/secret-detection v1.2.1 h1:Hzpz74dcN/L14Q86ARvPOZpKBnERzGTpy6sl1RXKOTo= github.com/Checkmarx/secret-detection v1.2.1/go.mod h1:kbXbtIQisDdB/TNuV7r9HPclEznUyBHLQ5yr7IX7vBQ= github.com/CycloneDX/cyclonedx-go v0.9.2 h1:688QHn2X/5nRezKe2ueIVCt+NRqf7fl3AVQk+vaFcIo= @@ -297,8 +297,6 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v29.0.3+incompatible h1:8J+PZIcF2xLd6h5sHPsp5pvvJA+Sr2wGQxHkRl53a1E= -github.com/docker/cli v29.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v29.2.0+incompatible h1:9oBd9+YM7rxjZLfyMGxjraKBKE4/nVyvVfN4qNl9XRM= github.com/docker/cli v29.2.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=