mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-25 07:42:20 +10:00
fix(lefthook): run the conflict-marker check on Windows (#3320)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
6c1280dca9
commit
118f3679a3
+12
-5
@@ -9,13 +9,20 @@ pre-commit:
|
|||||||
exclude:
|
exclude:
|
||||||
- "*.md"
|
- "*.md"
|
||||||
- "*.mdx"
|
- "*.mdx"
|
||||||
|
# Single quotes only: on Windows the script is truncated at the first double quote, which
|
||||||
|
# leaves the shell with an unterminated command and fails the job on every commit.
|
||||||
|
# grep exits 1 for a clean tree and 2 on error, so the statuses are handled separately —
|
||||||
|
# an unreadable path must fail the job rather than read as no markers found.
|
||||||
run: |
|
run: |
|
||||||
matches=$(grep -nEI '<{7} |>{7} |^={7}$' {staged_files} || true)
|
grep -nEI '<{7} |>{7} |^={7}$' {staged_files}
|
||||||
if [ -n "$matches" ]; then
|
status=$?
|
||||||
echo "$matches"
|
if [ $status -eq 1 ]; then
|
||||||
echo "Error: merge conflict markers found in staged files"
|
exit 0
|
||||||
exit 1
|
elif [ $status -ne 0 ]; then
|
||||||
|
exit $status
|
||||||
fi
|
fi
|
||||||
|
echo 'Error: merge conflict markers found in staged files'
|
||||||
|
exit 1
|
||||||
- name: lint and format
|
- name: lint and format
|
||||||
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
|
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
|
||||||
run: pnpm biome check --write --unsafe --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
|
run: pnpm biome check --write --unsafe --no-errors-on-unmatched --files-ignore-unknown=true {staged_files}
|
||||||
|
|||||||
Reference in New Issue
Block a user