Description
Each time I want to try pylint again, I face the same issue: I go to the official documentation to search for information about the configuration file, but can't seem to find anything easily.
Obviously, I go to "User Guide -> Configuration" (https://pylint.readthedocs.io/en/latest/user_guide/options.html) but this is not at all what I expect. There's nothing about the the pylintrc file, or the available configuration options like max-line-length
. To know if pylint supported pyproject.toml, I had to read the "Running Pylint" section 😕
Then I tell myself, "the options names must be the same on the CLI and in the [tool.pylint]
section", so I write this:
[tool.pylint]
max-line-length = 120
disable = ["C0330"]
...but it doesn't seem to be taken into account. Should I replace -
with _
? Should options be in a sub-table? Where do I find this information?
Answers are: I don't know. The search feature on the documentation doesn't help. I eventually went to the FAQ: https://pylint.readthedocs.io/en/latest/faq.html#how-do-i-find-the-option-name-for-pylintrc-corresponding-to-a-specific-command-line-option. So now I know I can get the option name for --max-line-length
by generating the pylintrc file, and copy-pasting it into pyproject.toml. I see that disable
actually takes the verbose name and not the code (I have to scroll my buffer back to get the name).
But it still does not work 😕
How one should write the [tool.pylint]
section?
Am I the only one having a hard time with pylint's documentation structure?
EDIT: found the answers in the changelog: http://pylint.pycqa.org/en/latest/whatsnew/2.5.html. Section must be named [tool.pylint.'MESSAGES CONTROL']
or similar. This feature has not been released yet.