Feat: Replace flake8, black and husky with ruff + pre-commit#1846
Open
MarceloRobert wants to merge 4 commits intokernelci:mainfrom
Open
Feat: Replace flake8, black and husky with ruff + pre-commit#1846MarceloRobert wants to merge 4 commits intokernelci:mainfrom
MarceloRobert wants to merge 4 commits intokernelci:mainfrom
Conversation
27d8c4e to
65f4ebc
Compare
dede999
approved these changes
Apr 10, 2026
Contributor
dede999
left a comment
There was a problem hiding this comment.
I don't like pretty much the idea of so many unrelated changes, but as they were made by the new linter rules, there is no real point in complaining about them. I only many a small suggestion but it must not lock the merge of the PR it it takes too long
| name: frontend pre-push | ||
| entry: bash | ||
| args: | ||
| - -lc |
Contributor
There was a problem hiding this comment.
nit: is it possible to extract this script (lines 31-47) to a shell script? Would it take too much time?
Collaborator
Author
There was a problem hiding this comment.
I could but then we would be going back to having separate files for the pre-push of the frontend, I don't think this is needed for now
Not formatting yet, just configs
Replaces husky as a hook manager with pre-commit manager as per new contributing guidelines. This also improves the readability of the hooks as everything is in a single file.
65f4ebc to
849dcba
Compare
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.
Important
This PR will be broken in 2, first we will reformat the files bypassing all checks and then we will push the configs and a .git-blame-ignore-revs so that we can use as many rules as possible, all while keeping the blame ability
Changes
Note
I decided to ignore the /commands folder from linting as there were a lot of functions that went over the complexity limit of 10 (which was previously 11) not only because there would be a lot of refactoring but also because it is pretty easy for the commands to get complex.
How to test
pnpm install(this will uninstall Husky)poetry install(this will install Ruff and Pre-commit and uninstall Black and Flake8)poetry run ruff format --checkpoetry run ruff checkgit config --get core.hooksPathpoetry -C backend run pre-commit install --hook-type pre-commit --hook-type pre-push --install-hookspoetry -C backend run pre-commit validate-configpoetry -C backend run pre-commit run --hook-stage pre-commit --all-filespoetry -C backend run pre-commit run --hook-stage pre-push --all-filesgit push --dry-run(or push to a test branch) to confirm pre-push hooks execute.Reference / Useful Links
Closes #1845