Running pylint on a file containing variables such as x or l will raise an error, though these variables might be meaningful in the context that they're in.
I could disable all such errors by adding the following to pyproject.toml:
[tool.pylint."MESSAGES CONTROL"] disable = [ "invalid-name"] But I would prefer to be able to instead explicitly state the variables that I would like to ignore.
22 Answers
While searching for the same issue, I found , which explains that square braces cannot be used. Rather, a comma separated list of values, wrapped in quotes will work:
[tool.pylint.'MESSAGES CONTROL'] max-line-length = 120 disable = "too-many-arguments,not-callable" Or, triple-quotes can be used for readability with many disable statements:
[tool.pylint.'MESSAGES CONTROL'] max-line-length = 120 disable = """ too-many-arguments, not-callable """ 3To ignore pylint errors for particular variable names the good-names list can be set within pyproject.toml as follows:
[tool.pylint."MESSAGES CONTROL"] good-names = [ "x", "y", ] Which will make x and y valid variable names for pylint.