You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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