Skip to content

Comments

Partial pydocstyle D rule fixes#212

Merged
rwkeane merged 4 commits intoRuffAddDfrom
fix/pydocstyle-compliance-e
Jun 23, 2025
Merged

Partial pydocstyle D rule fixes#212
rwkeane merged 4 commits intoRuffAddDfrom
fix/pydocstyle-compliance-e

Conversation

@rwkeane
Copy link
Owner

@rwkeane rwkeane commented Jun 23, 2025

This commit includes fixes for a subset of pydocstyle D rule violations, primarily focusing on:

  • D401: Ensuring the first line of docstrings is in the imperative mood.
  • D100/D102/D104/D107: Adding missing docstrings for modules, methods, packages, and init methods.
  • D205: Ensuring one blank line between summary and description.
  • D301: Using raw string literals for docstrings with backslashes.
  • D417: Adding missing argument descriptions.
  • D418: Addressed by ensuring overloads have docstrings as per specific prompt instructions.

Files addressed so far include:

  • docs/conf.py
  • tsercom/init.py
  • Various files under tsercom/api/
  • Various files under tsercom/caller_id/
  • Various files under tsercom/data/

Further work is pending to address all remaining D rule violations across the codebase.

Static analysis:

  • black . passes.
  • mypy tsercom/ has pre-existing errors; no new errors were introduced by these changes. Unused type: ignore comments were removed.
  • ruff check . --select D will be fully addressed in subsequent commits.

Testing:

  • pytest --timeout=120 (run via PYTEST_TIMEOUT=120 python -m pytest) passed twice with 970 tests passing, 11 skipped, and 13 warnings. No new test failures were introduced.

This commit includes fixes for a subset of pydocstyle `D` rule violations, primarily focusing on:
- D401: Ensuring the first line of docstrings is in the imperative mood.
- D100/D102/D104/D107: Adding missing docstrings for modules, methods, packages, and __init__ methods.
- D205: Ensuring one blank line between summary and description.
- D301: Using raw string literals for docstrings with backslashes.
- D417: Adding missing argument descriptions.
- D418: Addressed by ensuring overloads have docstrings as per specific prompt instructions.

Files addressed so far include:
- docs/conf.py
- tsercom/__init__.py
- Various files under tsercom/api/
- Various files under tsercom/caller_id/
- Various files under tsercom/data/

Further work is pending to address all remaining `D` rule violations across the codebase.

Static analysis:
- `black .` passes.
- `mypy tsercom/` has pre-existing errors; no new errors were introduced by these changes. Unused `type: ignore` comments were removed.
- `ruff check . --select D` will be fully addressed in subsequent commits.

Testing:
- `pytest --timeout=120` (run via `PYTEST_TIMEOUT=120 python -m pytest`) passed twice with 970 tests passing, 11 skipped, and 13 warnings. No new test failures were introduced.
This commit includes additional fixes for pydocstyle D-rules
across various files in the tsercom codebase.

Fixes primarily address:
- D205: Blank line issues in module and class docstrings.
- D401: Ensuring first line of docstrings is in imperative mood.
- D10x: Adding missing docstrings (modules, methods, __init__).
- D413: Ensuring blank line after Args section.
- D207: Correcting docstring indentation.
- Syntax errors identified during linting.

D418 (overload docstrings) were handled by ensuring each @overload
has its own docstring as per explicit prompt requirements. Main
implementation docstrings for overloaded methods were minimized.
Remaining D418 violations on @overload lines themselves are
considered 'won't fix' due to conflict with these requirements.

All tests are passing (970 passed, 11 skipped, 13 warnings),
consistent with the previous state before these D-rule fixes.
This commit includes further fixes for pydocstyle D-rules,
continuing the effort to bring all docstrings into compliance.

Key changes:
- Added D104 package docstrings (e.g., for tsercom/tensor/serialization).
- Corrected D401 (imperative mood) for various methods.
- Fixed D205 (summary line formatting) for classes and methods.
- Addressed D100 (module), D107 (__init__), D102 (public method),
  D105 (magic method), and D413 (blank line after section) where found.
- Suppressed D418 globally in pyproject.toml as per user instruction,
  due to conflict with the requirement to document all overloads.
- Resolved syntax errors inadvertently introduced during prior edits.

All tests continue to pass (970 passed, 11 skipped, 13 warnings),
consistent with the previous state. E501 line length errors are
still deferred.
This commit includes pydocstyle D-rule fixes made so far.
Due to persistent errors with the `run_in_bash_session` tool
failing for `ruff check` and `black .` (reporting that these
commands modify too many files), full static analysis and
verification of recent changes could not be completed.

This PR is submitted in the current state at user request.

Key changes included prior to tool issues:
- Added/fixed numerous D10x, D20x, D30x, D40x docstring issues.
- Suppressed D418 globally in pyproject.toml as per user instruction.
- Addressed syntax errors.
@rwkeane rwkeane merged commit 0d51828 into RuffAddD Jun 23, 2025
1 of 2 checks passed
@rwkeane rwkeane deleted the fix/pydocstyle-compliance-e branch June 23, 2025 17:56
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.

1 participant