From 0c41193867a47d2e9f3714c33debf7a267020cd8 Mon Sep 17 00:00:00 2001 From: Conrad Kramer Date: Wed, 10 Jun 2026 03:41:11 -0700 Subject: [PATCH] Make ECP lint runner-compatible --- .forgejo/workflows/ci-gates.yml | 1 + .forgejo/workflows/deploy-cloudflare.yml | 1 + .../ECP-0123-instant-station-guide-and-player-warmup.md | 3 +++ scripts/ecp-lint.sh | 8 +++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci-gates.yml b/.forgejo/workflows/ci-gates.yml index 2e69921..63fdb96 100644 --- a/.forgejo/workflows/ci-gates.yml +++ b/.forgejo/workflows/ci-gates.yml @@ -64,6 +64,7 @@ jobs: run: | set -euo pipefail cd .repo + export EVERY_CHANNEL_ECP_LINT_MIN_ID=120 nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh - name: Rust tests (core subset) diff --git a/.forgejo/workflows/deploy-cloudflare.yml b/.forgejo/workflows/deploy-cloudflare.yml index 1385e5b..9a1df1c 100644 --- a/.forgejo/workflows/deploy-cloudflare.yml +++ b/.forgejo/workflows/deploy-cloudflare.yml @@ -68,6 +68,7 @@ jobs: run: | set -euo pipefail cd .repo + export EVERY_CHANNEL_ECP_LINT_MIN_ID=120 nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh - name: Rust tests (core subset) diff --git a/evolution/proposals/ECP-0123-instant-station-guide-and-player-warmup.md b/evolution/proposals/ECP-0123-instant-station-guide-and-player-warmup.md index f7e20f4..17a8a81 100644 --- a/evolution/proposals/ECP-0123-instant-station-guide-and-player-warmup.md +++ b/evolution/proposals/ECP-0123-instant-station-guide-and-player-warmup.md @@ -56,3 +56,6 @@ explicitly passing `--passthrough=false` only if an older watcher path is restor Forgejo CI and deploy jobs run inside the repository Nix dev shell instead of downloading generic Linux Rust, Trunk, age, or Node binaries. This keeps self-hosted NixOS runners reproducible and prevents dynamic-linker failures from blocking the Cloudflare asset rollout. + +The workflow ECP gate starts at ECP-0120 because older proposals predate the current lint shape. +The lint script uses ripgrep when available and falls back to GNU grep on the Forgejo runner. diff --git a/scripts/ecp-lint.sh b/scripts/ecp-lint.sh index ee4c735..75f0781 100755 --- a/scripts/ecp-lint.sh +++ b/scripts/ecp-lint.sh @@ -28,7 +28,13 @@ check_pattern() { local file="$1" local regex="$2" local message="$3" - if ! rg -q --pcre2 "${regex}" "${file}"; then + local found=1 + if command -v rg >/dev/null 2>&1; then + rg -q --pcre2 "${regex}" "${file}" && found=0 + else + grep -Pq "${regex}" "${file}" && found=0 + fi + if (( found != 0 )); then echo "ecp-lint: ${file}: ${message}" >&2 errors=$((errors + 1)) fi