Skip to content

Commit

Permalink
Document RUF100 (#4141)
Browse files Browse the repository at this point in the history
  • Loading branch information
calumy authored Apr 28, 2023
1 parent 432ea6f commit 12d64a2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions crates/ruff/src/rules/ruff/rules/unused_noqa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ pub struct UnusedCodes {
pub unmatched: Vec<String>,
}

/// ## What it does
/// Checks for `noqa` directives that are no longer applicable.
///
/// ## Why is this bad?
/// A `noqa` directive that no longer matches any diagnostic violations is
/// likely included by mistake, and should be removed to avoid confusion.
///
/// ## Example
/// ```python
/// import foo # noqa: F401
///
/// def bar():
/// foo.bar()
/// ```
///
/// Use instead:
/// ```python
/// import foo
///
/// def bar():
/// foo.bar()
/// ```
///
/// ## References
/// - [Automatic `noqa` management](https://beta.ruff.rs/docs/configuration/#automatic-noqa-management)
#[violation]
pub struct UnusedNOQA {
pub codes: Option<UnusedCodes>,
Expand Down

0 comments on commit 12d64a2

Please sign in to comment.