Extend ruff with preview option
Adding
preview = True
to the [tool.lint.ruff] section in pyproject.toml extends ruff to include more checks, including several checks that was earlier enforced in the Ert codebase through pylint.
Then run ruff to get an overview of issues:
$ ruff -q src tests | cut -f2 -d' ' | sort | uniq -c | sort -nr
121 PLC2701
90 PLR6301
67 PLR6201
15 PLR0914
13 F841
12 PLW1641
6 PLR0904
4 PLW1514
3 SIM103
3 PLR1702
2 SIM300
2 PLW3201
2 PLW0108
2 PLC0415
1 PLR1704
1 PLC2801
Use ruff rule SIM300 (or do a browser search) to explain each rule).
For each of these there are three options:
- Fix all issues in the codebase
- Put the rule into the exception list in
pyproject.toml - Fix some of the issues, and add
noqa: ruleidstatements to those we don't want to to fix
This issue takes over from #3309
Hi @berland , I'm interested in looking on to this issue, can you please assign me this task.
Hi @berland , I'm interested in looking on to this issue, can you please assign me this task.
Good. This issue might need several PRs to be solved, so please go ahead and start working on PRs.