[object Object]

← back to Exo

Add Type Checker In CI

e2508f3419e19c6dbbb8ff714b3cb2eb83c448d5 · 2025-06-17 05:46:08 +0100 · Arbion Halili

Files touched

Diff

commit e2508f3419e19c6dbbb8ff714b3cb2eb83c448d5
Author: Arbion Halili <99731180+ToxicPine@users.noreply.github.com>
Date:   Tue Jun 17 05:46:08 2025 +0100

    Add Type Checker In CI
---
 .github/workflows/type-check.yml | 38 ++++++++++++++++++++++++++++++++++++++
 pyproject.toml                   | 21 ++++++++++++++++++++-
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/type-check.yml b/.github/workflows/type-check.yml
new file mode 100644
index 00000000..eb2289e0
--- /dev/null
+++ b/.github/workflows/type-check.yml
@@ -0,0 +1,38 @@
+name: type-check
+
+on:
+  push:
+    branches:
+      - staging
+      - main
+  pull_request:
+    branches:
+      - staging
+      - main
+
+jobs:
+  typecheck:
+    runs-on: ubuntu-22.04
+
+    permissions:
+      contents: read
+
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+
+      - name: Install uv
+        uses: astral-sh/setup-uv@v6
+        with:
+          enable-cache: true
+          cache-dependency-glob: uv.lock
+
+      - name: Install Python
+        run: uv python install
+
+      - name: Sync dependencies
+        run: uv sync --locked --all-extras --dev
+
+      - name: Run type checker
+        run: uv run poe check
diff --git a/pyproject.toml b/pyproject.toml
index 509c88a5..b5717689 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -8,6 +8,7 @@ dependencies = []
 
 [dependency-groups]
 dev = [
+    "basedpyright>=1.29.4",
     "poethepoet>=0.35.0",
     "pytest>=8.4.0",
     "ruff>=0.11.13",
@@ -18,6 +19,24 @@ members = [
     "master", "worker", "shared",
 ]
 
+[tool.basedpyright] 
+typeCheckingMode = "strict"
+failOnWarnings = true 
+
+reportAny = "error"
+reportUnknownVariableType = "error"
+reportUnknownParameterType = "error"
+reportMissingParameterType = "error"
+reportMissingTypeStubs = "error"
+reportInvalidCast = "error"
+reportUnnecessaryCast = "error"
+reportUnnecessaryTypeIgnoreComment = "error"
+
+include = ["master", "worker", "shared", "engines/*"]
+pythonVersion  = "3.13"
+pythonPlatform = "Darwin"
+
 [tool.poe.tasks]
 fmt = { shell = "ruff format .", help = "Format the code" }
-test = { shell = "pytest master worker shared", help = "Run the tests" }
\ No newline at end of file
+test = { shell = "pytest master worker shared", help = "Run the tests" }
+check = { shell = "basedpyright --project .", help = "Run type checker" }
\ No newline at end of file

← ac2dfa65 Initial Structure  ·  back to Exo  ·  Add Formatter To CI 090265a3 →