My pre-commit-hooks
More info at pre-commit.com
Add this to your .pre-commit-config.yaml
- repo: https://github.com/tobiasknudsen/pre-commit-hooks
rev: v0.1.0 # Use the ref you want to point at
hooks:
- id: check-forbidden-strings
# - id: ...
Prevent commit if specific provided strings exists in the staged files.
- Pass the forbidden strings in
args: [--string=do not commit, -s=local_testing_variable]
. - Supports regular expressions.