2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 11:35:41 +00:00

fix(backend): enforce docstring args (#9428)

* enforce docstring args

* add more rules that we could add later

* fix missing yields

* add a type

* make 3.9 compat
This commit is contained in:
Matthias Mair
2025-04-04 00:02:55 +02:00
committed by GitHub
parent b48ceb00f2
commit a2370dbe59
21 changed files with 98 additions and 47 deletions

View File

@ -18,11 +18,16 @@ src = ["src/backend/InvenTree"]
"__init__.py" = ["D104"]
[tool.ruff.lint]
select = ["A", "B", "C", "C4", "D", "F", "I", "N", "SIM", "PIE", "PLE", "PLW", "RUF", "UP", "W"]
select = ["A", "B", "C", "C4", "D", "F", "I", "N", "SIM", "PIE", "PLE", "PLW", "RUF", "UP", "W",
#"DOC201", "DOC202", # enforce return docs
"DOC402","DOC403", # enforce yield docs
#"DOC501","DOC502", # enforce raise
]
# Things that should be enabled in the future:
# - LOG
# - DJ # for Django stuff
# - S # for security stuff (bandit)
# - D401 - Imperative docstrings
ignore = [
"PLE1205",
@ -51,8 +56,6 @@ ignore = [
"N806",
# - N812 - lowercase imported as non-lowercase
"N812",
# - D417 Missing argument descriptions in the docstring
"D417",
# - RUF032 - decimal-from-float-literal
"RUF032",
"RUF045",
@ -69,6 +72,7 @@ ignore = [
[tool.ruff.lint.pydocstyle]
convention = "google"
ignore-var-parameters = true
[tool.ruff.lint.isort]
split-on-trailing-comma = false