Closed peterjc closed 5 years ago
Have to say I'm completely lost in the logic of override and the if/elif/return madness, but don't have much time now to try to simplify it. Still, I strongly feel like you're overengineering stuff: there should be one if
(is the black config supplied in the config? is it a correct file?) which checks from which file the config should be loaded (project or global).
If you're completely lost, then it is too complicated.
One simplification would be if we could offload the path normalisation to flake8 (my issue #13), but that seems to me to be broken: https://gitlab.com/pycqa/flake8/issues/562
Note also that using flake8 to do the path normalisation would currently prevent using None
(or any non-string) as a default value in order to tell apart no value set, and the empty string being used. PR proposed:
https://gitlab.com/pycqa/flake8/merge_requests/337
Closing for a third attempt...
A reworking of PR #15.
Builds on #11, makes the caching of parsed
pyproject.toml
files more explicit (runflake8 -v ... | grep black
to see this in the logs).Adds new
BLK997
if apyproject.toml
file is invalid, allows usingflake8 --black-config '' ...
(or any other bash syntax to pass an empty string) to mean ignore anypyproject.toml
files.What do you think @098799 ?