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
{{ message }}
Repository navigation
Main pre-commit broken: gocyclo complexity 12 in recEffectiveSavingsPct #1222
recEffectiveSavingsPct was introduced by PR #1206 (merged as cfead3b) with cyclomatic complexity 12, above the hook's -over 10 threshold. The hook runs gocyclo -over 10 over all non-test Go files, so every PR's "Run pre-commit hooks" CI job now fails regardless of what the PR touches (observed on PR #1219, and reproducible locally with gocyclo -over 10 internal/config/store_postgres_recommendations.go on main).
PR #1220 (fix/main-ci-failing-jobs) fixed the lint, govulncheck, and test failures on main but did not address this one.
Fix: refactor recEffectiveSavingsPct to complexity <= 10, for example by extracting the on-demand baseline reconstruction into a helper. Behavior must stay identical (the function's semantics are covered by the #1103/#1148 net-savings rules documented in its comment).
Activity
Merge pull request #1254 from LeanerCloud/fix/1222-precommit-repair