.ruff.toml 2.6 KB

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