docs: move D100-D300 to per-file-ignores, forbid rest-docstrings. - #1008
docs: move D100-D300 to per-file-ignores, forbid rest-docstrings. #1008martynia wants to merge 2 commits into
Conversation
| language: pygrep | ||
| entry: '^\s*:(param|type|returns?|rtype|raises?|ivar|cvar|vartype)\b' | ||
| types: [python] | ||
| exclude: "^(diracx-client/src/diracx/client|extensions/gubbins/gubbins-client/src/gubbins/client)/" |
There was a problem hiding this comment.
What about?
| exclude: "^(diracx-client/src/diracx/client|extensions/gubbins/gubbins-client/src/gubbins/client)/" | |
| exclude: '/_generated/' |
There was a problem hiding this comment.
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
- hook id: forbid-rest-docstrings
- exit code: 1
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.ServiceRequestError
diracx-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``
| "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"] |
There was a problem hiding this comment.
I am not fully sure this is going to work, I think these need to go in extensions/gubbins/pyproject.toml.
Btw, I just noticed that the following blocks should also be added there ideally:
[tool.ruff.lint.pydocstyle]
convention = "google"[tool.ruff.lint]
select = [
...
"D", # pydocstyleThere was a problem hiding this comment.
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.
|
Ideally, I would like to see at least one PR based on this one where you add the missing docstrings in a package (as you already did) and you remove the package from |
A minimal, "bootstrap" PR to address #1004