Skip to content

Commit e5458fa

Browse files
committed
py: add Ruff docstring rules (Google style); transitional ignores (#16432, refs #11442)
1 parent ef9b910 commit e5458fa

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

py/pyproject.toml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,33 @@ respect-gitignore = true
144144
target-version = "py39"
145145

146146
[tool.ruff.lint]
147-
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"]
147+
extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252", "D"]
148148
fixable = ["ALL"]
149+
extend-ignore = [
150+
"D103", # Missing docstring in public function
151+
"D102", # Missing docstring in public method
152+
"D100", # Missing docstring in public module
153+
"D205", # 1 blank line required between summary line and description
154+
"D107", # Missing docstring in `__init__`
155+
"D101", # Missing docstring in public class
156+
"D104", # Missing docstring in public package
157+
"D209", # Multi-line docstring closing quotes should be on a separate line
158+
"D202", # No blank lines allowed after function docstring (found 1)
159+
"D105", # Missing docstring in magic method
160+
"D415", # First line should end with a period, question mark, or exclamation point
161+
"D212", # Multi-line docstring summary should start at the first line
162+
"D200", # One-line docstring should fit on one line
163+
"D411", # Missing blank line before section ("Example")
164+
"D301", # Use `r\"\"\"` if any backslashes in a docstring
165+
"D412", # No blank lines allowed between a section header and its content ("Example")
166+
"D410", # Missing blank line after section ("Example")
167+
"D419", # Docstring is empty
168+
"D417", # Missing argument descriptions in the docstring for `__init__`
169+
"D416", # Section name should end with a colon ("Returns")
170+
]
171+
172+
[tool.ruff.lint.pydocstyle]
173+
convention = "google"
149174

150175
[tool.ruff.format]
151176
docstring-code-format = true

0 commit comments

Comments
 (0)