pyproject.toml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. "S603", # check for execution of untrusted input
  28. "S105", # possible hard coded creds
  29. "TID252", # not for this lib
  30. "TRY003", # nice but too many to fix,
  31. "G201", # too noisy
  32. "PLR2004", # too many to fix
  33. ]
  34. select = [
  35. "ASYNC", # async rules
  36. "B", # flake8-bugbear
  37. "D", # flake8-docstrings
  38. "C4", # flake8-comprehensions
  39. "S", # flake8-bandit
  40. "F", # pyflake
  41. "E", # pycodestyle
  42. "W", # pycodestyle
  43. "UP", # pyupgrade
  44. "I", # isort
  45. "RUF", # ruff specific
  46. "FLY", # flynt
  47. "G", # flake8-logging-format ,
  48. "PERF", # Perflint
  49. "PGH", # pygrep-hooks
  50. "PIE", # flake8-pie
  51. "PL", # pylint
  52. "PT", # flake8-pytest-style
  53. "PTH", # flake8-pathlib
  54. "PYI", # flake8-pyi
  55. "RET", # flake8-return
  56. "RSE", # flake8-raise ,
  57. "SIM", # flake8-simplify
  58. "SLF", # flake8-self
  59. "SLOT", # flake8-slots
  60. "T100", # Trace found: {name} used
  61. "T20", # flake8-print
  62. "TID", # Tidy imports
  63. "TRY", # tryceratops
  64. ]
  65. [tool.ruff.lint.per-file-ignores]
  66. "tests/**/*" = [
  67. "D100",
  68. "D101",
  69. "D102",
  70. "D103",
  71. "D104",
  72. "S101",
  73. "SLF001",
  74. "PLR2004",
  75. ]
  76. "setup.py" = ["D100"]
  77. "conftest.py" = ["D100"]
  78. "docs/conf.py" = ["D100"]
  79. "scripts/**/*" = [
  80. "T201"
  81. ]
  82. [tool.ruff.lint.isort]
  83. known-first-party = ["pySwitchbot", "tests"]