Make ECP lint runner-compatible
This commit is contained in:
parent
d7f76d6ab2
commit
0c41193867
4 changed files with 12 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue