-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Automatically ignore files in .gitignore #475
Comments
I think this is reasonable for black to do :) |
See also #541. |
I'll go for it. |
What should be the expected behavior between DEFAULT_EXCLUDES, command-line, pyproject and .gitignore ? Actually : command-line > pyproject > default. each is exclusive. .gitignore being everywhere I don't know if we can be as exclusive. My proposal when .igitignore exists:
thanks for your opinion on it. |
I need your opinion to go on @zsol |
This is the kind of errors I'd like to get rid of:
I have no intention of formatting a Note that |
Because we have |
FWIW, on top of automatically parsing .gitignore & .hgignore (and possibly some others) several code-searching tool have standardised on a .ignore file with similar semantics, so support for that would also be nice. |
This was solved with #878. |
I think a feature to automatically ignore files and directories listed in
.gitignore
would be useful. This file normally contains a long list of auto-generated files or files that are otherwise unnecessary to format. By pruning these big directories, black will run much faster. By adding such a feature, black will require even less configuration as most projects will no longer require passing--exclude
on the command line.Other opinionated code format tools already do this or are discussing this. For example:
JavaScript Standard: https://standardjs.com/#how-do-i-ignore-files
PHP-CS-Fixer: PHP-CS-Fixer/PHP-CS-Fixer#3947 (comment)
The text was updated successfully, but these errors were encountered: