Skip to content

feat(hooks): let driftcheck skip intentionally non-executable scripts#64

Merged
ulises-c merged 1 commit into
mainfrom
fix/driftcheck-ignore
Jul 23, 2026
Merged

feat(hooks): let driftcheck skip intentionally non-executable scripts#64
ulises-c merged 1 commit into
mainfrom
fix/driftcheck-ignore

Conversation

@ulises-c

Copy link
Copy Markdown
Owner

Summary

Adds ignore support to the driftcheck.sh Stop hook so repos with intentionally non-executable scripts (e.g. navecho_monorepo, where run scripts are chmod'd at their install destination) no longer block the end of every Claude Code session.

Closes #56

Design note — diverges from the issue's original spec

Issue #56 proposed a per-repo .driftcheckignore committed at each repo root. What this PR ships instead is a single global ignore file at ~/.claude/hooks/driftcheck-ignore, holding repo-relative glob patterns (one per line, # comments and blank lines allowed). This is the design that ended up in the working copy — it avoids committing a Claude-tooling dotfile into third-party/work repos.

Trade-off to be aware of when reviewing: because the file is global, its repo-relative patterns apply in every repo — e.g. workstation_install/*/settings.sh would also exempt an identically-shaped path in an unrelated project. If you'd rather have the per-repo semantics from the issue, say so and I'll swap the implementation.

Testing

  • shellcheck --severity=warning clean (SC2053 explicitly disabled — unquoted RHS glob match is the point).
  • Verified end-to-end in a scratch repo with an overridden $HOME:
    • no ignore file → violation flagged, exit 2
    • matching glob pattern → violation skipped, exit 0
    • non-matching pattern → still flagged, exit 2
    • ignored file plus a different violation → other violation still flagged, exit 2

🤖 Generated with Claude Code

…#56)

Repo-relative glob patterns in ~/.claude/hooks/driftcheck-ignore exempt
files from the shebang/exec-bit consistency check, for repos whose
documented convention conflicts (sourced-only settings files, scripts
chmod'd at their install destination).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ulises-c
ulises-c merged commit 85e1a83 into main Jul 23, 2026
5 checks passed
@ulises-c
ulises-c deleted the fix/driftcheck-ignore branch July 23, 2026 18:11
ulises-c added a commit that referenced this pull request Jul 23, 2026
Resolves the driftcheck.sh conflict in favor of main's version: #64
landed the global ~/.claude/hooks/driftcheck-ignore design for #56, so
this branch's per-repo .driftcheckignore variant (cf23033) is dropped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

driftcheck.sh: Stop hook has no way to exempt intentionally non-executable scripts — add .driftcheckignore support

1 participant