.ruff.toml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. exclude = [
  2. "migrations/*",
  3. ]
  4. line-length = 120
  5. [format]
  6. quote-style = "double"
  7. [lint]
  8. preview = true
  9. select = [
  10. "B", # flake8-bugbear rules
  11. "C4", # flake8-comprehensions
  12. "E", # pycodestyle E rules
  13. "F", # pyflakes rules
  14. "FURB", # refurb rules
  15. "I", # isort rules
  16. "N", # pep8-naming
  17. "PT", # flake8-pytest-style rules
  18. "PLC0208", # iteration-over-set
  19. "PLC2801", # unnecessary-dunder-call
  20. "PLC0414", # useless-import-alias
  21. "PLE0604", # invalid-all-object
  22. "PLE0605", # invalid-all-format
  23. "PLR0402", # manual-from-import
  24. "PLR1711", # useless-return
  25. "PLR1714", # repeated-equality-comparison
  26. "RUF013", # implicit-optional
  27. "RUF019", # unnecessary-key-check
  28. "RUF100", # unused-noqa
  29. "RUF101", # redirected-noqa
  30. "RUF200", # invalid-pyproject-toml
  31. "RUF022", # unsorted-dunder-all
  32. "S506", # unsafe-yaml-load
  33. "SIM", # flake8-simplify rules
  34. "TRY400", # error-instead-of-exception
  35. "TRY401", # verbose-log-message
  36. "UP", # pyupgrade rules
  37. "W191", # tab-indentation
  38. "W605", # invalid-escape-sequence
  39. ]
  40. ignore = [
  41. "E402", # module-import-not-at-top-of-file
  42. "E711", # none-comparison
  43. "E712", # true-false-comparison
  44. "E721", # type-comparison
  45. "E722", # bare-except
  46. "E731", # lambda-assignment
  47. "F821", # undefined-name
  48. "F841", # unused-variable
  49. "FURB113", # repeated-append
  50. "FURB152", # math-constant
  51. "UP007", # non-pep604-annotation
  52. "UP032", # f-string
  53. "UP045", # non-pep604-annotation-optional
  54. "B005", # strip-with-multi-characters
  55. "B006", # mutable-argument-default
  56. "B007", # unused-loop-control-variable
  57. "B026", # star-arg-unpacking-after-keyword-arg
  58. "B903", # class-as-data-structure
  59. "B904", # raise-without-from-inside-except
  60. "B905", # zip-without-explicit-strict
  61. "N806", # non-lowercase-variable-in-function
  62. "N815", # mixed-case-variable-in-class-scope
  63. "PT011", # pytest-raises-too-broad
  64. "SIM102", # collapsible-if
  65. "SIM103", # needless-bool
  66. "SIM105", # suppressible-exception
  67. "SIM107", # return-in-try-except-finally
  68. "SIM108", # if-else-block-instead-of-if-exp
  69. "SIM113", # enumerate-for-loop
  70. "SIM117", # multiple-with-statements
  71. "SIM210", # if-expr-with-true-false
  72. ]
  73. [lint.per-file-ignores]
  74. "__init__.py" = [
  75. "F401", # unused-import
  76. "F811", # redefined-while-unused
  77. ]
  78. "configs/*" = [
  79. "N802", # invalid-function-name
  80. ]
  81. "libs/gmpy2_pkcs10aep_cipher.py" = [
  82. "N803", # invalid-argument-name
  83. ]
  84. "tests/*" = [
  85. "F811", # redefined-while-unused
  86. ]
  87. [lint.pyflakes]
  88. allowed-unused-imports = [
  89. "_pytest.monkeypatch",
  90. "tests.integration_tests",
  91. "tests.unit_tests",
  92. ]