[Tracker] Code health related to ruff
Author: johnnv1Created Jul 9, 2023Updated Sep 17, 2026
Labelshelp wantedgood first issue
Feature
Recently switched to using ruff as the tool responsible for code health (#2292). But we can extract and benefit much more from this tool, and for that, we need to update our code base. So feel free to submit a PR allowing us to enable some of these rules. We understand that some of them require a lot of effort, so PRs that partially fix the existing problems are very welcome too!
A list including some of the rules we should consider enable on ruff to improve the package health
- B (bugbear): https://beta.ruff.rs/docs/rules/#flake8-bugbear-b
- ISC (flake8-implicit-str-concat): https://beta.ruff.rs/docs/rules/#flake8-implicit-str-concat-isc
- RET (flake8-return): https://beta.ruff.rs/docs/rules/#flake8-return-ret
- SIM (simplify): https://beta.ruff.rs/docs/rules/#flake8-simplify-sim
- TCH (flake8-type-checking): https://beta.ruff.rs/docs/rules/#flake8-type-checking-tch
- PGH (pygrep-hooks): https://beta.ruff.rs/docs/rules/#pygrep-hooks-pgh
- PT (flake8-pytest-style-pt): https://beta.ruff.rs/docs/rules/#flake8-pytest-style-pt
- Partially fix some of the existing issues - #2444
The complete list of rules available on ruff can be found on the official webpage: https://beta.ruff.rs/docs/rules/
- A list of the rules is also available on the pyproject.toml: #2441
Related PRs
- #2292
- #2358
- #2442
Related issues
- #2443
Consider also to contribute to Kornia universe projects :)
- Tutorials: our repository containing the tutorials.
Source: kornia/kornia