mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 05:12:15 +00:00
fix(hooks): skip full gate for docs-only commits
This commit is contained in:
@@ -38,6 +38,18 @@ while IFS= read -r -d '' file; do
|
||||
format_files+=("$file")
|
||||
done < <(node "$FILTER_FILES" format -- "${files[@]}")
|
||||
|
||||
docs_only=true
|
||||
for file in "${files[@]}"; do
|
||||
case "$file" in
|
||||
docs/*|*.md|*.mdx)
|
||||
;;
|
||||
*)
|
||||
docs_only=false
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "${#lint_files[@]}" -gt 0 ]; then
|
||||
"$RUN_NODE_TOOL" oxlint --type-aware --fix -- "${lint_files[@]}"
|
||||
fi
|
||||
@@ -58,7 +70,11 @@ if [[ -f "$ROOT_DIR/package.json" ]] && [[ -f "$ROOT_DIR/pnpm-lock.yaml" ]]; the
|
||||
echo "FAST_COMMIT enabled: skipping pnpm check in pre-commit hook."
|
||||
;;
|
||||
*)
|
||||
pnpm check
|
||||
if [[ "$docs_only" == true ]]; then
|
||||
echo "Docs-only staged changes detected: skipping pnpm check in pre-commit hook."
|
||||
else
|
||||
pnpm check
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user