Enable strict type checking for Pyright

Doc: https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-diagnostics-settings

PR #23634.
This commit is contained in:
Chocobo1
2025-12-22 12:14:38 +08:00
committed by GitHub
parent e79be5853e
commit ae7cc7445b
2 changed files with 6 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
# VERSION: 1.50
# VERSION: 1.51
# Author:
# Fabien Devaux <fab AT gnux DOT info>
@@ -61,7 +61,7 @@ THREADED: bool = True
try:
MAX_THREADS: int = cpu_count()
except NotImplementedError:
MAX_THREADS = 1
MAX_THREADS = 1 # pyright: ignore[reportConstantRedefinition]
Category = Enum('Category', ['all', 'anime', 'books', 'games', 'movies', 'music', 'pictures', 'software', 'tv'])
@@ -106,7 +106,7 @@ def list_engines() -> list[EngineModuleName]:
Return list of all engines' module name
"""
names = []
names: list[EngineModuleName] = []
for engine_path in glob(path.join(path.dirname(__file__), 'engines', '*.py')):
engine_module_name = path.basename(engine_path).split('.')[0].strip()

View File

@@ -21,5 +21,8 @@ dev = [
explicit_package_bases = true
strict = true
[tool.pyright]
typeCheckingMode = "strict"
[tool.setuptools.packages.find]
where = ["./"]