Skip to content

docs: move D100-D300 to per-file-ignores, forbid rest-docstrings. - #1008

Draft
martynia wants to merge 2 commits into
DIRACGrid:mainfrom
martynia:janusz_rest2_googledocs_1004
Draft

docs: move D100-D300 to per-file-ignores, forbid rest-docstrings. #1008
martynia wants to merge 2 commits into
DIRACGrid:mainfrom
martynia:janusz_rest2_googledocs_1004

Conversation

@martynia

@martynia martynia commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

A minimal, "bootstrap" PR to address #1004

@read-the-docs-community

read-the-docs-community Bot commented Aug 7, 2026

Copy link
Copy Markdown

Documentation build overview

📚 diracx | 🛠️ Build #33957518 | 📁 Comparing d0be4e5 against latest (503d3d2)

  🔍 Preview build  

3 files changed
± admin/reference/env-variables/index.html
- admin/explanations/pilots/index.html
- dev/explanations/pilots/index.html

@martynia
martynia requested a review from aldbr August 7, 2026 09:52
Comment thread .pre-commit-config.yaml
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)/"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about?

Suggested change
exclude: "^(diracx-client/src/diracx/client|extensions/gubbins/gubbins-client/src/gubbins/client)/"
exclude: '/_generated/'

Copy link
Copy Markdown
Contributor Author

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

  • 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``

Comment thread pyproject.toml
Comment on lines +89 to +105
"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"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 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",   # pydocstyle

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

@DIRACGridBot
DIRACGridBot marked this pull request as draft August 18, 2026 08:00
@aldbr

aldbr commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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 [tool.ruff.lint.per-file-ignores] just to make sure it works well before approving this one.
Can you try that please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants