Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def correct_order():
x : int
Description.

Attributes
----------
attr : int

Methods
-------
method

Returns
-------
int
Expand Down Expand Up @@ -57,14 +65,6 @@ def correct_order():
Examples
--------
>>> correct_order()

Attributes
----------
attr : int

Methods
-------
method
"""


Expand Down
8 changes: 4 additions & 4 deletions crates/ruff_linter/src/rules/pydocstyle/rules/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,8 @@ enum NumpySectionOrder {
ShortSummary,
ExtendedSummary,
Parameters,
Attributes,
Methods,
Returns,
Yields,
Receives,
Expand All @@ -2188,15 +2190,15 @@ enum NumpySectionOrder {
Notes,
References,
Examples,
Attributes,
Methods,
}

fn numpy_section_order(kind: SectionKind) -> Option<NumpySectionOrder> {
match kind {
SectionKind::ShortSummary => Some(NumpySectionOrder::ShortSummary),
SectionKind::ExtendedSummary => Some(NumpySectionOrder::ExtendedSummary),
SectionKind::Parameters => Some(NumpySectionOrder::Parameters),
SectionKind::Attributes => Some(NumpySectionOrder::Attributes),
SectionKind::Methods => Some(NumpySectionOrder::Methods),
SectionKind::Returns => Some(NumpySectionOrder::Returns),
SectionKind::Yields => Some(NumpySectionOrder::Yields),
SectionKind::Receives => Some(NumpySectionOrder::Receives),
Expand All @@ -2210,8 +2212,6 @@ fn numpy_section_order(kind: SectionKind) -> Option<NumpySectionOrder> {
SectionKind::Notes => Some(NumpySectionOrder::Notes),
SectionKind::References => Some(NumpySectionOrder::References),
SectionKind::Examples => Some(NumpySectionOrder::Examples),
SectionKind::Attributes => Some(NumpySectionOrder::Attributes),
SectionKind::Methods => Some(NumpySectionOrder::Methods),
_ => None,
}
}
Expand Down
Loading