cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

44cb7ee485744ed7e22fe1b1bd31d4e8cead238a

unsigned

author: Christian Cleberg <hello@cleberg.net> · 2026-08-22T03:38:58Z

Check ruff in CI as well as the build

build.py runs 'ruff check --fix' and 'ruff format' on development builds, but CI
builds with ENV=prod, which skips them — so nothing was checking lint
automatically. These are the verifying forms of the same two commands against
the same ruff.toml: --no-fix and --check, because CI should report on the tree
rather than rewrite it.

Its own job, so a lint failure and a broken page stay distinct signals. ruff is
pinned for the same reason orgo is: a new release should add rules on your
schedule, not in the middle of an unrelated PR.
 .github/workflows/build.yml | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 850b316..a0444f4 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -9,12 +9,34 @@ permissions:
   contents: read
 
 env:
+  # Pinned so a new ruff release adds rules on your schedule, not mid-PR.
+  RUFF_VERSION: "0.16.4"
   # orgo is installed from crates.io, so nothing bumps this automatically —
   # dependabot does not see `cargo install` in a workflow. Raise it by hand when
   # a new orgo lands, which is also how you find out orgo broke the site.
   ORGO_VERSION: "0.22.0"
 
 jobs:
+  # Separate from the build so a lint failure and a broken page are distinct
+  # signals. build.py runs `ruff check --fix` and `ruff format` on development
+  # builds; these are the verifying forms of the same two commands, reading
+  # the same ruff.toml, so CI cannot disagree with a local dev build.
+  lint:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v7
+
+      - name: Install ruff
+        run: pipx install "ruff==$RUFF_VERSION"
+
+      - name: Lint
+        run: |
+          ruff --version
+          ruff check --no-fix
+
+      - name: Format
+        run: ruff format --check --diff
+
   build:
     runs-on: ubuntu-latest
     steps: