# Lint config for the android gateway plugin. # # Run from the repo root (uses the hermes-agent venv's ruff): # hermes-agent/.venv/bin/python -m ruff check gateway-plugin # # The rule set is deliberately broad (pycodestyle, pyflakes, isort, pyupgrade, # bugbear, flake8-simplify, pylint, return, comprehensions). Thresholds below # reflect the plugin's real shape: it is a single large dispatch surface # (adapter.py) plus a wire-protocol layer (protocol.py) whose frame builders # mirror the schema, so the complexity ceilings are set just above the current # maxima rather than an idealized small-function target. line-length = 100 [lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes "I", # isort "UP", # pyupgrade "B", # flake8-bugbear "SIM", # flake8-simplify "PL", # pylint "RET", # flake8-return "C4", # flake8-comprehensions ] # The plugin intentionally defers hermes-runtime imports into function bodies # (they are only available once the plugin is loaded inside the gateway, and # some are optional/try-imported). Top-level import placement does not apply. ignore = ["PLC0415"] [lint.pylint] # Current maxima in the codebase: 22 branches, 64 statements, 9 returns, # 8 args (protocol.py:252 frame builder is the lone 11-arg outlier, noqa'd). max-branches = 24 max-statements = 70 max-returns = 9 max-args = 8 [lint.per-file-ignores] # The e2e / ws_probe drivers are assertion scripts: scenario numbers and # control-flow sprawl are intentional and not worth refactoring. "tests/**" = ["PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLW1510"] # The device-admin CLI is a small operator script: argv length checks are # its natural shape. "tools/**" = ["PLR2004"]