File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# Vendored tree-sitter grammars — machine-generated, hide from stats and diffs
66internal /cbm /vendored /grammars /** /parser.c linguist-generated =true diff =false
77internal /cbm /vendored /grammars /** /scanner.c linguist-generated =true diff =false
8+
9+ # Shell entrypoints must check out LF everywhere: a CRLF shebang line breaks
10+ # them under WSL/MSYS (`bash\r: no such file`). The *.sh rule covers scripts;
11+ # the git hooks are extensionless and need explicit entries. (#1272)
12+ scripts /git-hooks /commit-msg text eol =lf
13+ scripts /hooks /pre-commit text eol =lf
Original file line number Diff line number Diff line change @@ -260,6 +260,9 @@ bash "$ROOT/tests/test_release_gate_chain_contract.sh"
260260echo " === Step 0t: test runtime isolation contract (#1691) ==="
261261bash " $ROOT /tests/test_runtime_isolation_contract.sh"
262262
263+ echo " === Step 0u: shell line-ending contract ==="
264+ bash " $ROOT /tests/test_shell_line_endings.sh"
265+
263266# Verify compiler supports target arch
264267verify_compiler " $CC "
265268
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Regression guard: shell entrypoints must remain LF in Windows checkouts so
3+ # they can run directly from WSL and MSYS without a `bash\r` shebang failure.
4+ #
5+ # Distilled from PR #1272 by @xumian520, who both hit the breakage under
6+ # core.autocrlf=true and wrote this contract so it stays fixed. The .sh rule
7+ # itself landed via #1314; the extensionless git hooks need their own
8+ # entries, which this guard also covers.
9+
10+ set -euo pipefail
11+
12+ ROOT=" $( cd " $( dirname " $0 " ) /.." && pwd) "
13+ cd " $ROOT "
14+
15+ failures=0
16+ checked=0
17+ while IFS= read -r -d ' ' path &&
18+ IFS= read -r -d ' ' attribute &&
19+ IFS= read -r -d ' ' eol; do
20+ checked=$(( checked + 1 ))
21+ if [[ " $eol " != " lf" ]]; then
22+ echo " FAIL: $path must declare eol=lf (got ${eol:- unset} )" >&2
23+ failures=$(( failures + 1 ))
24+ fi
25+ done < <(
26+ git ls-files -z ' *.sh' ' scripts/git-hooks/*' ' scripts/hooks/*' |
27+ git check-attr -z --stdin eol
28+ )
29+
30+ if (( checked == 0 )) ; then
31+ echo " FAIL: the line-ending contract matched no files — the glob set is broken" >&2
32+ exit 1
33+ fi
34+
35+ if (( failures > 0 )) ; then
36+ echo " FAIL: $failures shell entrypoint(s) lack an LF checkout contract" >&2
37+ exit 1
38+ fi
39+
40+ echo " Shell line-ending contract passed ($checked files)"
You can’t perform that action at this time.
0 commit comments