Skip to content

Commit d117ba4

Browse files
Copy config from tooling
1 parent 3a40273 commit d117ba4

1 file changed

Lines changed: 40 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,58 @@
11
# This file is at the root level, as it applies to all Python code,
22
# not only to docs or to tools.
33
[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"
521

622
exclude = [
723
"**/__pycache__",
824
"**/.*",
925
"**/bazel-*",
10-
".venv*/**",
1126
]
1227

1328
venvPath = "."
1429
venv = ".venv_docs"
1530

1631
[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
1934
extend-exclude = [
35+
"__pycache__",
36+
".*",
37+
"bazel-*",
2038
"**/__pycache__",
2139
"/.*",
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.
2458
]

0 commit comments

Comments
 (0)