Replace black with ruff format and align the ruff config - #64
Draft
zigpy-review-bot wants to merge 2 commits into
Draft
zigpy-review-bot wants to merge 2 commits into
zigpy-review-bot wants to merge 2 commits into
Conversation
Import sorting (force-sort-within-sections, as in the other zigpy libraries), SIM300 and SIM108, and ruff format joining an implicitly concatenated log format string. No behaviour change.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #64 +/- ##
========================================
+ Coverage 7.61% 7.64% +0.02%
========================================
Files 9 9
Lines 617 615 -2
========================================
Hits 47 47
+ Misses 570 568 -2 ☔ View full report in Codecov by Harness. 🚀 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.
Changes
black23.1.0 →ruff format. ruff-pre-commit v0.0.246 → v0.16.9, with the repo URL moved fromcharliermarsh/toastral-sh/and the hook idsruff-check/ruff-format.[tool.ruff]moves to the current[tool.ruff.lint]layout. The rules go fromF, E, W, I001toB, C, E, F, I, SIM, UP, W, the set zigpy-znp uses, withmax-complexity = 25. isort now usesforce-sort-within-sectionsandcombine-as-importslike the other zigpy libraries.target-version = "py311"matchesrequires-python.Verification
pre-commit run --all-filespasses on Python 3.14.zigpy --helpstill lists thedb,ota,pcapandradiocommands after the import reordering in__main__.py.Context
This is one of a set of draft PRs that align the pre-commit setup of the zigpy libraries on ruff (
ruff check+ruff format), which zigpy, zha, zha-device-handlers, zigpy-znp, zigpy-ota and zigpy-ziggurat already use. The same change is proposed for bellows, zigpy-deconz, zigpy-xbee, zigpy-zigate and zigpy-cli, plus small ruff config fixes in zigpy and zigpy-ziggurat.The commits are kept separate so parts can be dropped or moved into their own PR. Maintainers can ask the bot for that, or for any other change, by commenting
@zigpy-review-bot <request>on this PR.