[MNT] move pre-commit config to ruff#508
Conversation
- Replace isort, black, flake8 with ruff in pre-commit hooks - Add ruff configuration to pyproject.toml - Update linters dependencies - Format and fix code with ruff
40df124 to
ac62a6d
Compare
for more information, see https://pre-commit.ci
…2, SIM201, SIM103
for more information, see https://pre-commit.ci
…PIE810, RUF012, SIM102, SIM201, SIM103, SIM117, B018, D401, B904, RUF043 in some
|
@fkiraly Please review this pr. Focus only on the precommit file as the rest changes are caused by moving to ruff. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #508 +/- ##
==========================================
- Coverage 85.07% 83.73% -1.35%
==========================================
Files 45 52 +7
Lines 3015 3854 +839
==========================================
+ Hits 2565 3227 +662
- Misses 450 627 +177 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ruff
|
@fkiraly Franz I think this change can be added as it is completely done and whenever you push a pr here, I have to clear merge conflicts. |
| [tool.bandit] | ||
| exclude_dirs = ["*/tests/*", "*/testing/*"] | ||
|
|
||
| [tool.setuptools] |
There was a problem hiding this comment.
why do we remove the setuptools config - seems like an accident
There was a problem hiding this comment.
Thank you Franz for pointing that out. I have fixed it. You can review the pr again and hopefully merge this.
Also there are 3 more prs on this repo which you can check out.
fkiraly
left a comment
There was a problem hiding this comment.
@arnavk23, since you are using a lot of AI in your pull requests - and often not well checked - can you kindly explain explicitly how you applied the formatting to all files?
Further, how did you select the configuration? E.g., did you copy it from somewhere, or is the list of excepted codes coming out of an AI?
|
@fkiraly I think there may be a misunderstanding. Most file changes came from Ruff auto-formatting during the migration. I followed the project’s existing Black/Flake8 behavior and put that into Ruff rather than introducing a new style. And the ignore are for warnings and error that may arise due to moving the previous files to ruff. |
|
sure - can you please let me know how exactly you applied ruff? Also please comment on the question where the excludes are coming from. |
@fkiraly, I applied Ruff by replacing the previous isort/black/flake8 pre-commit hooks with Ruff hooks and then running automated fixes. Most of the diff is formatting/lint cleanup rather than manual rewrites. For excludes/ignores, I did not copy a ready-made list from one source. I started from the project’s existing lint/format behavior, mapped that into Ruff and only added ignores when concrete migration warnings appeared. |
|
Also I think with the recent pushes, I am not able to resolve conflicts from my side so this might be hard to push afterall. |
|
sure - can you please let me know how exactly you applied ruff? How did you run it? Also please comment on the question where the excludes are coming from. Which "existing lint/format" behaviour are you referring to? (repeated back/forth on replies without clear information indicates that there is an AI involved in the conversation) |
|
@fkiraly Franz this is getting a little out of hand now. Anything I do, you flag it as AI overuse. You have to understand if I am writing back to you, I am also trying to understand your message and your review as a contributor. On this pr, I just changed the pyproject as was written for black and flake8 and isort for ruff then run pre-commit and these were the changes made. I added warnings for errors that I didn't feel should be changed in the code for ruff to see. Everything is there in the file. In the comment above too I wrote the same thing. Explaining everything. I am not understanding why you always keep going about my prs in such a hostile manner. I am trying my best here to implement a new contribution. And for your knowledge, this pr has no AI used at all. All changes were made by me. Can you please discuss with me if you feel anything is wrong or incorrectly implemented, I would like for the two of us to have dialogue on things rather than you just coming and putting a bad review comment, not understanding my comment and going to other prs. (Sorry for the harsh tone, but I genuinely feel this. Also the comments above the last comment which you called out specify rebase issue and the files that should be looked at, I wrote that with the ruff line. From my side, this is one of the prs, I felt was the most complete.) Thank you for your time. |
Reference Issues/PRs
Fixes #502
What does this implement/fix? Explain your changes.
This PR migrates the
pre-commitconfiguration to useruffas the unified tool for code formatting and linting, replacing the separateisort,black, andflake8hooks. This alignsskbasewithsktimeand other GC.OS repositories for consistency and performance.Does your contribution introduce a new dependency? If yes, which one?
Yes,
ruffis added as a new dependency in thelintersoptional dependencies group inpyproject.toml. This is necessary to replace the functionality ofisort,black, andflake8, providing a single, efficient tool for linting and formatting.What should a reviewer concentrate their feedback on?
pyproject.toml(rules, ignores, excludes)..pre-commit-config.yamlAny other comments?
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions