|
1 | 1 | # This file is at the root level, as it applies to all Python code, |
2 | 2 | # not only to docs or to tools. |
3 | 3 | [tool.pyright] |
4 | | -extends = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml" |
| 4 | +typeCheckingMode = "standard" |
| 5 | +pythonVersion = "3.12" # Keep in sync with MODULE.bazel |
| 6 | + |
| 7 | +# Warn if function parameters lack type annotations |
| 8 | +reportMissingParameterType = "warning" |
| 9 | + |
| 10 | +# Warn if generic types (e.g. List) are missing type args |
| 11 | +reportMissingTypeArgument = "warning" |
| 12 | + |
| 13 | +# Warn when using members marked as private (e.g. _log) |
| 14 | +reportPrivateUsage = "warning" |
| 15 | + |
| 16 | +# Warn when variable type can't be inferred or is 'Any' |
| 17 | +reportUnknownVariableType = "warning" |
| 18 | + |
| 19 | +# Warn about declared but unused variables |
| 20 | +reportUnusedVariable = "warning" |
5 | 21 |
|
6 | 22 | exclude = [ |
7 | 23 | "**/__pycache__", |
8 | 24 | "**/.*", |
9 | 25 | "**/bazel-*", |
10 | | - ".venv*/**", |
11 | 26 | ] |
12 | 27 |
|
13 | 28 | venvPath = "." |
14 | 29 | venv = ".venv_docs" |
15 | 30 |
|
16 | 31 | [tool.ruff] |
17 | | -extend = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml" |
18 | | - |
| 32 | +#line-length=59 |
| 33 | +target-version = "py312" # Keep in sync with MODULE.bazel |
19 | 34 | extend-exclude = [ |
| 35 | + "__pycache__", |
| 36 | + ".*", |
| 37 | + "bazel-*", |
20 | 38 | "**/__pycache__", |
21 | 39 | "/.*", |
22 | | - "bazel-*", |
23 | | - ".venv*/**", |
| 40 | + ".venv*/**", |
| 41 | +] |
| 42 | + |
| 43 | +# Selected rules for clean code, readability, and bug prevention |
| 44 | +lint.select = [ |
| 45 | + "E", # pycodestyle (PEP8) |
| 46 | + "F", # pyflakes (undefined vars, unused imports) |
| 47 | + "I", # isort (import sorting) |
| 48 | + "B", # flake8-bugbear (likely bugs) |
| 49 | + "C90", # mccabe (complexity checks) |
| 50 | + "UP", # pyupgrade (modern Python 3.12+ features) |
| 51 | + "SIM", # flake8-simplify (simplifies code patterns) |
| 52 | + "RET" # flake8-return (consistent return statements) |
| 53 | +] |
| 54 | + |
| 55 | +lint.ignore = [ |
| 56 | + # Rules we want to ignore go in here. |
| 57 | + # Always provide a comment explaining why. |
24 | 58 | ] |
0 commit comments