diff --git a/.github/workflows/go-tests-windows.yml b/.github/workflows/go-tests-windows.yml index 9885340059f..055ada306a4 100644 --- a/.github/workflows/go-tests-windows.yml +++ b/.github/workflows/go-tests-windows.yml @@ -58,6 +58,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: - version: v2.13 + version: v2.15 args: --issues-exit-code=1 --timeout 10m only-new-issues: false diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index a7044779ef7..3426d78d3bc 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -224,6 +224,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 with: - version: v2.13 + version: v2.15 args: --issues-exit-code=1 --timeout 10m only-new-issues: false diff --git a/.golangci.yml b/.golangci.yml index 362a798a703..6c25f0b96b5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -179,28 +179,25 @@ linters: # Default: [ switch ] check: - switch - - map + - mapliteral # Presence of "default" case in switch statements satisfies exhaustiveness, # even if all enum members are not listed. # Default: false default-signifies-exhaustive: true # Enum members matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. - # Default: "" - ignore-enum-members: "Example.+" + ignore-constants: + - "Example.+" # Enum types matching the supplied regex do not have to be listed in # switch statements to satisfy exhaustiveness. - # Default: "" - ignore-enum-types: "Example.+" + ignore-types: + - "Example.+" # Consider enums only in package scopes, not in inner scopes. # Default: false package-scope-only: true - # Only run exhaustive check on switches with "//exhaustive:enforce" comment. + # Only run exhaustive check on switches and map literals with "//exhaustive:enforce" comment. # Default: false - explicit-exhaustive-switch: true - # Only run exhaustive check on map literals with "//exhaustive:enforce" comment. - # Default: false - explicit-exhaustive-map: true + explicit-exhaustive: true # Switch statement requires default case even if exhaustive. # Default: false default-case-required: true @@ -409,12 +406,18 @@ linters: arguments: # lower this after refactoring - 219 + # new in v2.14, to enable soon + - name: marshal-receiver + disabled: true - name: max-control-nesting arguments: # lower this after refactoring - 5 - name: max-public-structs disabled: true + # new in v2.14, to enable soon + - name: multiline-if-init + disabled: true - name: nested-structs disabled: true - name: package-comments diff --git a/AGENTS.md b/AGENTS.md index 8432fe9c967..9c915d37916 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,7 +31,7 @@ Say which, in the PR body. - Lint while iterating: `golangci-lint run ./pkg//...` - Before pushing: `make lint`. It lints linux, windows and freebsd, same as CI — so expect findings outside your change if it's platform-specific. -- Use golangci-lint v2.13, the version CI pins. Other versions report different things. +- Use golangci-lint v2.15, the version CI pins. Other versions report different things. - Don't restructure working code to satisfy a linter that's switched off. Check the `disable:` list in `.golangci.yml` before "fixing" something it never complained about. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c8c03c0551c..3c921a5e369 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ stages: - task: GoTool@0 displayName: "Install Go" inputs: - version: '1.27.1' + version: '1.27.3' - pwsh: | choco install -y make diff --git a/go.mod b/go.mod index 55f514ed7aa..47fb7d881f8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/crowdsecurity/crowdsec -go 1.27.1 +go 1.27.3 require ( ariga.io/atlas v1.3.0