Skip to content

Add environment variable toggles to disable hooks per-project#10

Merged
tyom merged 1 commit intomasterfrom
optional-hooks
Jan 16, 2026
Merged

Add environment variable toggles to disable hooks per-project#10
tyom merged 1 commit intomasterfrom
optional-hooks

Conversation

@tyom
Copy link
Owner

@tyom tyom commented Jan 16, 2026

Hooks can now be disabled via LINT_ON_SAVE and RUN_TESTS_ON_STOP environment variables (both default to true). Set to "false" in .claude/settings.local.json to skip hooks for specific projects.

Summary by CodeRabbit

  • New Features

    • Introduced configurable Hooks feature enabling automatic linting, type checking and test execution.
    • Added per-project configuration support via environment variables for customising behaviour.
  • Documentation

    • Added comprehensive Hooks feature guide outlining available hooks, trigger conditions and configuration instructions.

✏️ Tip: You can customize this high-level summary in your review settings.

Hooks can now be disabled via LINT_ON_SAVE and RUN_TESTS_ON_STOP
environment variables (both default to true). Set to "false" in
.claude/settings.local.json to skip hooks for specific projects.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The pull request adds documentation for the Hooks feature and introduces configuration toggles to control hook behaviour. A new README explains available hooks and their triggers, whilst two TypeScript files are updated to support environment variables that conditionally disable lint/typecheck and test execution respectively.

Changes

Cohort / File(s) Summary
Documentation
claude-plugin/hooks/README.md
New documentation file detailing the Hooks feature, including PostToolUse and Stop hooks, trigger conditions, supported file extensions, and environment variable configuration (LINT_ON_SAVE, RUN_TESTS_ON_STOP) with defaults and descriptions.
Feature Toggles
claude-plugin/hooks/post-tool-use/lint-and-typecheck.ts, claude-plugin/hooks/stop/run-tests.ts
Added early exit guards in both files to disable their respective functionality when corresponding environment variables are set to "false". Both implement identical guard patterns at the start of main() with success exit codes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With hooks now configurable and free,
LINT_ON_SAVE controls what shall be!
RUN_TESTS_ON_STOP, a toggle so fine,
Our plugin's behaviour now bends to design! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add environment variable toggles to disable hooks per-project' accurately summarizes the main change, which adds LINT_ON_SAVE and RUN_TESTS_ON_STOP environment variables to allow per-project hook configuration.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7acf5bf and d52ce49.

📒 Files selected for processing (3)
  • claude-plugin/hooks/README.md
  • claude-plugin/hooks/post-tool-use/lint-and-typecheck.ts
  • claude-plugin/hooks/stop/run-tests.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (3)
claude-plugin/hooks/post-tool-use/lint-and-typecheck.ts (1)

133-144: Clear opt‑out guard for lint/typecheck.

This keeps default behaviour intact while providing a straightforward per‑project disable switch.

claude-plugin/hooks/stop/run-tests.ts (1)

228-235: Opt‑out toggle for stop tests is clear and safe.

Default behaviour remains unchanged; the early exit cleanly disables the hook when requested.

claude-plugin/hooks/README.md (1)

1-45: Documentation aligns well with the new hook toggles.

The triggers, actions, and per‑project configuration are clearly described.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@tyom tyom merged commit 55fc15e into master Jan 16, 2026
3 checks passed
@tyom tyom deleted the optional-hooks branch January 16, 2026 19:44
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.

1 participant