Skip to main content

Module hook_cmd

Module hook_cmd 

Source
Expand description

sparrow hook install and sparrow hook scan commands.

The install subcommand installs a pre-commit hook via git config that scans staged files for secrets, tokens, and other sensitive content before each commit.

The scan subcommand performs a one-off scan of staged files (or the entire working tree) for secrets and sensitive patterns.

Constants§

PRE_COMMIT_HOOK_SCRIPT
The shell script that is installed as a Git pre-commit hook. It runs sparrow hook scan to check staged files.

Functions§

run_hook_install
Install the Sparrow pre-commit hook into the current git repository.
run_hook_scan
Run a one-off scan of staged files (or the entire working tree if scan_all is true) for secrets and sensitive patterns.