Feat: ruff#18
Open
MarceloRobert wants to merge 4 commits into
Open
Conversation
Running ruff auto-formatting and auto-linting
Configures the ruff standards and adds an ignore to the formatting commit so that it doesn't show on git blame commands
Add pre-commit hooks to run ruff automatically and flag problems
Adds ci file to run ruff automatically on pull requests Closes kernelci#3
tales-aparecida
approved these changes
Apr 22, 2026
tales-aparecida
approved these changes
May 14, 2026
Collaborator
tales-aparecida
left a comment
There was a problem hiding this comment.
LGTM I personally prefer double quotes to allow contraction, but I understand this was done to
continue with repository style
Collaborator
|
Pls add sign-off to your commits |
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.
Description
Ruff is a fast python linter and formatter which is going to be adopted by the KernelCI repositories (following the contributing guidelines discussion).
For now, the selected rules were just the basic ones selected by default for ruff as in this example.
A list of all rules can be found here.
Note
I didn't enable the function complexity rule because there are many functions over the complexity limit of 10, which means there would be too much refactor to be done. Some functions exceeded 60 in complexity.
Changes
This PR also adds a
.git-blame-ignore-revsso that we can ignore the reformatting commit when using thegit blamecommand.All commits are related, but if a PR split is required we can review that too.
How to test
Check the instructions in the documentation, install the dev dependencies, run
ruff formatandruff check --fixand see that everything is already formatted. Try adding some formatting error such as "blank line after class definition" or a linting error such as "unused import" and check that ruff will catch those problems.Closes #3