diff --git a/crates/ruff/src/rules/pycodestyle/rules/errors.rs b/crates/ruff/src/rules/pycodestyle/rules/errors.rs index 213de95dfc..c1b79b9b54 100644 --- a/crates/ruff/src/rules/pycodestyle/rules/errors.rs +++ b/crates/ruff/src/rules/pycodestyle/rules/errors.rs @@ -21,6 +21,25 @@ impl Violation for IOError { } } +/// ## What it does +/// Checks for code that contains syntax errors. +/// +/// ## Why is this bad? +/// Code with syntax errors cannot be executed. Such errors are likely a +/// mistake. +/// +/// ## Example +/// ```python +/// x = +/// ``` +/// +/// Use instead: +/// ```python +/// x = 1 +/// ``` +/// +/// ## References +/// - [Python documentation: Syntax Errors](https://docs.python.org/3/tutorial/errors.html#syntax-errors) #[violation] pub struct SyntaxError { pub message: String, diff --git a/scripts/check_docs_formatted.py b/scripts/check_docs_formatted.py index a60c992de6..4ad6dc40dd 100755 --- a/scripts/check_docs_formatted.py +++ b/scripts/check_docs_formatted.py @@ -83,6 +83,7 @@ KNOWN_PARSE_ERRORS = [ "mixed-spaces-and-tabs", "no-indented-block", "non-pep695-type-alias", # requires Python 3.12 + "syntax-error", "tab-after-comma", "tab-after-keyword", "tab-after-operator",