-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: remove flake8 dependency #96
base: master
Are you sure you want to change the base?
feat: remove flake8 dependency #96
Conversation
@warsaw can you review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ConfigParser
andConfigFileFinder
classes, 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
ConfigParser
class from configparser module.The new function is largely inspired by Flake8 own implementation, mainly the
load_config
andparse_config
functions.