Skip to content

Commit

Permalink
Nit
Browse files Browse the repository at this point in the history
Co-authored-by: Micha Reiser <micha@reiser.io>
  • Loading branch information
augustelalande and MichaReiser committed Sep 10, 2024
1 parent 993deb8 commit 4d47b2d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions crates/ruff_linter/src/rules/pydoclint/rules/check_docstring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,16 @@ fn parse_parameters_google(content: &str) -> Vec<&str> {
};
for potential in content.lines() {
if let Some(entry) = potential.strip_prefix(indentation) {
if let Some(first_char) = entry.chars().next() {
if !first_char.is_whitespace() {
let Some(colon_idx) = entry.find(':') else {
continue;
};
if let Some(param) = entry[..colon_idx].split_whitespace().next() {
entries.push(param.trim_start_matches('*'));
}
if entry
.chars()
.next()
.is_some_and(|first_char| !first_char.is_whitespace())
{
let Some(colon_idx) = entry.find(':') else {
continue;
};
if let Some(param) = entry[..colon_idx].split_whitespace().next() {
entries.push(param.trim_start_matches('*'));
}
}
}
Expand Down

0 comments on commit 4d47b2d

Please sign in to comment.