Skip to content

Fix and improve project docstrings#170

Open
Copilot wants to merge 6 commits into
v1.x.xfrom
copilot/check-fix-improve-docstrings
Open

Fix and improve project docstrings#170
Copilot wants to merge 6 commits into
v1.x.xfrom
copilot/check-fix-improve-docstrings

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Sweep of docstring violations and missing tooling configuration per Frequenz Python docstring conventions.

Config (mkdocs.yml, pyproject.toml)

  • mkdocs.yml: add relative_crossrefs: true to mkdocstrings handler options (convention rollout)
  • pyproject.toml [tool.flake8]: add four missing pydoclint keys:
    • check-class-attributes = true — DOC601/603/605/607
    • check-style-mismatch = true — DOC003 (convention rollout)
    • require-inline-class-var-docs = true — inline attribute docs (convention rollout)
    • skip-checking-short-docstrings = true — exempt trivial one-liners

Source fixes

  • math.py

    • Interval class docstring: typo limiteslimits; plain backtick start/end → relative cross-references [.start][.start]
    • Interval.__contains__: summary moved onto opening """ line; bool: type annotation removed from Returns: (type hints belong in signatures only)
  • id.py

    • Module Note: incorrectly stated a ValueError is raised for duplicate str_prefix — the code only logs a warning
    • BaseId.__eq__, __lt__: add missing Args: and Returns: sections
    • BaseId.__hash__: add missing Returns: section
  • typing.py

    • NoInitConstructibleMeta docstring example: typo metaclas=metaclass=
  • enum.py

    • DeprecatingEnumType.__new__ and class Behavior: block: upgrade plain `DeprecatedMember` backtick references to cross-references

Copilot AI requested a review from llucax June 29, 2026 13:21
@github-actions github-actions Bot added part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:typing Affects the typing module part:math Affects the math module part:id Affects the id module part:enum Affects the enum module labels Jun 29, 2026
Copilot AI and others added 4 commits June 29, 2026 15:31
Add missing pydoclint options to `[tool.flake8]` in `pyproject.toml`:
- `check-class-attributes = true`
- `check-style-mismatch = true`
- `require-inline-class-var-docs = true`
- `skip-checking-short-docstrings = true`

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Add `relative_crossrefs: true` to `mkdocs.yml` `mkdocstrings` options.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- `Interval` class: fix typo "limites" → "limits", add cross-references
  for `.start` and `.end` attributes in the class body docstring
- `Interval.__contains__`: move summary to the opening line, remove type
  hint from the `Returns:` section (DOC111 equivalent)

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
- Module docstring: correct the `Note:` admonition that incorrectly
  stated a `ValueError` would be raised for duplicate `str_prefix`
  registrations; the code only logs a warning
- `BaseId.__eq__`, `__lt__`: add missing `Args:` and `Returns:` sections
- `BaseId.__hash__`: add missing `Returns:` section

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax added the cmd:skip-release-notes It is not necessary to update release notes for this PR label Jun 29, 2026
@llucax llucax added this to the v1.2.0 milestone Jun 29, 2026
@llucax llucax force-pushed the copilot/check-fix-improve-docstrings branch from 7e3df90 to 2f0043c Compare June 29, 2026 13:37
@llucax llucax marked this pull request as ready for review June 29, 2026 13:37
@llucax llucax requested a review from a team as a code owner June 29, 2026 13:37
@llucax llucax enabled auto-merge June 29, 2026 13:37
@llucax llucax force-pushed the copilot/check-fix-improve-docstrings branch from 2f0043c to 06eab6a Compare June 29, 2026 15:04
llucax added 2 commits June 29, 2026 17:07
- `DeprecatingEnumType.__new__`: add cross-reference for
  `DeprecatedMember`
- `DeprecatingEnumType` class docstring: add cross-references for
  `DeprecatedMember` and `deprecated_member()` in the Behavior block

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Fix typo `metaclas` → `metaclass` in `NoInitConstructibleMeta`
docstring example.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax force-pushed the copilot/check-fix-improve-docstrings branch from 06eab6a to 7f9e2f5 Compare June 29, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmd:skip-release-notes It is not necessary to update release notes for this PR part:enum Affects the enum module part:id Affects the id module part:math Affects the math module part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:typing Affects the typing module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants