-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
load-plugins not working if configured in setup.cfg [pylint.MASTER] #4272
Comments
If you use [MASTER]
load-plugins=pylint.extensions.bad_builtin
[pylint.DEPRECATED_BUILTINS]
bad-functions=print Notice that it's only You could also use [tool.pylint.MASTER]
load-plugins= "pylint.extensions.bad_builtin"
[tool.pylint.DEPRECATED_BUILTINS]
bad-functions= ["print"] Here you shouldn't need to specify the |
Not argument from me against using toml. Just that "setup.cfg" support is a bit patchy and confusing (using I just assumed that only sections marked with |
There is also an other slightly nasty side effect from this. If you have setup.cfg with sections for other tools that use same option names those will be taken in by pylint. For example the following setup.cfg
has the effect of setting pylint's exclude to E722,W503, hence there is a lot of possibilities to have hard to find configuration problems when using setup.cfg. |
I almost always use a |
True, there are workarounds / arguably better options, just commenting that the current support for setup.cfg is slightly confusing. Apart from not ignoring sections not marked with pylint, using lowercase for all the pylint.sections actually works as expected (due to how the section title normalization is implemented in |
Thank you for the issue @mteiste, evidentely setup.cfg is not super well supported. I did not modify a lot of configuration code, but I think we'd get some benefit of having a single standardized point of entry like flake8 (ask for pyproject.toml or setup.cfg support here, see how fast assotile closes the issue 😄 ). @AWhetter convinced me that actually merging #3769 would be shooting ourselves in the foot. Maybe we need to consider a breaking change in 3.0.0 where we only support |
Closes pylint-dev#4272. The problem was fixed during the migration from optparse to argparse.
load_plugins option does not work if defined in [pylint.MASTER] section of setup.cfg
Steps to reproduce
Given a config file
setup.cfg
and a python file
a.py
Current behavior
Result of `pylint --rcfile=setup.cfg a.py
Expected behavior
pylint --version output
Result of
pylint --version
output:The text was updated successfully, but these errors were encountered: