Make ECP lint runner-compatible
Some checks failed
ci-gates / checks (push) Failing after 1m41s
deploy-cloudflare / checks (push) Successful in 1m58s
deploy-cloudflare / deploy (push) Failing after 6s

This commit is contained in:
Conrad Kramer 2026-06-10 03:41:11 -07:00
parent d7f76d6ab2
commit 0c41193867
No known key found for this signature in database
4 changed files with 12 additions and 1 deletions

View file

@ -64,6 +64,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
cd .repo cd .repo
export EVERY_CHANNEL_ECP_LINT_MIN_ID=120
nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh
- name: Rust tests (core subset) - name: Rust tests (core subset)

View file

@ -68,6 +68,7 @@ jobs:
run: | run: |
set -euo pipefail set -euo pipefail
cd .repo cd .repo
export EVERY_CHANNEL_ECP_LINT_MIN_ID=120
nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh nix develop --accept-flake-config -c bash ./scripts/ecp-lint.sh
- name: Rust tests (core subset) - name: Rust tests (core subset)

View file

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

View file

@ -28,7 +28,13 @@ check_pattern() {
local file="$1" local file="$1"
local regex="$2" local regex="$2"
local message="$3" 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 echo "ecp-lint: ${file}: ${message}" >&2
errors=$((errors + 1)) errors=$((errors + 1))
fi fi