summaryrefslogtreecommitdiffstats
path: root/__builtins__.pyi
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2024-09-08 15:33:07 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2024-09-08 18:48:05 +0200
commite7d08d7645dfbd5bff2eed98298012037231c173 (patch)
treef1344077954d621812af2578febf59d3ffd379bf /__builtins__.pyi
parent[Lint] Replace black/flake8/isort with ruff (diff)
downloaddeluge-e7d08d7645dfbd5bff2eed98298012037231c173.tar.xz
deluge-e7d08d7645dfbd5bff2eed98298012037231c173.zip
[Typing] Add pyright config to suppress warnings
VSCode uses pylance/pyright, a performant type checker. So setup the builtins used by Deluge and set missing imports to informational due to OS-specific imports. It might be possible using extraPaths with extra stubs or use defineConstants to make pyright not check Windows or Macos conditional paths but that would require changing all usage so leaving for another time. Refs: https://github.com/microsoft/pyright/blob/main/docs/configuration.md Refs: https://github.com/microsoft/pyright/blob/main/docs/builtins.md
Diffstat (limited to '__builtins__.pyi')
-rw-r--r--__builtins__.pyi6
1 files changed, 6 insertions, 0 deletions
diff --git a/__builtins__.pyi b/__builtins__.pyi
new file mode 100644
index 000000000..d03460554
--- /dev/null
+++ b/__builtins__.pyi
@@ -0,0 +1,6 @@
+from twisted.web.http import Request
+
+__request__: Request
+
+def _(string: str) -> str: ...
+def _n(string: str) -> str: ...