style(qa): use ruff for linting and formatting#51
Merged
wbarnha merged 2 commits intoMar 2, 2024
Merged
Conversation
Member
|
I love |
wbarnha
approved these changes
Mar 2, 2024
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.
Hey,
Following the proposal here this PR proposal switch linter and formatter to ruff:
Updated .gitignore following the one here: marcosschroh/python-schema-registry-client
Updated: tox.init / Makefile / pre-commit
Applied linter & formatter:
Most changes are about type mismatch
my_var: str = None=>my_var: Optional[str] = NoneDrop unused
# noqarulesRegrouped some requirements under the
dev.txtSome formatting note:
will be changed to
The first formatting version was introduced by black 2024 version (~ a month ago), ruff will support this soon. In my opinion just following the chosen tool available features, going backward then forward is fine.
ruff.tomlfor the configuration instead of thepyproject.toml, I prefer to provide a dedicated PR to regroup all configuration under thepyproject.toml.line-lengthsetup is79, black/ruff default line length is88I would tend to match this, but before applying this I would like to know your opinion.default.txt,test.txt,docs.txt:dev.txt=>test.txt(I believe which people setup development will also need the test environment)ci.txt=>test.txt(just containingpytest-cov)dist.txt=>test.txt&docs.txt, not totally sure if possible as I seewheel,twine&packaginginside.