File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ For projects using pyright you can enable strict mode for stricter than normal t
44
55## Configuration
66
7- Add the ` strict ` line to ` pyproject.toml ` as follows:
7+ Change the ` typeCheckingMode ` line to ` "strict" ` in ` pyproject.toml ` as follows:
88
99``` toml
1010[tool .pyright ]
11- strict = [ " src " , " tests " ]
11+ typeCheckingMode = " strict "
1212reportMissingImports = false # Ignore missing stubs in imported modules
1313```
1414
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ name = "{{ author_name }}"
5252version_file = "src/{{ package_name }}/_version.py"
5353{% if type_checker =="pyright" %}
5454[tool.pyright]
55+ typeCheckingMode = "standard"
5556reportMissingImports = false # Ignore missing stubs in imported modules
5657{% endif %}{% if type_checker =="mypy" %}
5758[tool.mypy]
Original file line number Diff line number Diff line change @@ -157,7 +157,8 @@ def test_works_in_pyright_strict_mode(tmp_path: Path):
157157
158158 # Enable strict mode
159159 run_pipe (
160- f'sed -i \' /\\ [tool.pyright\\ ]/a\\ strict = ["src", "tests"]\' { pyproject_toml } '
160+ 'sed -i \' s|typeCheckingMode = "standard"|typeCheckingMode = "strict"|\' '
161+ f" { pyproject_toml } "
161162 )
162163
163164 # Ensure pyright is still happy
You can’t perform that action at this time.
0 commit comments