Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruff compliance for D405 and D407 #5666

Merged
merged 24 commits into from
Jan 2, 2024
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
4 changes: 1 addition & 3 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ lint.ignore = [
"D102", # Missing docstring in public method
"D104", # Missing docstring in public package
"D106", # Missing docstring in public nested class
# (D-3) Temporary, before an initial review, either fix ocurrenvces or move to (2).
# (D-3) Temporary, before an initial review, either fix ocurrences or move to (2).
"D100", # Missing docstring in public module
"D103", # Missing docstring in public function
"D200", # One-line docstring should fit on one line
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D401", # First line of docstring should be in imperative mood: ...
"D404", # First word of the docstring should not be "This"
"D405", # Section name should be properly capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section

# pyupgrade (UP)
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
Expand Down
18 changes: 10 additions & 8 deletions docs/src/developers_guide/documenting/docstrings_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ def __init__(self, arg1, arg2):

Description section text.

Args:

* arg1 (int):
Parameters
----------
arg1 : int
First argument description.
* arg2 (float):
arg2 : float
Second argument description.

Returns:
Boolean.
Returns
-------
bool

"""
self.a = arg1
Expand All @@ -26,8 +27,9 @@ def __init__(self, arg1, arg2):
def square(self):
"""*(read-only)* Purpose section description.

Returns:
int.
Returns
-------
int

"""
return self.a * self.a
19 changes: 9 additions & 10 deletions docs/src/developers_guide/documenting/docstrings_sample_routine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ def sample_routine(arg1, arg2, kwarg1="foo", kwarg2=None):

Description section longer text goes here.

Args:

* arg1 (numpy.ndarray):
Parameters
----------
arg1 : numpy.ndarray
First argument description.
* arg2 (numpy.ndarray):
arg2 : numpy.ndarray
Second argument description.

Kwargs:

* kwarg1 (string):
kwarg1: str, optional
The first keyword argument. This argument description
can be multi-lined.
* kwarg2 (Boolean or None):
kwarg2 : bool, optional
The second keyword argument.

Returns:
Returns
-------
numpy.ndarray
numpy.ndarray of arg1 * arg2

"""
Expand Down
Loading