pyproject.toml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. [tool.ruff]
  2. target-version = "py311"
  3. line-length = 88
  4. [tool.ruff.lint]
  5. ignore = [
  6. "S101", # use of assert
  7. "D203", # 1 blank line required before class docstring
  8. "D212", # Multi-line docstring summary should start at the first line
  9. "D100", # Missing docstring in public module
  10. "D101", # Missing docstring in public module
  11. "D102", # Missing docstring in public method
  12. "D103", # Missing docstring in public module
  13. "D104", # Missing docstring in public package
  14. "D105", # Missing docstring in magic method
  15. "D107", # Missing docstring in `__init__`
  16. "D400", # First line should end with a period
  17. "D401", # First line of docstring should be in imperative mood
  18. "D205", # 1 blank line required between summary line and description
  19. "D415", # First line should end with a period, question mark, or exclamation point
  20. "D417", # Missing argument descriptions in the docstring
  21. "E501", # Line too long
  22. "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
  23. "B008", # Do not perform function call
  24. "S110", # `try`-`except`-`pass` detected, consider logging the exception
  25. "D106", # Missing docstring in public nested class
  26. "UP007", # typer needs Optional syntax
  27. "UP038", # Use `X | Y` in `isinstance` is slower
  28. "S603", # check for execution of untrusted input
  29. "S105", # possible hard coded creds
  30. "TID252", # not for this lib
  31. "TRY003", # nice but too many to fix,
  32. "G201", # too noisy
  33. "PLR2004", # too many to fix
  34. ]
  35. select = [
  36. "ASYNC", # async rules
  37. "B", # flake8-bugbear
  38. "D", # flake8-docstrings
  39. "C4", # flake8-comprehensions
  40. "S", # flake8-bandit
  41. "F", # pyflake
  42. "E", # pycodestyle
  43. "W", # pycodestyle
  44. "UP", # pyupgrade
  45. "I", # isort
  46. "RUF", # ruff specific
  47. "FLY", # flynt
  48. "G", # flake8-logging-format ,
  49. "PERF", # Perflint
  50. "PGH", # pygrep-hooks
  51. "PIE", # flake8-pie
  52. "PL", # pylint
  53. "PT", # flake8-pytest-style
  54. "PTH", # flake8-pathlib
  55. "PYI", # flake8-pyi
  56. "RET", # flake8-return
  57. "RSE", # flake8-raise ,
  58. "SIM", # flake8-simplify
  59. "SLF", # flake8-self
  60. "SLOT", # flake8-slots
  61. "T100", # Trace found: {name} used
  62. "T20", # flake8-print
  63. "TID", # Tidy imports
  64. "TRY", # tryceratops
  65. ]
  66. [tool.ruff.lint.per-file-ignores]
  67. "tests/**/*" = [
  68. "D100",
  69. "D101",
  70. "D102",
  71. "D103",
  72. "D104",
  73. "S101",
  74. "SLF001",
  75. "PLR2004",
  76. ]
  77. "setup.py" = ["D100"]
  78. "conftest.py" = ["D100"]
  79. "docs/conf.py" = ["D100"]
  80. "scripts/**/*" = [
  81. "T201"
  82. ]
  83. [tool.ruff.lint.isort]
  84. known-first-party = ["pySwitchbot", "tests"]