Skip to content

Commit

Permalink
Add a note regarding ignore-without-code
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 7, 2024
1 parent daae28e commit 0fa9e9c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ use ruff_text_size::TextSize;
/// maintain, as the annotation does not clarify which warnings are intended
/// to be suppressed.
///
/// Note: Mypy supports a [built-in setting](https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-type-ignore-include-an-error-code-ignore-without-code)
/// to enforce that all `type: ignore` annotations include an error code, akin
/// to enabling this rule.
///
/// ## Example
/// ```python
/// from foo import secrets # type: ignore
Expand All @@ -31,7 +35,7 @@ use ruff_text_size::TextSize;
/// ```
///
/// ## References
/// - [mypy](https://mypy.readthedocs.io/en/stable/common_issues.html#spurious-errors-and-locally-silencing-the-checker)
/// - [mypy: Silencing the checker](https://mypy.readthedocs.io/en/stable/common_issues.html#spurious-errors-and-locally-silencing-the-checker)
#[violation]
pub struct BlanketTypeIgnore;

Expand Down

0 comments on commit 0fa9e9c

Please sign in to comment.