Enable Ruff D (pydocstyle) with pep257 convention (#13326)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Avasam
2025-01-02 17:05:35 -05:00
committed by GitHub
parent a151457936
commit 9c959a7dd3
12 changed files with 34 additions and 22 deletions

View File

@@ -39,6 +39,7 @@ external = ["F821", "NQA", "Y"]
select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"D", # pydocstyle
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"I", # isort
@@ -108,11 +109,15 @@ ignore = [
###
# Rules we don't want or don't agree with
###
# Slower and more verbose https://github.com/astral-sh/ruff/issues/7871
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
# We're not a library, no need to document everything
"D1", # Missing docstring in ...
# Doesn't support split "summary line"
"D205", # 1 blank line required between summary line and description
# Used for direct, non-subclass type comparison, for example: `type(val) is str`
# see https://github.com/astral-sh/ruff/issues/6465
"E721", # Do not compare types, use `isinstance()`
# Slower and more verbose https://github.com/astral-sh/ruff/issues/7871
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`
###
# False-positives, but already checked by type-checkers
###
@@ -139,11 +144,16 @@ ignore = [
"RUF022",
"RUF023",
]
# See comment on black's force-exclude config above
"*_pb2.pyi" = [
# Leave the docstrings as-is, matching source
"D", # pydocstyle
# See comment on black's force-exclude config above
"E501", # Line too long
]
[tool.ruff.lint.pydocstyle]
convention = "pep257" # https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention
[tool.ruff.lint.isort]
split-on-trailing-comma = false
combine-as-imports = true