Files
breakpilot-compliance/ai-compliance-sdk/.golangci.yml
T
Benjamin_Boenisch b83c3e6e00
CI / detect-changes (push) Successful in 16s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / build-sha-integrity (push) Successful in 11s
CI / validate-canonical-controls (push) Successful in 5s
CI / loc-budget (push) Successful in 19s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Successful in 57s
CI / iace-gt-coverage (push) Successful in 16s
CI / test-python-backend (push) Has been skipped
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
ci(go-lint): golangci-lint v1.64.8 (go1.24) + new-from-merge-base (#32)
2026-06-23 10:58:48 +00:00

88 lines
2.7 KiB
YAML

# golangci-lint configuration for ai-compliance-sdk
# Docs: https://golangci-lint.run/usage/configuration/
#
# Philosophy: catch real bugs and security issues; skip style nits on legacy code.
# Run: cd ai-compliance-sdk && golangci-lint run --timeout 5m ./...
run:
timeout: 5m
modules-download-mode: readonly
linters:
disable-all: true
enable:
# --- Correctness ---
- errcheck # unhandled error returns
- govet # suspicious constructs (shadow, printf, copylocks, …)
- staticcheck # SA* checks: bugs, deprecated APIs, ineffectual code
- ineffassign # assignments whose result is never used
- unused # exported/unexported symbols that are never referenced
# --- Security ---
- gosec # G* checks: SQL injection, hardcoded credentials, weak crypto, …
# --- Complexity / maintainability ---
- gocyclo # cyclomatic complexity > threshold
- gocritic # opinionated but practical style + correctness checks
- revive # linter on top of golint; many useful checks
# --- Formatting / imports ---
- goimports # gofmt + import grouping
linters-settings:
errcheck:
# Don't flag fmt.Print* and similar convenience functions.
exclude-functions:
- fmt.Print
- fmt.Println
- fmt.Printf
- fmt.Fprint
- fmt.Fprintln
- fmt.Fprintf
gocyclo:
# Handlers and store methods that wrap many DB queries are allowed to be
# somewhat complex. This is a reasonable threshold.
min-complexity: 20
gosec:
# G104 (unhandled errors) is covered by errcheck; G304/G306 (file
# path injection) would need context — keep but accept on review.
excludes:
- G104
revive:
rules:
- name: exported
arguments:
- disableStutteringCheck
- name: error-return
- name: increment-decrement
- name: var-declaration
- name: package-comments
disabled: true # not enforced on internal packages
gocritic:
enabled-tags:
- diagnostic
- performance
disabled-checks:
- hugeParam # flags large structs passed by value — too noisy until we audit
- rangeValCopy # same reason
issues:
# Don't fail on generated protobuf stubs or vendor code.
exclude-rules:
- path: "_pb\\.go$"
linters: [all]
- path: "vendor/"
linters: [all]
# Report at most 50 issues per linter so the first run is readable.
max-issues-per-linter: 50
max-same-issues: 5
# New code only: lint lines changed vs main, so pre-existing debt doesn't fail CI.
# Needs the go-lint job to clone with a local `main` ref (see .gitea/workflows/ci.yaml).
new-from-merge-base: main