ci: tier 3 — enable remaining ruff groups (fixes + grandfathered noqas)#960
Draft
bluetoothbot wants to merge 2 commits into
Draft
ci: tier 3 — enable remaining ruff groups (fixes + grandfathered noqas)#960bluetoothbot wants to merge 2 commits into
bluetoothbot wants to merge 2 commits into
Conversation
Mechanical, behavior-preserving fixes so the SLF/BLE/ARG/C90/TRY/ANN/ ASYNC/PT/EXE families can be enabled cleanly: - ARG002: rename unused base-contract params to _-prefixed (public device reject-stubs, user/types/api). - ARG001: drop the unused _events no_input param and the anonymize_dict name param; rename unused callback params. - TRY300: move success-path returns into else blocks. - TRY301: restructure the camera RTSPS stream CLI helpers so the typer.Exit no longer raises inside the broad error guard. - TRY400: use logging.exception in api JSON-decode error paths. - ANN001: annotate the SQLAlchemy connect listener. - PT018: split the composite TYPE_CHECKING assertion in bootstrap. - EXE001: mark scripts/fetch_openapi.py and setup.py executable. Add CLI tests covering the restructured create/delete RTSPS stream commands (success/none/error paths) for 100% patch coverage.
Add the final aioesphomeapi-parity rule families to the ruff select: ANN, ARG, ASYNC, BLE, C90, EXE, NPY, PT, SLF, TID, TRY. With uilibs#956 and uilibs#957 this brings the select in line with aioesphomeapi (uilibs#872). - Set [tool.ruff.lint.mccabe] max-complexity = 10 (ruff default, made explicit to match aioesphomeapi). - Grandfather existing intentional cases with one-line # noqa: SLF001 (intra-package private access), BLE001 (broad resilience guards), C901 (complex private-API/bootstrap functions), and PT028 (typer CLI commands named test_*). These shrink as the private API is removed in the public-API migration. - Exempt tests/ from the test-noise families (ANN/ARG/SLF/PT plus ASYNC110/C901/TRY002), matching the existing tests per-file-ignore precedent. The fix slice (ARG/TRY/ANN/EXE/PT018) landed in the previous commit.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final Tier-3 slice of #872: adds the remaining aioesphomeapi-parity ruff
families to
select(ANN,ARG,ASYNC,BLE,C90,EXE,NPY,PT,SLF,TID,TRY), fixing the handful of real findings andgrandfathering the intentional ones with one-line
# noqa. With #956 and#957 merged the
selectmirrors aioesphomeapi and #872 can close.Closes #958
Changes
ARG002reject-stub params renamed to_-prefixed;ARG001unused args dropped/renamed;TRY300successreturns moved to
else;TRY301RTSPS-stream CLI helpers restructured sotyper.Exitno longer raises inside the broad guard;TRY400logging.exceptionin JSON-decode paths;ANN001SQLAlchemy connectlistener annotated;
PT018compositeTYPE_CHECKINGassert split;EXE001scripts/fetch_openapi.py+setup.pymarked executable.SLF001(33),BLE001(12),C901(16),PT028(4)grandfathered with one-line
# noqareasons. Private-API noqas disappearas that code is removed in the public-API migration.
[tool.ruff.lint.mccabe] max-complexity = 10;tests/exemptfrom the test-noise families (
ANN/ARG/SLF/PT+ASYNC110/C901/TRY002), matching the existing tests per-file-ignore precedent.to keep 100% patch coverage on the touched lines.
Test plan
ruff checkgreen;ruff format --checkclean.poetry run pytestgreen (the one unrelatedtest_public_schema_conformancefailure also fails on
main— it tracks the fetched OpenAPI spec version).otherwise.
Quality Report
Changes: 25 files changed, 256 insertions(+), 123 deletions(-)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan