From 2ca3d2f0212af73d0e5b423cab8bef279a8ed44e Mon Sep 17 00:00:00 2001 From: David Kiania Date: Sun, 12 Apr 2026 21:32:33 +0300 Subject: [PATCH] ci: add ruff + mypy static analysis config and Forgejo workflow --- .forgejo/workflows/ci-static.yml | 23 +++++++++++++++++++++++ pyproject.toml | 22 +++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/ci-static.yml diff --git a/.forgejo/workflows/ci-static.yml b/.forgejo/workflows/ci-static.yml new file mode 100644 index 0000000..d4e2c92 --- /dev/null +++ b/.forgejo/workflows/ci-static.yml @@ -0,0 +1,23 @@ +name: Static Analysis + +on: [push, pull_request] + +jobs: + static: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - name: Install Python + run: pip install ruff mypy psycopg2-binary requests fastapi uvicorn python-multipart + + - name: Lint with ruff + run: ruff check . + + - name: Type check with mypy + run: > + mypy + ts_shared_rev.py + ingest_movement_rev.py + ingest_events_rev.py + webhook_receiver_rev.py diff --git a/pyproject.toml b/pyproject.toml index bf0b6a8..94193b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,4 +27,24 @@ build-backend = "hatchling.build" managed = true [tool.uv.sources] -# Optional: If you ever have custom local modules or git-based private libs \ No newline at end of file +# Optional: If you ever have custom local modules or git-based private libs + +[project.optional-dependencies] +dev = [ + "ruff>=0.4", + "mypy>=1.10", + "pytest>=8", + "pytest-asyncio>=0.23", + "httpx>=0.27", +] + +[tool.ruff] +target-version = "py312" +line-length = 100 +select = ["E", "W", "F", "B", "UP", "SIM"] + +[tool.mypy] +python_version = "3.12" +warn_return_any = true +warn_unused_ignores = true +ignore_missing_imports = true \ No newline at end of file