Files
tinypilot-kvm/.ruff.toml
Michael Lynch 260d524ab8 Use ruff to enforce Python docstring conventions (#1633)
We've been enforcing Python docstring conventions purely through code
review, but ruff can enforce some of the conventions automatically.

I've adjusted some of our docstrings to match ruff's expectations.

<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1633"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>
2023-09-25 12:21:54 -04:00

47 lines
1.1 KiB
TOML

src = ["app"]
select = [
"D", # Enable pydocstyle rules.
"F", # Enable pyflakes rules.
"I", # Enable isort rules.
"Q", # Enable flake8-quotes rules.
]
ignore = [
# Disable rules that require everything to have a docstring.
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in __init__
# We sometimes do our own indenting that contradicts pydocstyle expectations.
"D214", # Section is over-indented
]
exclude = [
".git",
"third_party",
"venv",
]
# Assume Python 3.9
target-version = "py39"
[flake8-quotes]
# Use consistent quotes regardless of whether it allows us to minimize escape
# sequences.
avoid-escape = false
docstring-quotes = "double"
inline-quotes = "single"
multiline-quotes = "double"
[isort]
force-single-line = true
force-to-top = ["log"]
[pydocstyle]
convention = "google"