ci: fix all ruff findings, enforce ruff, document the step#85
Merged
Conversation
Fix every ruff finding on master — import ordering (I001), typing modernization to builtin generics and X|Y unions (UP006/UP007), redundant open mode (UP015), and a long line (E501) — across the package and tests. The public stub now uses list/dict/str|bytes; mypy --strict still passes. Flip the CI ruff step from advisory to blocking (config in ruff.toml) and add `ruff check --fix` to CONTRIBUTING. Also sync Cargo.lock to 0.4.0 (left stale by the version bump in #83). Signed-off-by: yuriyryabikov <22548029+kurok@users.noreply.github.com>
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.
Fixes every
ruff checkfinding on master and makes the CI ruff gate blocking.Fixed (13 findings)
__init__.py,conftest.py,generate_rfc_corpus.py,test_attachments.py__init__.pyinow useslist/dict/str | bytes(and drops thetypingimport); same in testsopen(..., 'r')mode —conftest.pytest_attachments.py(wrapped, logic unchanged)Enforced + documented
test.yml: droppedcontinue-on-errorfrom the ruff step → blocking (config inruff.toml).CONTRIBUTING.md: addedruff check --fix .as a pre-PR step; corrected the lint table (mypy is--strict+ blocking; ruff now blocking).Also
Cargo.lockto0.4.0(left stale when release: v0.4.0 #83 bumpedCargo.toml).Verified locally:
ruff check .clean,mypy --strictpasses, full suite 91 passed.