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. |
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