Skip to content

Commit 02f882e

Browse files
basedpyright: add configuration
1 parent 30bf208 commit 02f882e

3 files changed

Lines changed: 35 additions & 39 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,3 +451,5 @@ $RECYCLE.BIN/
451451
# Profiling
452452
*.prof.txt
453453
*.speedscope.json
454+
455+
!pyrightconfig.json

pyproject.toml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,6 @@ dev = [
3333
"basedpyright>=1.34.0",
3434
]
3535

36-
[tool.pyright]
37-
venvPath = "."
38-
venv = ".venv"
39-
typeCheckingMode = "standard"
40-
pythonVersion = "3.10"
41-
reportMissingTypeStubs = true
42-
# mypy catches this, so catch it in pyright too
43-
reportOptionalMemberAccess = true
44-
# Sensible signal without being punitive; tune severities as needed
45-
reportUnusedImport = "error"
46-
reportUnusedVariable = "error"
47-
reportUnknownMemberType = "warning"
48-
reportUnknownArgumentType = "warning"
49-
reportUnknownVariableType = "warning"
50-
reportPrivateUsage = "error"
51-
# Keep false positives low in typical library code
52-
useLibraryCodeForTypes = true
53-
# Project layout
54-
include = ["src", "tests"]
55-
exclude = [
56-
"**/.venv",
57-
"build",
58-
"dist",
59-
"scripts",
60-
"examples",
61-
"docs",
62-
]
63-
64-
[[tool.pyright.executionEnvironments]]
65-
root = "src"
66-
67-
[[tool.pyright.executionEnvironments]]
68-
root = "tests"
69-
typeCheckingMode = "basic"
70-
reportUnknownMemberType = "none"
71-
reportUnknownArgumentType = "none"
72-
reportUnknownVariableType = "none"
73-
reportPrivateUsage = "none"
74-
7536
[tool.pytest.ini_options]
7637
minversion = "7.4"
7738
testpaths = ["tests"]

pyrightconfig.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"include": ["src", "tests"],
3+
"exclude": [
4+
"**/.venv",
5+
"build",
6+
"dist",
7+
"scripts",
8+
"examples",
9+
"docs",
10+
"**/node_modules",
11+
"**/__pycache__"
12+
],
13+
"pythonVersion": "3.10",
14+
"reportImplicitStringConcatenation": "none",
15+
"executionEnvironments": [
16+
{
17+
"root": "src"
18+
},
19+
{
20+
"root": "tests",
21+
"reportAny": "none",
22+
"reportExplicitAny": "none",
23+
"reportUnknownLambdaType": "none",
24+
"reportUnknownMemberType": "none",
25+
"reportArgumentType": "none",
26+
"reportUnknownArgumentType": "none",
27+
"reportUnknownVariableType": "none",
28+
"reportPrivateUsage": "none",
29+
"reportUnusedCallResult": "none",
30+
"reportPrivateLocalImportUsage": "none"
31+
}
32+
]
33+
}

0 commit comments

Comments
 (0)