Skip to content

Get rid of all ruff exceptions in pyproject.toml

Leon Wubben requested to merge SE-519-improve-linting into main

Explanation of changes

Ongoing MR fixing linting. Can be merged without closing the MR.
Will slowly remove all ruff exceptions from pyproject.poml. Only # noqa: xxx (explanation why) will be allowed.

Fixed linting:

  • (f-)string formatting (UP0-UP999)
  • Line lengths (E501). Impossible to fix have been given a # noqa: E501 comment.
  • ANN001 - missing-type-func-argument
  • ANN201 - missing-return-type-public-function
  • ANN202 - missing-return-type-private-function
  • ANN204 - missing-return-type-special-function
  • ANN205 - missing-return-static-function
  • ANN401 - using ANY type for type hints
  • SIM118 - for x in d.keys() -> for x in d
  • SIM108 - Inline if else statements
  • SIM105 - Supress errors instead of try: except: pass
  • SIM102 - if x: if y: -> if x and y
  • SIM300 - Yoda conditions "x" == y -> y == "x"
  • SIM201 - not x == y -> x != y
  • N801, N816 - upper cases in function names/variables/parameters
  • PLR915 - too many statements. Two tests that are way too large. Not changed
  • PLR5501 - else: if: -> elif:
  • PLR1714 - if x == a or x == b or x == c: -> if x in (a, b, c)
  • PLR0124 - assert x == x Removed

Merged earlier

Edited by Leon Wubben

Merge request reports

Loading