From 15edc99c7284a44c540c74d2e38b5e375c4e58f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=9C=88?= Date: Fri, 15 May 2026 09:11:01 +0800 Subject: [PATCH] chore: add pre-push hook (check + test) and fix lint-log-tags for macOS --- .githooks/pre-push | 10 +++++++--- scripts/lint-log-tags.sh | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index e824202..09631c9 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,6 +1,10 @@ #!/usr/bin/env bash -# pre-push hook: typecheck + biome + lint-log-tags set -euo pipefail -echo "๐Ÿ” pre-push: running checks..." + +echo "๐Ÿ” Running check (tsc + biome + lint-log-tags)..." bun run check -echo "โœ… pre-push: all checks passed" + +echo "๐Ÿงช Running tests..." +bun run test + +echo "โœ… All checks passed!" diff --git a/scripts/lint-log-tags.sh b/scripts/lint-log-tags.sh index 64f092f..3b3700a 100755 --- a/scripts/lint-log-tags.sh +++ b/scripts/lint-log-tags.sh @@ -10,7 +10,7 @@ while IFS= read -r match; do file="${match%%:*}" rest="${match#*:}" line="${rest%%:*}" - tag=$(echo "$rest" | grep -oP '\.log\(\s*"\K[A-Za-z0-9]+') + tag=$(echo "$rest" | sed -n 's/.*\.log( *"\([A-Za-z0-9]*\)".*/\1/p') if echo "$tag" | grep -qiE '[ILOU]'; then echo " โŒ ${file}:${line} tag \"${tag}\" contains invalid Crockford Base32 char (I/L/O/U)" BAD=1