pyproject.toml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. ]
  31. select = [
  32. "B", # flake8-bugbear
  33. "D", # flake8-docstrings
  34. "C4", # flake8-comprehensions
  35. "S", # flake8-bandit
  36. "F", # pyflake
  37. "E", # pycodestyle
  38. "W", # pycodestyle
  39. "UP", # pyupgrade
  40. "I", # isort
  41. "RUF", # ruff specific
  42. ]
  43. [tool.ruff.lint.per-file-ignores]
  44. "tests/**/*" = [
  45. "D100",
  46. "D101",
  47. "D102",
  48. "D103",
  49. "D104",
  50. "S101",
  51. ]
  52. "setup.py" = ["D100"]
  53. "conftest.py" = ["D100"]
  54. "docs/conf.py" = ["D100"]
  55. [tool.ruff.lint.isort]
  56. known-first-party = ["pySwitchbot", "tests"]