Provides a pre-commit hook for prohibiting a string in a package, for example,
prohibiting from warnings import warn may be useful.
Add the following to .pre-commit-config.yaml:
- repo: https://github.com/devanshshukla99/pre-commit-hook-prohibit-string
rev: {github release tag}
hooks:
- id: prohibit-string
args: [--prohibit-string, "{string}"]Example to forbid from warnings import warn and warnings.warn:
- repo: https://github.com/devanshshukla99/pre-commit-hook-prohibit-string
rev: v1.2
hooks:
- id: prohibit-string
args: [--prohibit-string, "from warnings import warn,warnings.warn"]
exclude: ""