ert icon indicating copy to clipboard operation
ert copied to clipboard

Extend ruff with preview option

Open berland opened this issue 1 year ago • 2 comments

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:

  1. Fix all issues in the codebase
  2. Put the rule into the exception list in pyproject.toml
  3. Fix some of the issues, and add noqa: ruleid statements to those we don't want to to fix

This issue takes over from #3309

berland avatar Mar 07 '24 06:03 berland

Hi @berland , I'm interested in looking on to this issue, can you please assign me this task.

kachida avatar Mar 09 '24 02:03 kachida

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.

berland avatar Mar 11 '24 06:03 berland