You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gocyclo pre-commit hook (.pre-commit-config.yaml, gocyclo -over 10) runs --all-files in the pre-commit CI workflow, so it evaluates the whole repo on every PR. Four pre-existing AWS service-client functions sit at cyclomatic complexity 11, above the hook's threshold of 10, which keeps the pre-commit CI job red on every PR regardless of what the PR changes.
Why this isn't covered by existing lint-debt issues
golangci-lint also runs gocyclo, but its threshold is min-complexity: 15 (.golangci.yml), so the Lint Code job and the golangci burn-down (#1342) do not flag these functions. They are only caught by the stricter pre-commit hook (-over 10). No existing issue tracks this threshold gap.
Align the pre-commit gocyclo -over threshold with golangci's min-complexity (15) so the two gates agree, if 15 is the intended project standard.
Option 1 is preferred (lower complexity is the real goal); option 2 is a config-only stopgap.
Context
Surfaced by the pre-commit CI job on PR #1376 (the new per-package gosec hook). #1376 does not touch any Go code — this is pre-existing repo-wide debt caught by the --all-files run.
Summary
The
gocyclopre-commit hook (.pre-commit-config.yaml,gocyclo -over 10) runs--all-filesin thepre-commitCI workflow, so it evaluates the whole repo on every PR. Four pre-existing AWS service-client functions sit at cyclomatic complexity 11, above the hook's threshold of 10, which keeps thepre-commitCI job red on every PR regardless of what the PR changes.Offending functions (all complexity 11)
providers/aws/services/redshift/client.go:414—(*Client).findOfferingIDproviders/aws/services/opensearch/client.go:369—(*Client).findOfferingIDproviders/aws/services/memorydb/client.go:285—(*Client).findOfferingIDproviders/aws/services/elasticache/client.go:288—(*Client).paginateElastiCacheOfferingsWhy this isn't covered by existing lint-debt issues
golangci-lintalso runsgocyclo, but its threshold ismin-complexity: 15(.golangci.yml), so theLint Codejob and the golangci burn-down (#1342) do not flag these functions. They are only caught by the stricter pre-commit hook (-over 10). No existing issue tracks this threshold gap.Suggested fix (either is acceptable)
gocyclo -overthreshold with golangci'smin-complexity(15) so the two gates agree, if 15 is the intended project standard.Option 1 is preferred (lower complexity is the real goal); option 2 is a config-only stopgap.
Context
Surfaced by the
pre-commitCI job on PR #1376 (the new per-package gosec hook). #1376 does not touch any Go code — this is pre-existing repo-wide debt caught by the--all-filesrun.