← Back to Pull requests

build: Fix lint failures with golangci-lint v2.15.0 #26

Closed
unknown closed this pull request without merging on Dec 02, 2026 12:04 UTC
View on GitHub
unknown unknown commented on Dec 01, 2026 09:04 UTC
Author

#21 bumped golangci-lint from v2.9.0 to v2.15.0, and make validate-lint has failed on main since. v2.15.0 deprecates linters and settings this config relied on, and its newer checks flag existing code. This PR keeps v2.15.0 and fixes the config and code so lint passes again.

Config (.golangci.yaml)


  • Disable the deprecated exhaustruct and gomodguard. With default: all, their _v5/_v2 replacements already run. exhaustruct_v5 ignores //nolint:exhaustruct, so the three directives in the auto tests now name exhaustruct_v5.

  • Replace the deprecated gofumpt extra-rules with extra.group-params and extra.clothe-returns.

  • Replace the inline //nolint:revive directives on gpg.FromKey, program.New and ssh.FromKey with one unexported-return exclusion rule. revive reports this on Go 1.26 but not on Go 1.27, so the inline directives would trip nolintlint on stable. An exclusion that matches nothing is not reported, so the rule works on both versions.
  • Code


  • goconst: name the repeated key-file literals in the auto tests, and the key ID and SSH key path in the program tests. Add an sshSignArgs helper for the repeated ssh-keygen argument prefix.

  • modernize: use errors.AsType to detect passphrase-protected SSH keys.

  • gosec G204: annotate the intentional subprocess launch in program.newExecCommand. The program path is resolved by the caller and runs without a shell.

  • Bump the program module's go directive to 1.26.0, matching the other objectsigner modules. errors.AsType needs Go 1.26.
  • Testing


  • make validate-lint with golangci-lint v2.15.0: 0 issues in all four modules.

  • make test: passes in all four modules.
  • Diff: 212 lines (+159 / -53) across 2 files Reviewer: hiddeco Review duration: 1620m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 212 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.321
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #26"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.5% (MEDIUM) · Higher = larger blast radius
    36.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.4% · Safe to merge
    14.4%
    Repository