Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 529
Alex Tereshenkov Avatar asked Dec 08 '22 16:12

Alex Tereshenkov


1 Answers

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......
like image 97
Nils Werner Avatar answered Jan 01 '23 17:01

Nils Werner