blob: c4eac494728e62f22612bc581f3ff965270e7740 [file] [edit]
[project]
requires-python = ">=3.11"
[tool.autopep8]
max_line_length = 132
[tool.isort]
line_length = 132
known_first_party = "matter"
[tool.ruff]
line-length = 132
target-version = "py311"
exclude = [
".*",
"out",
"scripts/py_matter_yamltests/build",
"scripts/py_matter_idl/build",
"src/python_testing/matter_testing_infrastructure/build",
# Exclude submodules since we do not maintain them
# TODO: Use exact paths once we will have a way to sync and validate them in CI
"examples/common/QRCode/repo",
"examples/common/m5stack-tft/repo",
"third_party",
"examples/tv-casting-app/tests/",
# TODO(#37698)
"docs/development_controllers/matter-repl/*.ipynb",
]
[tool.pyright]
reportMissingTypeStubs = "warning"
[tool.ruff.lint]
select = [
# Standard errors and warnings
"E", "PLE", "W", "F",
# Ensure that async is used properly
"ASYNC",
# Consistent commas
"COM",
# Simplify the code if possible
"C4", "RET", "SIM",
# Ensure that scripts are executable
"EXE",
# Check for common exception issues
"RSE",
# Check for common logging issues
"LOG",
# Check for common optimization issues
"SLOT",
# Check for builtin symbols aliasing
"A",
]
ignore = [
"ASYNC109", # Sometimes we use "timeout" argument in async functions
"ASYNC230", # Allow open() calls in async functions
"ASYNC240", # Do not force 3rd party library to handle os.path.exists()
"ASYNC250", # TODO: Refactor the usage of input() in async functions
"COM812", # Do not enforce trailing commas in multi-line collections for now
"SIM102", # Nested if statements can be more readable in some cases
"SIM108", # Do not enforce ternary operator in place of if/else blocks
"SIM114", # Separate if statements can be more readable in some cases
"SIM905", # Sometimes using "command arg1 arg2".split() is more readable
"E501", # Do not report line length issues (formatter should handle this)
"E721", # We use it for good reasons
]
[tool.mypy]
mypy_path = ["matter/typings"]
namespace_packages = true
warn_unused_configs = true
ignore_missing_imports = true
explicit_package_bases = true