Skip to content

Commit 0499a05

Browse files
committed
chore: trim down pyrightconfig.json
1 parent a5601a9 commit 0499a05

File tree

1 file changed

+4
-55
lines changed

1 file changed

+4
-55
lines changed
Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// pyrightconfig.json
2-
// See https://github.com/microsoft/pyright/blob/main/docs/configuration.md
3-
// This file configures the Pyright static type checker.
4-
51
{
62
"include": [
73
"src",
@@ -21,74 +17,27 @@
2117
".coverage",
2218
"rust"
2319
],
24-
// Path to search for virtual environments relative to this config file.
25-
// "." searches in the current directory and subdirectories (like .venv).
2620
"venvPath": ".",
27-
// Name of the default virtual environment directory to search within venvPath.
28-
// UV's default is ".venv" relative to the project root.
2921
"venv": ".venv",
30-
// Execution environments help map source paths to target Python versions/extra paths.
3122
"executionEnvironments": [
3223
{
33-
// Analyze source code within the 'src' directory
3424
"root": "src",
35-
"pythonVersion": "{{ cookiecutter.python_version }}",
36-
// Paths to add to sys.path for analysis within this environment
3725
"extraPaths": []
3826
},
3927
{
4028
"root": "tests",
41-
"pythonVersion": "{{ cookiecutter.python_version }}",
4229
"extraPaths": []
4330
}
4431
],
45-
// === Reporting Severity Levels ===
46-
// Control severity for different types of issues (error, warning, information, ignore)
47-
// Change these to "error" once you have addressed issues in your project for stricter enforcement.
48-
49-
// Reporting level for basic type issues.
5032
"reportMissingImports": true,
51-
// Flag imports Pyright cannot find
5233
"reportMissingTypeStubs": true,
53-
// Flag imported libraries without type stubs
5434

5535
"reportGeneralTypeIssues": "warning",
56-
// Warn about common type problems
5736
"reportPropertyTypeMismatch": "warning",
58-
// Warn if getter/setter types don't align
5937
"reportReturnTypeFromAnnotation": "warning",
60-
// Check consistency between return annotation and actual code path returns
61-
62-
// === Strictness Flags ===
63-
// Enabling "strict": true turns on a comprehensive set of strict type checking rules.
64-
// It's recommended to enable this once your project is well-typed for maximum safety.
65-
// It's equivalent to enabling all "report..." rules listed below.
66-
// "strict": true, # Uncomment and set to true for strict mode
67-
68-
// Alternatively, enable individual strict rules progressively:
69-
// "basic": true # Enables a moderate set of strict rules (often a good starting point before full strict)
70-
// See Pyright docs for descriptions of all strict rules:
71-
// https://github.com/microsoft/pyright/blob/main/docs/configuration.md#information-about-type-checking-rules
72-
73-
// Examples of strict rules included in "strict": true or "basic": true
74-
// "reportAny": "warning", # Disallows explicit or implicit use of 'Any'
75-
// "reportUndefinedVariable": "error", # Required. Flags uses of variables before assignment.
76-
// "reportUnusedImport": "warning", # Flags unused imports (also caught by Ruff).
77-
// "reportUnusedVariable": "warning", # Flags unused variables (also caught by Ruff).
78-
// "reportMissingParameterType": "warning",# Flags function parameters missing type annotations
79-
// "reportMissingReturnType": "warning", # Flags functions missing return type annotations
80-
// "reportOptionalOperand": "warning", # Flags operations on potentially None values
81-
82-
// --- Other Configuration ---
83-
// Set the python version explicitly for analysis context
38+
"reportMissingReturnType": "warning",
39+
"basic": true,
40+
"reportMissingParameterType": "warning",
41+
"reportOptionalOperand": "warning",
8442
"pythonVersion": "{{ cookiecutter.python_version }}"
85-
86-
// Set the python platform explicitly if cross-platform analysis is needed (less common for typical projects)
87-
// "pythonPlatform": "Linux", # "Linux", "Darwin" (macOS), "Windows"
88-
89-
// Define custom typeshed paths if needed
90-
// "typeshedPath": "path/to/typeshed",
91-
92-
// Specify a minimum threshold of confidence for inferred types (advanced)
93-
// "analyzeUnannotatedFunctions": true, # Analyze functions even if not annotated (part of basic)
9443
}

0 commit comments

Comments
 (0)