-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Useful 'line-too-long' suppression considered useless #7911
Comments
|
Reproduce with limited case (so it's not about an interaction with other code)
Interesting enough, I started to decrease
Initial hunch is pylint is maybe ignoring |
Apologies for the mistaken command-line flag (now fixed); thanks to @clavedeluna for pointing that out. |
That was my suspicion as well. Agreed that changing the option is more illustrative than adding the fourth case to exercise that behaviour. |
I won't re-arrange things now to avoid confusion, but in future I'll take @clavedeluna's implied suggestion to include a minimal reproduction case as one script, and include other supporting/illustrative cases in a separate script. |
I think is is likely a special-case of #4802 and it seems like maintainers have decided not to fix it, but I"ll let them close this issue if that's the case since I wasn't part of that dicussion. Or we can at least add functional tests to indicate this if they're not there |
[Edit: This was phrased very poorly; please read this in the context of my clarification and apology two comments down.] I can't accept that this is appropriate behaviour for pylint. Either the line warrants an error (in which case suppressing that error should not generate |
@finite-state-machine you're welcome to fix the issue if you feel this is unacceptable. We have limited resources and 600+ issues. Maintainer's consensus is that the work involved is not worth the fix at the moment so no maintainer is going to work on it. But we'll review pull requests if there's any. |
@Pierre-Sassoulas Please forgive my tone; I didn't mean that remark to come across as a criticism of the developers and maintainers, who have provided a wonderful tool and do excellent work. I truly appreciate all you've done and all you do. It's entirely fair to say "we don't have the resources; but there's the code if you want to fix it". [Edit: It's more than fair, really, especially as you've graciously offered to entertain a pull request.] What I meant to express – but phrased very poorly – was that the tool's behaviour isn't desirable in this case, i.e., that there is a functional bug, rather than a documentation bug. I didn't mean it to come across as a demand for action, although I can see that's how it reads. I apologize unreservedly. |
I think it might indeed be difficult to solve this while not also changing the status quo as discussed in #4802. I'm not against fixing this but I'm against changing the status quo there.. |
Bug description
Consider:
Analyzing the above with
--max-line-length=79
and--enable=line-too-long,useless-suppression
, we get two errors, the first expected, and the second a surprise:As can be seen above, the
second_case()
function still triggers auseless-suppression
warning, which shouldn't be issued: it's useful, as shown byfirst_case()
.The
fourth_case()
shows that the issue is (probably) only triggered when it's a comment that makes the line too long.This is related to #3368, but I've been asked to file this as a separate issue.
Configuration
No response
Command used
Pylint output
Expected behavior
The
useless-suppression
message should not be issued.Pylint version
OS / Environment
macOS 10.14
homebrew 3.5.10
pyenv 2.3.2
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: