Ashwin Nanjappa Ashwin Nanjappa - 3 years ago 176
Python Question

How to specify pylintrc config values, one on each line?

I am using a

.pylintrc
in my project root directory to control the PyLint messages I get when I run it on my project.

There are many options in pylintrc that take a comma separated list of values. For example:

[MASTER]

disable=relative-import,invalid-name,missing-docstring


In my actual pylintrc, this list of values can be quite long. Is there a way to specify such values, one on each line?

This did not work:

disable=relative-import,\
invalid-name,\
missing-docstring


This did not work either:

disable=relative-import
disable+=invalid-name
disable+=missing-docstring

Answer Source

To specify a disable across several lines, use the following:

disable=relative-import,
    invalid-name,
    missing-docstring

That is:

  • no continuation character \; and
  • indent the subsequent lines.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download