--- # yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json version: "2" # golangci-lint configuration # Aligned with SonarCloud "Sonar way" quality gate # https://docs.sonarsource.com/sonarqube-cloud/standards/managing-quality-gates/ # # Key alignments: # - gosec: Aligns with Security Rating A requirement (no vulnerabilities) # - gocyclo (min: 10): Stricter than SonarCloud (not enforced) # - dupl: Aligns with duplicated lines density <= 3% # - lll (120 chars): Stricter than SonarCloud (not enforced) # - Code coverage: See Makefile target 'test-coverage-check' (>= 60%, goal: 80% for new code) # # SonarCloud focuses on new code (last 30 days), local linting checks entire codebase # Local standards are intentionally stricter in some areas (complexity, line length) run: timeout: 5m go: "1.24" linters: default: standard enable: # Additional linters beyond standard - asciicheck - bidichk - bodyclose - canonicalheader - contextcheck - dupl - errname - exhaustive - forcetypeassert - funcorder - goconst - gocritic - gocyclo - godot - godox - goheader - gosec - iface - importas - lll - maintidx - misspell - nilerr - nlreturn - nolintlint - perfsprint - prealloc - predeclared - reassign - revive - tagalign - testableexamples - thelper - usestdlibvars - usetesting disable: # Disable noisy linters - funlen - wsl - wrapcheck settings: lll: line-length: 120 misspell: locale: US gocyclo: min-complexity: 10 goconst: min-len: 2 min-occurrences: 3 formatters: enable: - gofmt - goimports - golines settings: golines: max-len: 120 gofmt: simplify: true rewrite-rules: - pattern: "interface{}" replacement: "any" - pattern: "a[b:len(a)]" replacement: "a[b:]" goimports: local-prefixes: - github.com/ivuorinen/gh-action-readme issues: max-issues-per-linter: 150 max-same-issues: 50 fix: true