Add pre-commit framework integration (.pre-commit-hooks.yaml)#230
Open
seonghobae wants to merge 1 commit into
Open
Add pre-commit framework integration (.pre-commit-hooks.yaml)#230seonghobae wants to merge 1 commit into
seonghobae wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Like
action.ymlfor GitHub Actions, this is a 3-line adoption lever for the pre-commit framework. Consumer repos add:and every commit is scanned — deploy-blocking findings block the commit via the scanner's exit code.
language: pythoninstalls the package via the existing pyproject console script;pass_filenames: falsebecause scan takes a path.scan --diff(Add scan --diff for fast PR checks #210) lands.appguardrail hookdirect 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