Make ECP lint runner-compatible
This commit is contained in:
parent
d7f76d6ab2
commit
0c41193867
4 changed files with 12 additions and 1 deletions
|
|
@ -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