-
Notifications
You must be signed in to change notification settings - Fork 56
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
Not ignoring files even though it is excluded in Black config #146
Comments
Hi @roniemartinez, thanks a lot for your report! I'm wondering how Darker should behave if I'm using it to run e.g. Black, isort, Pylint and Mypy on my repository, and there's a Black exclude configured in |
Hi @akaihola Yes, it should still apply isort, Pylint and Mypy and skip Black. If Mypy has exclude, Darker should also consider it. |
That makes sense. On the technical side, these different tools are invoked differently by Darker, and in the case of Black, we bypass command line handling and file selection, and just submit the contents of the Python source code directly to
I don't now remember exactly why I ended up calling directly into Black internals, but there was a good reason at that time for sure. At least it doesn't harm performance since Python+Black don't need to be bootstrapped separately for each file. |
I guess the first option makes more sense because Darker is already reading Black's configuration in darker/src/darker/black_diff.py Line 79 in 694c06c
|
Thanks @roniemartinez, I'll definitely look into this in the near future. Or feel free to contribute a patch as well! |
@roniemartinez would you like to review #171? Can I invite you as a collaborator on this project? |
@akaihola Thank you so much for the effort. |
So here's a sample config for Black and
setup.py
is ignored by Black when you run it.However, darker is not respecting this configuration and still reformats
setup.py
Additional detail: darker is set in Pycharm's File Watcher so it keeps reformatting excluded files.
The text was updated successfully, but these errors were encountered: