Skip to content

Commit

Permalink
ruff compliance for D405 and D407 (#5666)
Browse files Browse the repository at this point in the history
* ruff compliance D405.

* ruff complliance with D407.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix typos

* remove comment

* minor tweaks

* undo changes

* fix typo in comment

* remove comments

* string update

* review comments (None use)

* Update lib/iris/analysis/stats.py

Co-authored-by: Patrick Peglar <[email protected]>

* reivew fix.

* Update lib/iris/analysis/stats.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/analysis/stats.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/analysis/cartography.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/analysis/stats.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/_concatenate.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/_concatenate.py

Co-authored-by: Patrick Peglar <[email protected]>

* Update lib/iris/_concatenate.py

Co-authored-by: Patrick Peglar <[email protected]>

* review actions

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Patrick Peglar <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2024
1 parent 41f1107 commit e2e9454
Show file tree
Hide file tree
Showing 47 changed files with 3,290 additions and 3,228 deletions.
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

0 comments on commit e2e9454

Please sign in to comment.