Skip to content

Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.

feat(ci): enforce ruff via GitHub Actions (#1372)

iot-rocket5e58ef913d5b
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 00000000..958736ea
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,40 @@
+name: Lint
+
+# ── Triggers ──────────────────────────────────────────────────────────────
+# pull_request has no branch filter on purpose: every PR is linted, and the
+# run executes against the merge preview (refs/pull/N/merge — the PR merged
+# into the latest base at run time), so the would-be merge result is checked,
+# not just the branch tip. merge_group gates the final merged state when a
+# merge queue is in use; push to main/master is the post-merge safety net.
+on:
+ push:
+ branches: [main, master]
+ pull_request:
+ merge_group:
+
+permissions:
+ contents: read
+
+jobs:
+ ruff:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: Set up Python
+ uses: actions/setup-python@v6
+ with:
+ python-version: "3.13"
+ cache: "pip"
+
+ # Pinned exactly (the dev extra only says ruff>=0.4) so CI results are
+ # reproducible; bumping the pin is a deliberate change.
+ - name: Install ruff
+ run: pip install ruff==0.16.2
+
+ # Canonical lint gate from CONTRIBUTING.md — scoped to ministack/
+ # (tests/ carries pre-existing violations tracked separately); config
+ # lives in [tool.ruff] in pyproject.toml. --output-format=github turns
+ # findings into inline PR annotations.
+ - name: ruff check
+ run: ruff check ministack/ --output-format=github