Skip to content

Add pre-commit framework integration (.pre-commit-hooks.yaml)#230

Open
seonghobae wants to merge 1 commit into
developfrom
pre-commit-hook
Open

Add pre-commit framework integration (.pre-commit-hooks.yaml)#230
seonghobae wants to merge 1 commit into
developfrom
pre-commit-hook

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

Like action.yml for GitHub Actions, this is a 3-line adoption lever for the pre-commit framework. Consumer repos add:

repos:
  - repo: https://github.com/ContextualWisdomLab/appguardrail
    rev: v0.1.1
    hooks:
      - id: appguardrail

and every commit is scanned — deploy-blocking findings block the commit via the scanner's exit code.

  • language: python installs the package via the existing pyproject console script; pass_filenames: false because scan takes a path.
  • Real flags only — the changed-files variant is deliberately left out until scan --diff (Add scan --diff for fast PR checks #210) lands.
  • Complements the existing appguardrail hook direct git-hook installer.

Test plan

  • pytest — 224 passed, incl. tests/test_pre_commit_hooks.py (hook id/entry/language assertions + a guard that no unmerged flags are referenced).

🤖 Generated with Claude Code

Like action.yml for GitHub Actions, this is a 3-line adoption lever for the
pre-commit framework (https://pre-commit.com): consumer repos add the hook to
.pre-commit-config.yaml and every commit is scanned, with deploy-blocking
findings blocking the commit via the scanner's exit code.

- .pre-commit-hooks.yaml at repo root: id appguardrail, entry `appguardrail
  scan .` (real flags only — no --diff until #210 lands), language: python
  (installs via pyproject console script), pass_filenames: false.
- Complements the existing `appguardrail hook` direct git-hook installer.
- Tests: tests/test_pre_commit_hooks.py (hook id/entry/language asserted +
  a guard that no unmerged flags are referenced).
- Verified: full suite 224 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EywwS2Du8pimW7xqRP3An3
@seonghobae seonghobae enabled auto-merge (squash) July 6, 2026 07:25
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