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.
- package/package.json +1 -1
- package/src/cli/bash-command-guard.mjs +60 -11
- package/src/cli/bash-command-guard.test.mjs +66 -0
- package/src/cli/check-input.mjs +24 -0
- package/src/cli/check.mjs +2 -2
- package/src/cli/cli.test.mjs +50 -1
- package/src/cli/init.mjs +12 -0
- package/src/cli/merge-guard.mjs +4 -0
- package/src/cli/merge-guard.test.mjs +21 -2
- package/src/cli/powershell-command.mjs +1 -1
- package/src/cli/qc.mjs +9 -4
- package/src/cli/run-dispatch.mjs +2 -2
- package/src/cli/run.test.mjs +24 -0
- package/src/cli/workflow-hooks.test.mjs +1 -0
- package/src/cli/worktree-gate.mjs +117 -0
- package/src/cli/worktree-gate.test.mjs +152 -0
- package/src/cli/worktree-settings.mjs +27 -0
- package/src/cli/worktree.mjs +60 -21
- package/src/cli/worktree.test.mjs +106 -7
- package/src/config.mjs +8 -1
- package/src/eslint/preset.mjs +2 -2
- package/src/eslint/preset.test.mjs +4 -2
- package/src/gates/sql-identifiers.mjs +11 -3
- package/src/gates/sql-identifiers.test.mjs +39 -0
- package/templates/.jscpd.json +1 -0
- package/templates/docs/decisions.md +1 -0
- package/templates/docs/enforcement.md +10 -0
- package/templates/githooks/pre-commit +8 -6
|
@@ -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
|
-
|
|
11
|
-
|
|
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
|
|
18
|
+
xargs -0 -n 20 npx eslint --max-warnings 0 --no-warn-ignored < "$STAGED"
|
|
15
19
|
npx tsc -b --pretty false
|
|
16
|
-
|
|
17
|
-
npx qc check "$file"
|
|
18
|
-
done
|
|
20
|
+
npx qc check --files-from - < "$STAGED"
|