8

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.

Alex Tereshenkov
  • 3,340
  • 8
  • 36
  • 61

1 Answers1

21

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......
Nils Werner
  • 34,832
  • 7
  • 76
  • 98