Conversation
|
@warsaw can you review this PR? |
There was a problem hiding this comment.
Thank you for taking the time to look at this, it does seem like it will be an improvement but I am not sure it does everything that that black would do with configuration files (I think the aim is to match the behaviour with the name changed). The alternative would be changing the documentation to describe the simpler set of things Blue does.
I suggest it needs some testing. Can a pre-release be made?
In particular looking at the where black looks for configuration , this suggests that:
- It will look recursively starting from the current working directory, not sure this fix behaves quite the same
- it will look for a global file in the HOME directory
- it will use a
[tool.black]section in a toml file.
The logic Black implements can be found in files.py
|
@krcb197 The fix only looks in the current working directory, but shouldn't be hard to improve |
|
@krcb197 PR updated applying Black logic for config files. Waiting for your review :) |
|
Looks good to me |
Fixes: #78
Blue relies on flake8 to parse config files like 'setup.cfg', 'tox.ini' and '.blue'. This was done using
ConfigParserandConfigFileFinderclasses, but in flake8 v5/6 these classes have been removed.To fix the problem, all flake8 related code was removed and replace with a new function that parses the config files. This is all done using
ConfigParserclass from configparser module.The new function is largely inspired by Flake8 own implementation, mainly the
load_configandparse_configfunctions.