Skip to content

Commit

Permalink
Add Param variants to Numpy-style rather than Google style
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse committed Apr 22, 2023
1 parent c62222a commit 72b73ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions crates/ruff/src/docstrings/google.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ pub(crate) static GOOGLE_SECTIONS: &[SectionKind] = &[
SectionKind::Notes,
SectionKind::OtherArgs,
SectionKind::OtherArguments,
SectionKind::OtherParams,
SectionKind::OtherParameters,
SectionKind::Return,
SectionKind::Tip,
SectionKind::Todo,
Expand Down
1 change: 1 addition & 0 deletions crates/ruff/src/docstrings/numpy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(crate) static NUMPY_SECTIONS: &[SectionKind] = &[
SectionKind::Yields,
// NumPy-only
SectionKind::ExtendedSummary,
SectionKind::OtherParams,
SectionKind::OtherParameters,
SectionKind::Parameters,
SectionKind::ShortSummary,
Expand Down
7 changes: 3 additions & 4 deletions crates/ruff/src/rules/pydocstyle/rules/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ pub fn sections(checker: &mut Checker, docstring: &Docstring, convention: Option
if numpy_sections.iter().any(|context| {
matches!(
context.kind,
SectionKind::Parameters | SectionKind::OtherParameters
SectionKind::Parameters
| SectionKind::OtherParams
| SectionKind::OtherParameters
)
}) {
for context in &numpy_sections {
Expand Down Expand Up @@ -1068,9 +1070,6 @@ fn parse_google_sections(checker: &mut Checker, lines: &[&str], docstring: &Docs
| SectionKind::KeywordArguments
| SectionKind::OtherArgs
| SectionKind::OtherArguments
| SectionKind::OtherParams
| SectionKind::OtherParameters
| SectionKind::Parameters
) {
documented_args.extend(args_section(section_context));
}
Expand Down

0 comments on commit 72b73ca

Please sign in to comment.