Add doc for E999 (#6699)

This commit is contained in:
Harutaka Kawamura 2023-08-20 23:14:22 +09:00 committed by GitHub
parent 7e9023b6f8
commit c62e544cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -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,

View file

@ -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",