Skip to content

devanshshukla99/pre-commit-hook-prohibit-string

Repository files navigation

Prohibit String

build codestyle

Provides a pre-commit hook for prohibiting a string in a package, for example, prohibiting from warnings import warn may be useful.

Usage

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: ""

About

Provides a pre-commit hook for prohibiting a string in a package.

Topics

Resources

License

Stars

Watchers

Forks

Languages