-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
bugSomething isn't workingSomething isn't workingsuppressionRelated to supression of violations e.g. noqaRelated to supression of violations e.g. noqa
Description
With the new ruff release ruff==0.0.292 all unneeded noqa: E501 comments are detected! Yay!
But this seems to also be valid (or at least have been working until now), having the noqa: E501 in the middle of the comment and then have more comment text after it.
# line length 99
averylongvariablenamethatyouprobablyshouldneveruse = 'avalue' # noqa: E501 # ruff will try to autofix/remove cause by the end of the pragma the line is <99 but with this extra comment we made it go over, so once autofixed there is a line length violationIf you run ruff --fix on this it will autofix the noqa: E501 away thinking it's not needed since by the end of noqa: E501 line length is less than the limit. Ignoring the fact that the comment continues.
So we will end up with this:
# line length 99
averylongvariablenamethatyouprobablyshouldneveruse = 'avalue' # ruff will try to autofix/remove cause by the end of the pragma the line is <99 but with this extra comment we made it go over, so once autofixed there is a line length violation
Which will then hit again with a line length violation and need manual fix/action.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsuppressionRelated to supression of violations e.g. noqaRelated to supression of violations e.g. noqa