Add Type Checker In CI

This commit is contained in:
Arbion Halili
2025-06-17 05:46:08 +01:00
parent ac2dfa6565
commit e2508f3419
2 changed files with 58 additions and 1 deletions

38
.github/workflows/type-check.yml vendored Normal file
View File

@@ -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

View File

@@ -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" }
test = { shell = "pytest master worker shared", help = "Run the tests" }
check = { shell = "basedpyright --project .", help = "Run type checker" }