xref: /xnu-11215.81.4/tools/lldbmacros/ruff.toml (revision d4514f0bc1d3f944c22d92e68b646ac3fb40d452)
1# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
2select = ["E", "F"]
3ignore = ["E741"]
4
5# Allow autofix for all enabled rules (when `--fix`) is provided.
6fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
7unfixable = []
8
9# Assume several lldb and xnu-specific globals are built-in.
10builtins = ["lldb", "kern", "cast", "addressof"]
11
12# Exclude a variety of commonly ignored directories.
13exclude = [
14    ".eggs",
15    ".egg-info",
16    ".ruff_cache",
17    "__pycache__",
18    "dist",
19]
20
21# Same as Black.
22line-length = 88
23
24# Allow unused variables when underscore-prefixed.
25dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
26
27# Assume Python 3.9.
28target-version = "py39"
29
30# Unlike Flake8, default to a complexity level of 10.
31mccabe.max-complexity = 10
32