|
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 | | - |
5 | 1 | { |
6 | 2 | "include": [ |
7 | 3 | "src", |
|
21 | 17 | ".coverage", |
22 | 18 | "rust" |
23 | 19 | ], |
24 | | - // Path to search for virtual environments relative to this config file. |
25 | | - // "." searches in the current directory and subdirectories (like .venv). |
26 | 20 | "venvPath": ".", |
27 | | - // Name of the default virtual environment directory to search within venvPath. |
28 | | - // UV's default is ".venv" relative to the project root. |
29 | 21 | "venv": ".venv", |
30 | | - // Execution environments help map source paths to target Python versions/extra paths. |
31 | 22 | "executionEnvironments": [ |
32 | 23 | { |
33 | | - // Analyze source code within the 'src' directory |
34 | 24 | "root": "src", |
35 | | - "pythonVersion": "{{ cookiecutter.python_version }}", |
36 | | - // Paths to add to sys.path for analysis within this environment |
37 | 25 | "extraPaths": [] |
38 | 26 | }, |
39 | 27 | { |
40 | 28 | "root": "tests", |
41 | | - "pythonVersion": "{{ cookiecutter.python_version }}", |
42 | 29 | "extraPaths": [] |
43 | 30 | } |
44 | 31 | ], |
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. |
50 | 32 | "reportMissingImports": true, |
51 | | - // Flag imports Pyright cannot find |
52 | 33 | "reportMissingTypeStubs": true, |
53 | | - // Flag imported libraries without type stubs |
54 | 34 |
|
55 | 35 | "reportGeneralTypeIssues": "warning", |
56 | | - // Warn about common type problems |
57 | 36 | "reportPropertyTypeMismatch": "warning", |
58 | | - // Warn if getter/setter types don't align |
59 | 37 | "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", |
84 | 42 | "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) |
94 | 43 | } |
0 commit comments