https://github.com/kieran-ryan/removestar-pre-commit
A pre-commit hook for removing wildcard Python imports
https://github.com/kieran-ryan/removestar-pre-commit
imports pre-commit python
Last synced: 5 months ago
JSON representation
A pre-commit hook for removing wildcard Python imports
- Host: GitHub
- URL: https://github.com/kieran-ryan/removestar-pre-commit
- Owner: kieran-ryan
- License: mit
- Created: 2023-07-16T12:48:15.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T14:43:07.000Z (almost 2 years ago)
- Last Synced: 2025-09-11T05:00:34.863Z (9 months ago)
- Topics: imports, pre-commit, python
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# removestar-pre-commit
[](https://pypi.org/project/removestar/)
[](https://pypi.python.org/pypi/removestar)
[](https://pypi.python.org/pypi/pyprojectsort)
[](https://results.pre-commit.ci/latest/github/kieran-ryan/removestar-pre-commit/main)
A [pre-commit](https://pre-commit.com/) hook for [removestar](https://github.com/asmeurer/removestar).
Distributed as a standalone repository to enable installing `removestar` via prebuilt wheels from
[PyPI](https://pypi.org/project/removestar/).
>[!IMPORTANT]
> A pre-commit hook has subsequently been natively integrated to [removestar](https://github.com/asmeurer/removestar) (see asmeurer/removestar#33). Please use that instead.
### Using removestar with [pre-commit](https://pre-commit.com)
Add this to your `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/kieran-ryan/removestar-pre-commit
rev: 1.3.1
hooks:
- id: removestar
args: [-i, ]
```
To run the hook on Jupyter Notebooks too:
```yaml
- repo: https://github.com/kieran-ryan/removestar-pre-commit
rev: 1.3.1
hooks:
- id: removestar
args: [-i, ]
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](https://opensource.org/licenses/MIT).