architecture-harness 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,12 +7,14 @@ set -euo pipefail
7
7
  # Runs before the extension filter below: a work order's own branch is checked regardless of
8
8
  # what kind of file it touches, so a commit of .tf/.yml/.md files is covered too.
9
9
  npx qc work-order-check || exit 1
10
- STAGED=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(ts|tsx|mjs)$' || true)
11
- [ -z "$STAGED" ] && exit 0
10
+ # The staged list is NUL-separated in a file, never in an argument: a large merge commit would
11
+ # pass the command-line limit of npx.cmd on Windows (8191 characters).
12
+ STAGED=$(mktemp)
13
+ trap 'rm -f "$STAGED"' EXIT
14
+ git diff --cached --name-only -z --diff-filter=ACM | grep -zE '\.(ts|tsx|mjs)$' > "$STAGED" || true
15
+ [ -s "$STAGED" ] || exit 0
12
16
  # `--no-warn-ignored`: a staged file the config ignores is a decision, not a finding, and
13
17
  # without it a generated file turns "I ignored that" into a warning that fails the gate.
14
- npx eslint $STAGED --max-warnings 0 --no-warn-ignored
18
+ xargs -0 -n 20 npx eslint --max-warnings 0 --no-warn-ignored < "$STAGED"
15
19
  npx tsc -b --pretty false
16
- for file in $STAGED; do
17
- npx qc check "$file"
18
- done
20
+ npx qc check --files-from - < "$STAGED"