|
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 | +# Standard mode + some additional warnings as defined below |
| 5 | +typeCheckingMode = "standard" |
| 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 | | - "**/__pycache__", |
8 | | - "**/.*", |
9 | | - "**/bazel-*", |
10 | | - ".venv*/**", |
| 23 | + "**/__pycache__", |
| 24 | + "**/.*", |
| 25 | + "**/bazel-*", |
| 26 | + ".venv*/**", |
11 | 27 | ] |
12 | 28 |
|
13 | 29 | venvPath = "." |
14 | 30 | venv = ".venv_docs" |
15 | 31 |
|
16 | 32 | [tool.ruff] |
17 | | -extend = "bazel-bin/ide_support.runfiles/score_tooling+/python_basics/pyproject.toml" |
| 33 | +target-version = "py312" |
| 34 | + |
| 35 | +[tool.ruff.lint] |
| 36 | +select = [ |
| 37 | + "E", # pycodestyle (PEP8) |
| 38 | + "F", # pyflakes (undefined vars, unused imports) |
| 39 | + "I", # isort (import sorting) |
| 40 | + "B", # flake8-bugbear (likely bugs) |
| 41 | + "C90", # mccabe (complexity checks) |
| 42 | + "UP", # pyupgrade (modern Python 3.12+ features) |
| 43 | + "SIM", # flake8-simplify (simplifies code patterns) |
| 44 | + "RET" # flake8-return (consistent return statements) |
18 | 45 |
|
19 | | -extend-exclude = [ |
20 | | - "**/__pycache__", |
21 | | - "/.*", |
22 | | - "bazel-*", |
23 | | - ".venv*/**", |
| 46 | + # FIXME: |
| 47 | + # "W", # pycodestyle warnings |
| 48 | + # "N", # pep8-naming |
| 49 | + # "C4", # flake8-comprehensions |
| 50 | + # "TCH", # flake8-type-checking |
| 51 | + # "TID", # flake8-tidy-imports |
| 52 | + # "RUF", # ruff-specific rules |
| 53 | + # "PT", # flake8-pytest-style |
| 54 | + # "PIE", # flake8-pie |
| 55 | + # "T20", # flake8-print |
| 56 | + # "RSE", # flake8-raise |
| 57 | +] |
| 58 | +ignore = [ |
| 59 | + "E501", # line too long (handled by formatter) |
| 60 | + "T201", # allow print() globally for CLI friendliness |
| 61 | + "RET505", # opinionated decision: allow else after if-return for readability |
24 | 62 | ] |
| 63 | + |
| 64 | + |
| 65 | +[tool.ruff.lint.isort] |
| 66 | +combine-as-imports = true |
| 67 | + |
| 68 | +[tool.ruff.lint.per-file-ignores] |
| 69 | +"tests/**" = [ |
| 70 | + "S101", # assert used |
| 71 | +] |
| 72 | + |
| 73 | + |
25 | 74 | [tool.pytest.ini_options] |
26 | 75 | log_cli = true |
27 | 76 | log_cli_level = "Debug" |
|
0 commit comments