Skip to content

Match ruff's rule set to pyguitest/pyguitest-recorder (docstrings, co… - #3

Merged
ctrondlp merged 1 commit into
mainfrom
P4-lint-parity-and-docstrings
Sep 9, 2026
Merged

ctrondlp merged 1 commit into
mainfrom
P4-lint-parity-and-docstrings

Conversation

@ctrondlp

@ctrondlp ctrondlp commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

…mplexity, simplification, unused-argument checks), fixing the 8 suppressible try/except/pass patterns and ~40 missing docstrings it surfaced -- mostly one-liners on event dataclasses naming which numbering scheme a field uses

Summary by CodeRabbit

  • Documentation

    • Expanded API documentation for events, devices, keycodes, coordinates, timestamps, lifecycle management, errors, and portal sessions.
    • Clarified session ownership, negotiation behavior, timeout handling, and denial errors.
    • Improved formatting and explanations across the library and integration materials.
  • Maintenance

    • Simplified resource-cleanup handling while preserving existing behavior.
    • Strengthened code-quality checks and consistency across the project.

…mplexity, simplification, unused-argument checks), fixing the 8 suppressible try/except/pass patterns and ~40 missing docstrings it surfaced -- mostly one-liners on event dataclasses naming which numbering scheme a field uses
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: f8c21b10-b343-471b-bec9-bfd7f8dae782

📥 Commits

Reviewing files that changed from the base of the PR and between d04cf67 and b1f37f3.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • pyproject.toml
  • src/libei/_capi/__init__.py
  • src/libei/ei.py
  • src/libei/eis.py
  • src/libei/oeffis.py
  • src/libei/portal.py
  • tests/test_ei_objects.py
  • tests/test_eis_objects.py
  • tests/test_inputcapture.py
  • tests/test_integration_extras.py
  • tests/test_oeffis.py
  • tests/test_portal.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change expands Ruff lint enforcement, adds or reformats API documentation, and replaces equivalent OSError cleanup handlers with contextlib.suppress.

Changes

Lint enforcement and documentation cleanup

Layer / File(s) Summary
Ruff policy and changelog
pyproject.toml, CHANGELOG.md
Ruff enables additional rule families, configures pydocstyle and complexity limits, and documents the resulting cleanup and documentation updates.
Public API documentation
src/libei/ei.py, src/libei/eis.py, src/libei/oeffis.py, src/libei/portal.py, src/libei/_capi/__init__.py
Module, exception, event, device, context, session, and dispatch documentation is added or reformatted.
OSError cleanup simplification
src/libei/portal.py, tests/*
Destructor and test cleanup paths use contextlib.suppress(OSError) without changing suppression behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b1f37

This update expands lint enforcement, improves API documentation, and preserves cleanup behavior while simplifying ignored OSError handling. No merge-blocking production risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 11 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: matching Ruff's rule set to pyguitest and pyguitest-recorder. It is concise and relevant to the pull request objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 36 functions across 11 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch P4-lint-parity-and-docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ctrondlp
ctrondlp merged commit 569bab9 into main Sep 9, 2026
8 checks passed
@ctrondlp
ctrondlp deleted the P4-lint-parity-and-docstrings branch September 10, 2026 17:08
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