Skip to content
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

Python black doesn't respect ignored files in their config files #3406

Open
bellini666 opened this issue Oct 21, 2020 · 3 comments
Open

Python black doesn't respect ignored files in their config files #3406

bellini666 opened this issue Oct 21, 2020 · 3 comments
Labels

Comments

@bellini666
Copy link

Unlike flake8, black doesn't have a --stdin-display-name option. Because of that it will ignore excluded files from the config since ale is passing the buffer through stdin to the command.

Is there a workaround it? Or is it black's responsibility to add something like that in their api?

@bellini666 bellini666 added the bug label Oct 21, 2020
@bellini666
Copy link
Author

Just opened an issue there too to check to see if that is possible: psf/black#1776

@arcanemachine
Copy link

Hello, I see that the problem got solved on Black's side of things, but I am unable to get ALE to skip Black formatting for excluded files, even using the force-exclude option in pyproject.toml.

Is there any extra configuration required to get ALE + Black + excluded files to work as desired?

@StevenMaude
Copy link

Encountering this same problem, and found since this issue was opened that Black added --stdin-filename which would enable excludes to be respected when using Black's force-exclude.

I guess the implementation would be something similar to #4414, which added similar functionality in ALE for the Ruff linter and fixer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants