Question

So im looking at some code and bringing it up to PEP 8 standard with the help of pylint and i noticed that if i was using triple quotes for a print statement where the text went past 120 chars (we are allowing 120 instead of 79) pylint didn't complain.
Is this a bug in pylint or does it think it might be a comment and is more lenient with the length of lines or does it not care about how far over you go with strings in trippple quotes because you may want to format them that way?

For clarity: yes pylint works normally in every other case of going over the line length.

Était-ce utile?

La solution

Having used pylint regularly, I have also noticed this inconsistency. In the Maximum Line Length section of PEP8, it says:

Therefore, please limit all lines to a maximum of 79 characters. For flowing long blocks of text (docstrings or comments), limiting the length to 72 characters is recommended.

I know that pylint does not at all enforce the 79 character or the 72 character line length limits for docstrings and comments, so I would guess that this is a pylint bug since it is non-compliant with PEP8 in this area.

Autres conseils

As pylint maintainer, I can tell this is definitly a bug.

@Jacxel : if you've trouble registering on logilab.org, you can still post the pb on the python-projects@logilab.org mailing list

thanks

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top