mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 00:47:21 -06:00
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:
@@ -1,4 +1,4 @@
|
|||||||
# VERSION: 1.50
|
# VERSION: 1.51
|
||||||
|
|
||||||
# Author:
|
# Author:
|
||||||
# Fabien Devaux <fab AT gnux DOT info>
|
# Fabien Devaux <fab AT gnux DOT info>
|
||||||
@@ -61,7 +61,7 @@ THREADED: bool = True
|
|||||||
try:
|
try:
|
||||||
MAX_THREADS: int = cpu_count()
|
MAX_THREADS: int = cpu_count()
|
||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
MAX_THREADS = 1
|
MAX_THREADS = 1 # pyright: ignore[reportConstantRedefinition]
|
||||||
|
|
||||||
Category = Enum('Category', ['all', 'anime', 'books', 'games', 'movies', 'music', 'pictures', 'software', 'tv'])
|
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
|
Return list of all engines' module name
|
||||||
"""
|
"""
|
||||||
|
|
||||||
names = []
|
names: list[EngineModuleName] = []
|
||||||
|
|
||||||
for engine_path in glob(path.join(path.dirname(__file__), 'engines', '*.py')):
|
for engine_path in glob(path.join(path.dirname(__file__), 'engines', '*.py')):
|
||||||
engine_module_name = path.basename(engine_path).split('.')[0].strip()
|
engine_module_name = path.basename(engine_path).split('.')[0].strip()
|
||||||
|
|||||||
@@ -21,5 +21,8 @@ dev = [
|
|||||||
explicit_package_bases = true
|
explicit_package_bases = true
|
||||||
strict = true
|
strict = true
|
||||||
|
|
||||||
|
[tool.pyright]
|
||||||
|
typeCheckingMode = "strict"
|
||||||
|
|
||||||
[tool.setuptools.packages.find]
|
[tool.setuptools.packages.find]
|
||||||
where = ["./"]
|
where = ["./"]
|
||||||
|
|||||||
Reference in New Issue
Block a user