# Ruff configuration # https://docs.astral.sh/ruff/configuration/ target-version = "py313" line-length = 100 # Exclude vendored dependencies in Lambda code and build artifacts exclude = [ "**/certifi*", "**/charset_normalizer*", "**/idna*", "**/requests*", "**/urllib3*", "**/bin", "**/cdk.out/**", "pytest.ini", ] [lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # Pyflakes (includes unused imports, variables) "I", # isort "B", # flake8-bugbear "C4", # flake8-comprehensions "UP", # pyupgrade "ARG", # flake8-unused-arguments "SIM", # flake8-simplify ] ignore = [ "E501", # line too long (handled by formatter) "B008", # do not perform function calls in argument defaults "B905", # zip without explicit strict parameter "SIM108", # use ternary operator instead of if-else ] # Per-file ignores for legitimate patterns [lint.per-file-ignores] # Tests: pytest fixtures/parameters often appear unused — keep ignoring those. # F401 stays enforced everywhere so unused imports surface in lint (and CI). "tests/**/*.py" = ["ARG001", "E402"] # CLI entry points "surfaces/cli/__main__.py" = ["ARG001"] # stderr/stdout buffers outlive the function — closed in a watcher thread's `finally`, # so a `with` block at the call site would close them before the subprocess runs. "tools/interactive_shell/synthetic/runner.py" = ["SIM115"] "surfaces/interactive_shell/runtime/subprocess_runner/background_task_executor.py" = ["SIM115"] # self._fd is opened in __init__ and must remain open for the lifetime of the # background reader thread (_reader_loop). A with-block would close the fd when # __init__ exits — before the thread reads anything. The fd is closed in close(). "tools/system/fleet_monitoring/tail.py" = ["SIM115"] # tools/_tools/__init__.py files are concatenations of multiple tool modules. # Imports appear in each section rather than all at the top (E402). "tools/*_tools/__init__.py" = ["E402", "F811"] # Same layout after vendor tools migrate to integrations//tools/. "integrations/*/tools/__init__.py" = ["E402", "F811"] [lint.isort] known-first-party = [ "config", "core", "integrations", "platform", "surfaces", "tests", "tools", ]