-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isort pre-commit hook does not skip text files #3750
Comments
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort
+ files: ".+[.]py"
# https://github.com/python/black#version-control-integration
- repo: https://github.com/python/black Not sure if this regex is the one we should use, but it does seem to work. |
You can tell isort to skip files in the So I think adapting |
actually, |
fwiw, the problem here is the |
MCVE Code Sample
Add arbitrary change to the file
doc/pandas.rst
git add doc/pandas.rst git commit -m "test"
The pre-commit hook will fail.
Expected Output
the pre-commit hook to pass
Problem Description
running
isort -rc doc/*
will change the following files:unfortunately it does not behave properly and deletes/ changes arbitrary lines. Can the pre-commit hook be told to only run on *.py files? On the command line this would be
isort -rc *.py
The text was updated successfully, but these errors were encountered: