Alex Tereshenkov
Alex Tereshenkov

Reputation: 3620

How to break a long line in .pylintrc file?

I have a PyLint configuration file, .pylintrc, with some rules defined.

However, for one rule, I have quite a few items which results in a very long line.

[TYPECHECK]
generated-members = XXX, YYY, ZZZ......

An example of a long line can be seen here on github: https://github.com/behave/behave.example/blob/master/pylintrc#L263

Is it possible to break the line to keep listing items on the next line(s)? I've tried to move the items to the next line, however, this seems to make the file invalid.

Upvotes: 12

Views: 2127

Answers (1)

Nils Werner
Nils Werner

Reputation: 36719

pylint parses the .pylintrc file using configparser, which says in its docs:

Values can also span multiple lines, as long as they are indented deeper than the first line of the value.

This means the solution is to use

[TYPECHECK]
generated-members =
  XXX,
  YYY,
  ZZZ......

Upvotes: 25

Related Questions