diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b0639690..009616ee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,21 +24,10 @@ jobs: name: Checkout frontend-operator - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version version: latest - - args: > - --enable=errcheck,gocritic,gofmt,goimports,gosec,gosimple,govet,ineffassign,revive,staticcheck,typecheck,unused,bodyclose - --fix=false - --max-same-issues=20 - --out-${NO_FUTURE}format=colored-line-number - --print-issued-lines=true - --print-linter-name=true - --sort-results=true - --timeout=5m0s - --uniq-by-line=false # Optional: working directory, useful for monorepos # working-directory: somedir @@ -46,7 +35,7 @@ jobs: # args: --issues-exit-code=0 # Optional: show only new issues if it's a pull request. The default value is `false`. - only-new-issues: false +# only-new-issues: false # Optional: if set to true then the all caching functionality will be complete disabled, # takes precedence over all other caching options. diff --git a/.golangci.yml b/.golangci.yml index 91bd5443..c40c9d96 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,75 @@ +linters: + # Enable specific linter + # https://golangci-lint.run/usage/linters/#enabled-by-default + enable: + - errcheck + - gocritic + - gofmt + - goimports + - gosec + - gosimple + - govet + - ineffassign + - revive + - staticcheck + - typecheck + - unused + - bodyclose issues: exclude-rules: - path: api/v1alpha1/groupversion_info.go linters: - gofmt - goimports + # Fix found issues (if it's supported by the linter). + # Default: false + # fix: true + + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 20 + +output: +# The formats used to render issues. +# Formats: +# - `colored-line-number` +# - `line-number` +# - `json` +# - `colored-tab` +# - `tab` +# - `html` +# - `checkstyle` +# - `code-climate` +# - `junit-xml` +# - `github-actions` +# - `teamcity` +# - `sarif` +# Output path can be either `stdout`, `stderr` or path to the file to write to. +# +# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. +# The output can be specified for each of them by separating format name and path by colon symbol. +# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" +# The CLI flag (`--out-format`) override the configuration file. +# +# Default: +# formats: +# - format: colored-line-number +# path: stdout +# Print lines of code with issue. +# Default: true +# print-issued-lines: false +# Print linter name in the end of issue text. +# Default: true +# print-linter-name: false +# Sort results by the order defined in `sort-order`. +# Default: false + sort-results: true +# Make issues output unique by line. +# Default: true + uniq-by-line: false + +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 5m