chore(pre-commit): pin hook revisions to SHAs and align the gocyclo threshold by cristim · Pull Request #2241 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

chore(pre-commit): pin hook revisions to SHAs and align the gocyclo threshold - #2241

Merged
cristim merged 1 commit into
mainfrom
chore/pin-hooks-actionlint
Oct 16, 2026
Merged

cristim merged 1 commit into
mainfrom
chore/pin-hooks-actionlint

Conversation

@cristim

@cristim cristim commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Refs #1594. This covers the tooling items. Dependabot/Renovate and CODEOWNERS stay open as an owner decision.

Summary

  • Pinned the third-party pre-commit hooks to commit SHAs. Before, they referenced mutable tags. Both tags are lightweight, so each SHA is the tagged commit itself:

    • pre-commit/pre-commit-hooks v6.0.0 → 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c
    • igorshubovych/markdownlint-cli v0.47.0 → 76b3d32d3f4b965e1d6425253c59407420ae2c43

    The version stays as a trailing comment, which is the format pre-commit autoupdate keeps. Every other hook is repo: local or a digest-pinned image.

  • Aligned the golangci gocyclo threshold with the enforcing gates. .golangci.yml had min-complexity: 15, while Makefile:73, ci.yml:75 and the pre-commit gocyclo hook use -over 10. Both now flag complexity above 10, since golangci filters with the same "over" boundary. Lowering it to 10 adds no new findings.

  • actionlint: already on main as a digest-pinned docker hook scoped to .github/workflows/. chore: prune monorepo residue from config and docs #2234 already removed the check-yaml workflow exclude. Nothing new was needed here, and actionlint passes on the current workflows.

Evidence (local, macOS)

  • pre-commit run --all-files passes, including the re-pinned hooks and actionlint.
  • golangci-lint v2.10.1 (the CI pin) reports 0 issues with min-complexity: 10.
  • scripts/test-git-secrets-allowlist.sh passes 44/44, and make build passes.
  • CI's pre-commit run --all-files is unchanged. The pins only rebuild the cached hook environments.
  • An independent non-author reviewer (sonnet, high) did two passes:
    • re-resolved both SHAs with git ls-remote;
    • checked the gocyclo boundary in the golangci-lint v2.10.1 source;
    • found no actionable findings at 7d112552.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated code complexity checks to apply a stricter threshold.
    • Pinned pre-commit tools to specific revisions while keeping their configured versions unchanged.
    • These updates affect repository maintenance and validation workflows. They do not change the application’s features or behavior for end users. No other user-facing changes are included in this release.

… actionlint

Pin pre-commit-hooks v6.0.0 and markdownlint-cli v0.47.0 to the commit
SHAs their tags resolve to. The actionlint hook (digest-pinned image) is
already present, so no hook is added. Align the golangci gocyclo
threshold with the enforcing gates (-over 10); no new findings.

Refs #1594

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim cristim added priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/internal Team-internal only effort/l Weeks type/chore Maintenance / non-user-visible triaged Item has been triaged labels Oct 16, 2026
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

@cristim

cristim commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@cristim
cristim merged commit a2e7f4f into main Oct 16, 2026
12 checks passed
@cristim
cristim deleted the chore/pin-hooks-actionlint branch October 16, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/l Weeks impact/internal Team-internal only priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant