Settings for pylint in setup.cfg are not getting used

Viewed 5715

In order to consolidate the tooling config for python projects, I'm aiming at putting everything in setup.cfg. (As that's the only thing supported by pytype as well as flake8 not aiming to support pyproject.toml any time soon.)

According to pylint's documentation, this should be working:

setup.cfg in the current working directory, providing it has at least one pylint. section

There is neither a pylintrc nor a .pylintrc in the current directory and pyproject.toml doesn't contain any tool.pylint. section.

However, the following settings in setup.cfg don't get used:

[pylint.MASTER]
load-plugins=pylint_django

[pylint.FORMAT]
max-line-length = 123

[pylint.'MESSAGES CONTROL']
disable = missing-docstring,invalid-name

This is what pylint says:

% pylint --generate-rcfile | grep 'max-line-length'
max-line-length=100

What might be missing here?

2 Answers

OK, this is indeed working. But it helps to avoid conflicting settings further down in setup.cfg, like this:

[pycodestyle]
max-line-length = 100

Here, this setting overrides the max-line-length in the [pylint.FORMAT] section.

Related