Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

kieran-ryan/removestar-pre-commit

Repository files navigation

removestar-pre-commit

image image image pre-commit.ci status

A pre-commit hook for removestar.

Distributed as a standalone repository to enable installing removestar via prebuilt wheels from PyPI.

Note: A pre-commit hook has subsequently been natively integrated to removestar (see asmeurer/removestar#33). Please use that instead.

Using removestar with pre-commit

Add this to your .pre-commit-config.yaml:

- repo: https://github.com/kieran-ryan/removestar-pre-commit
  rev: 1.3.1
  hooks:
    - id: removestar
      args: [-i, <source_code_dir>]

To run the hook on Jupyter Notebooks too:

- repo: https://github.com/kieran-ryan/removestar-pre-commit
  rev: 1.3.1
  hooks:
    - id: removestar
      args: [-i, <source_code_dir>]
      types_or: [python, pyi, jupyter]

Removestar's pre-commit hook should be placed after other formatting tools, such as Black and isort, unless you enable autofix, in which case, removestar's pre-commit hook should run before Black, isort, and other formatting tools, as removestar's autofix behaviour can output code changes that require reformatting.

License

removestar-pre-commit is licensed under the MIT License.