ale icon indicating copy to clipboard operation
ale copied to clipboard

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

Open bellini666 opened this issue 4 years ago • 3 comments

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 avatar Oct 21 '20 23:10 bellini666

Just opened an issue there too to check to see if that is possible: https://github.com/psf/black/issues/1776

bellini666 avatar Oct 21 '20 23:10 bellini666

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?

arcanemachine avatar Nov 03 '22 14:11 arcanemachine

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.

StevenMaude avatar Sep 06 '23 17:09 StevenMaude