Closed
Conversation
# noqa rule codes
dhruvmanila
approved these changes
Aug 12, 2024
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
It's not "breaking", but I'd suggest we ship it in a minor.
Seems reasonable to me.
I think it might be useful for #12831 to be fixed as well.
MichaReiser
approved these changes
Aug 12, 2024
Member
|
There's now a |
Member
|
@charliermarsh do you plan on merging this for the 0.6 release? |
Member
Author
|
@MichaReiser - No, I should address Dhruv’s concern first but don’t have time immediately. |
5894aa0 to
c2e9746
Compare
dylwil3
added a commit
that referenced
this pull request
Feb 16, 2025
On `main` we warn the user if there is an invalid noqa comment[^1] and at least one of the following holds: - There is at least one diagnostic - A lint rule related to `noqa`s is enabled (e.g. `RUF100`) This is probably strange behavior from the point of view of the user, so we now show invalid `noqa`s even when there are no diagnostics. Closes #12831 [^1]: For the current definition of "invalid noqa comment", which may be expanded in #12811 . This PR is independent of loc. cit. in the sense that the CLI warnings should be consistent, regardless of which `noqa` comments are considered invalid.
Member
|
Closing in favor of #16483 |
dylwil3
added a commit
that referenced
this pull request
Mar 11, 2025
# Summary The goal of this PR is to address various issues around parsing suppression comments by 1. Unifying the logic used to parse in-line (`# noqa`) and file-level (`# ruff: noqa`) noqa comments 2. Recovering from certain errors and surfacing warnings in these cases Closes #15682 Supersedes #12811 Addresses #14229 (comment) Related: #14229 , #12809
MichaReiser
pushed a commit
that referenced
this pull request
Mar 13, 2025
# Summary The goal of this PR is to address various issues around parsing suppression comments by 1. Unifying the logic used to parse in-line (`# noqa`) and file-level (`# ruff: noqa`) noqa comments 2. Recovering from certain errors and surfacing warnings in these cases Closes #15682 Supersedes #12811 Addresses #14229 (comment) Related: #14229 , #12809
MichaReiser
pushed a commit
that referenced
this pull request
Mar 13, 2025
# Summary The goal of this PR is to address various issues around parsing suppression comments by 1. Unifying the logic used to parse in-line (`# noqa`) and file-level (`# ruff: noqa`) noqa comments 2. Recovering from certain errors and surfacing warnings in these cases Closes #15682 Supersedes #12811 Addresses #14229 (comment) Related: #14229 , #12809
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Today, we already warn if you do
# ruff: noqa: F401F841... But not inline (e.g.,import os # noqa: F401F841).This PR extends the warnings to the latter case.
It's not "breaking", but I'd suggest we ship it in a minor.
Fixes #15682