Skip to content

Commit

Permalink
whitespace-before-parameters comment (#6103)
Browse files Browse the repository at this point in the history
  • Loading branch information
arembridge authored Jul 26, 2023
1 parent c0dbcb3 commit 132f07c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ use ruff_python_parser::token_kind::TokenKind;
use crate::checkers::logical_lines::LogicalLinesContext;
use crate::rules::pycodestyle::rules::logical_lines::LogicalLine;

/// ## What it does
/// Checks for extraneous whitespace immediately after an open parenthesis
/// or bracket.
///
/// ## Why is this bad?
/// According to [PEP 8], open parentheses and brackets should not be followed
/// by any trailing whitespace.
///
/// ## Example
/// ```python
/// spam (1)
/// ```
///
/// Use instead:
/// ```python
/// spam(1)
/// ```
///
/// [PEP 8]: https://peps.python.org/pep-0008/#pet-peeves
#[violation]
pub struct WhitespaceBeforeParameters {
bracket: TokenKind,
Expand Down
1 change: 1 addition & 0 deletions scripts/check_docs_formatted.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"useless-semicolon",
"whitespace-after-open-bracket",
"whitespace-before-close-bracket",
"whitespace-before-parameters",
"whitespace-before-punctuation",
]

Expand Down

0 comments on commit 132f07c

Please sign in to comment.