necessarily long comments are reported as errors

Bug #1252825 reported by Jean-Paul Calderone
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
twistedchecker
Confirmed
Undecided
Unassigned

Bug Description

exarkun@top:/tmp$ cat longcomment.py
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

# http://thisurlisverylongandwillneverfitinto80columnsnomatterwhat.example.com/somegreatcontent.tml

exarkun@top:/tmp$ PYTHONPATH=${PYTHONPATH}:~/Projects/twistedchecker/ ~/Projects/twistedchecker/bin/twistedchecker longcomment.py
************* Module longcomment
C0301: 4,0: Line too long (99/79)
W9402: 4,0: The first letter of comment should be capitalized
...
exarkun@top:/tmp$

Neither of these errors is appropriate. "http" is arguably more correct than "Http" and there is no good way to make this line fit within the normal bounds.

HawkOwl (hawkowl)
Changed in twistedchecker:
status: New → Confirmed
Revision history for this message
HawkOwl (hawkowl) wrote :

From discussions on IRC, I think we've come up with the two things - exarkun, please correct me if I've taken the wrong output from the convo:

1) if a comment contains no whitespace (eg. in the case of a very long link taking up the entire line), it will not produce a warning, and
2) The "The first letter of comment should be capitalized" is full of false positives, and is hard to implement reliably, so it is better to just drop it.

The former will mean disabling pylint's "C0301" warning, and implementing a custom line length checker.
The latter will require removing the relevant code from checkers/comment.py.

Revision history for this message
Jonathan Lange (jml) wrote : [Bug 1252825] Re: necessarily long comments are reported as errors

On Tue Nov 19 2013 at 11:10:55 PM, HawkOwl <email address hidden>
wrote:

> >From discussions on IRC, I think we've come up with the two things -
> exarkun, please correct me if I've taken the wrong output from the
> convo:
>
> 1) if a comment contains no whitespace (eg. in the case of a very long
> link taking up the entire line), it will not produce a warning, and
> 2) The "The first letter of comment should be capitalized" is full of
> false positives, and is hard to implement reliably, so it is better to just
> drop it.
>
> The former will mean disabling pylint's "C0301" warning, and implementing
> a custom line length checker.
> The latter will require removing the relevant code from
> checkers/comment.py.
>
>
Sounds good to me.

Perhaps the URL fix should be sent as a patch to pylint?

jml

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.