chore: add pre-push hook (check + test) and fix lint-log-tags for macOS

This commit is contained in:
2026-05-15 09:11:01 +08:00
parent 153178c545
commit 15edc99c72
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -1,6 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# pre-push hook: typecheck + biome + lint-log-tags
set -euo pipefail set -euo pipefail
echo "🔍 pre-push: running checks..."
echo "🔍 Running check (tsc + biome + lint-log-tags)..."
bun run check bun run check
echo "✅ pre-push: all checks passed"
echo "🧪 Running tests..."
bun run test
echo "✅ All checks passed!"
+1 -1
View File
@@ -10,7 +10,7 @@ while IFS= read -r match; do
file="${match%%:*}" file="${match%%:*}"
rest="${match#*:}" rest="${match#*:}"
line="${rest%%:*}" 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 if echo "$tag" | grep -qiE '[ILOU]'; then
echo "${file}:${line} tag \"${tag}\" contains invalid Crockford Base32 char (I/L/O/U)" echo "${file}:${line} tag \"${tag}\" contains invalid Crockford Base32 char (I/L/O/U)"
BAD=1 BAD=1