Skip to content

Commit 5f79925

Browse files
Add docformatter pre-commit hook + fix failing docstrings
1 parent d56b043 commit 5f79925

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ repos:
2525
args: [--fix]
2626
- id: ruff-format
2727

28+
# python docstring formatting
29+
- repo: https://github.com/PyCQA/docformatter
30+
rev: v1.7.8
31+
hooks:
32+
- id: docformatter
33+
args: [--in-place]
34+
2835
# jupyter notebook cell output clearing
2936
- repo: https://github.com/kynan/nbstripout
3037
rev: 0.9.1

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ line-length = 120
33

44
[tool.ruff.lint.pydocstyle]
55
convention = "google"
6+
7+
[tool.docformatter]
8+
recursive = true
9+
wrap-summaries=120
10+
wrap-descriptions=120

src/data/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
class NormalizeSample(torch.nn.Module):
7-
"""Normalize a tensor image w.r.t. to its mean and standard deviation.
7+
"""Normalize a tensor image with respect to its mean and standard deviation.
88
99
Args:
1010
inplace: Whether to make this operation in-place.

0 commit comments

Comments
 (0)