| [tool.ruff] |
| exclude = [ |
| # The root recipes.py file is vendored from the upstream recipe engine as-is |
| # and should not be modified. |
| "./recipes.py", |
| # cleanup_deps.py and renumber_proto_fields.py are vendored from the upstream |
| # Fuchsia recipes repo as-is and should not be modified. |
| "./scripts/cleanup_deps.py", |
| "./scripts/renumber_proto_fields.py", |
| ] |
| target-version = "py311" |
| line-length = 80 |
| |
| [tool.ruff.format] |
| quote-style = "single" |
| |
| [tool.ruff.lint] |
| select = [ |
| "ARG", # Unused args. |
| "B", # Possible bugs. |
| "C4", # Cleaner set/list calls. |
| "E4", # Import-related codestyle errors. |
| "E7", # Stylistic errors like "use `x is False` instead of `x != False". |
| "F", # Unused variables/imports. |
| "UP", # Upgrade to new simpler syntaxes. |
| ] |
| ignore = [ |
| # Allow `lambda` instead of `def` for non-inline functions. |
| "E731", |
| # Allow "ambiguous" variable names like `l`. |
| "E741", |
| # Don't require that exceptions be raised `from ...`. |
| "B904", |
| # Allow functools.cache usage. |
| "B019", |
| # Allow `assert False`. |
| "B011", |
| # Allow set() instead of {}, for readability. |
| "C401", |
| # Allow dict() instead of {}, for readability. |
| "C408", |
| # Don't require using `dict.fromkeys()` for dicts where all values are the |
| # same. |
| "C420", |
| # Allow .format() instead of f-strings. |
| "UP032", |
| # Deprecated rule. https://docs.astral.sh/ruff/rules/non-pep604-isinstance/ |
| "UP038", |
| ] |
| dummy-variable-rgx = "^(_.*|api)$" |
| |
| [tool.ruff.lint.isort] |
| split-on-trailing-comma = false |
| section-order = [ |
| "future", |
| "standard-library", |
| "third-party", |
| "first-party", |
| "recipe_engine", |
| "protos", |
| "recipe_modules", |
| "local-folder", |
| ] |
| # Import future annotations so types can be referenced in type annotations above |
| # where they're defined. |
| required-imports = ["from __future__ import annotations"] |
| |
| [tool.ruff.lint.isort.sections] |
| recipe_engine = ["recipe_engine"] |
| recipe_modules = ["RECIPE_MODULES"] |
| protos = ["PB"] |
| |
| [tool.pyright] |
| venvPath = '.recipe_deps/_venv' |
| venv = 'normal' |
| extraPaths = ['.recipe_deps/_path'] |