Skip to content

Commit

Permalink
Add new keyword arg aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse committed Apr 22, 2023
1 parent 4f68ba9 commit 4925cca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/ruff/src/docstrings/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ pub enum SectionKind {
Methods,
Note,
Notes,
OtherArgs,
OtherArguments,
OtherParams,
OtherParameters,
Parameters,
Raises,
Expand Down Expand Up @@ -59,6 +62,9 @@ impl SectionKind {
"methods" => Some(Self::Methods),
"note" => Some(Self::Note),
"notes" => Some(Self::Notes),
"other args" => Some(Self::OtherArgs),
"other arguments" => Some(Self::OtherArguments),
"other params" => Some(Self::OtherParams),
"other parameters" => Some(Self::OtherParameters),
"parameters" => Some(Self::Parameters),
"raises" => Some(Self::Raises),
Expand Down Expand Up @@ -97,6 +103,9 @@ impl SectionKind {
Self::Methods => "Methods",
Self::Note => "Note",
Self::Notes => "Notes",
Self::OtherArgs => "Other Args",
Self::OtherArguments => "Other Arguments",
Self::OtherParams => "Other Params",
Self::OtherParameters => "Other Parameters",
Self::Parameters => "Parameters",
Self::Raises => "Raises",
Expand Down
4 changes: 4 additions & 0 deletions crates/ruff/src/rules/pydocstyle/rules/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,10 @@ fn parse_google_sections(checker: &mut Checker, lines: &[&str], docstring: &Docs
section_context.kind,
SectionKind::Args
| SectionKind::Arguments
| SectionKind::OtherArgs
| SectionKind::OtherArguments
| SectionKind::OtherParams
| SectionKind::OtherParameters
| SectionKind::KeywordArgs
| SectionKind::KeywordArguments
) {
Expand Down

0 comments on commit 4925cca

Please sign in to comment.