-
Notifications
You must be signed in to change notification settings - Fork 46
docs: move D100-D300 to per-file-ignores, forbid rest-docstrings. #1008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,10 +54,6 @@ ignore = [ | |
| "B006", | ||
| "S101", # bandit: use of assert https://docs.astral.sh/ruff/rules/assert/ | ||
| # TODO: Maybe enable these | ||
| "D100", | ||
| "D101", | ||
| "D102", | ||
| "D103", | ||
| "D104", | ||
| "D105", | ||
| "D107", | ||
|
|
@@ -73,6 +69,43 @@ required-imports = ["from __future__ import annotations"] | |
| # import-mode=importlib, packages with common names (e.g. tests/jobs) collide | ||
| # in sys.modules when several diracx-* packages are collected in one run | ||
| "diracx-*/tests/*" = ["S", "INP"] | ||
| "diracx-api/src/diracx/api/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-api/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-db/src/diracx/db/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-db/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-cli/src/diracx/cli/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-cli/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-core/src/diracx/core/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-core/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-logic/src/diracx/logic/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-logic/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-tasks/src/diracx/tasks/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-tasks/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-testing/src/diracx/testing/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-client/src/diracx/client/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-client/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-routers/src/diracx/routers/**/*py" = ["D100", "D101", "D102", "D103"] | ||
| "diracx-routers/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-api/src/gubbins/api/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-api/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-cli/src/gubbins/cli/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-cli/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-client/src/gubbins/client/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-client/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-core/src/gubbins/core/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-core/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-db/src/gubbins/db/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-db/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-logic/src/gubbins/logic/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-logic/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-routers/src/gubbins/routers/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-routers/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-tasks/src/gubbins/tasks/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-tasks/tests/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "extensions/gubbins/gubbins-testing/src/gubbins/testing/**/*.py" = ["D100", "D101", "D102", "D103"] | ||
|
Comment on lines
+89
to
+105
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not fully sure this is going to work, I think these need to go in [tool.ruff.lint.pydocstyle]
convention = "google"[tool.ruff.lint]
select = [
...
"D", # pydocstyle
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does work. The way I noticed a problem with gubbins was that there is a non google comment there. To silence it I added the lines above and the error is gone. |
||
| "tests/*.py" = ["D100", "D101", "D102", "D103"] | ||
| "scripts/*.py" = ["D100", "D101", "D102", "D103"] | ||
|
|
||
|
|
||
| [tool.ruff.lint.extend-per-file-ignores] | ||
| "diracx-routers/src/diracx/routers/access_policies.py" = ["I002"] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suggestion does not work:
`pixi run -e pre-commit pre-commit run --all-files forbid-rest-docstrings
✨ Pixi task (pre-commit in pre-commit): pre-commit run --all-files forbid-rest-docstrings
forbid reST docstring tags (use Google style, see........................Failed
diracx-client/src/diracx/client/patches/client/aio.py:93: :param request: The pipeline request object to be modified.
diracx-client/src/diracx/client/patches/client/aio.py:94: :type request: ~azure.core.pipeline.PipelineRequest
diracx-client/src/diracx/client/patches/client/aio.py:95: :raises: :class:
~azure.core.exceptions.ServiceRequestErrordiracx-client/src/diracx/client/patches/client/sync.py:73: :param request: The pipeline request object to be modified.
diracx-client/src/diracx/client/patches/client/sync.py:74: :type request: ~azure.core.pipeline.PipelineRequest
diracx-client/src/diracx/client/patches/client/sync.py:75: :raises: :class:`~azure.core.exceptions.ServiceRequestError``