@windyroad/style-guide 0.5.1-preview.1014 → 0.5.2-preview.1058
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/.claude-plugin/plugin.json +1 -1
- package/package.json +3 -2
- package/hooks/test/slide-marker-on-subprocess-return.bats +0 -118
- package/hooks/test/style-guide-enforce-scope.bats +0 -75
- package/hooks/test/style-guide-eval-once-per-session.bats +0 -77
- package/hooks/test/style-guide-no-stop-hook.bats +0 -15
- package/hooks/test/style-guide-project-root.bats +0 -20
- package/hooks/test/substance-aware-drift.bats +0 -86
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windyroad/style-guide",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2-preview.1058",
|
|
4
4
|
"description": "Style guide enforcement for CSS and UI components",
|
|
5
5
|
"bin": {
|
|
6
6
|
"windyroad-style-guide": "./bin/install.mjs"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"hooks/",
|
|
25
25
|
"skills/",
|
|
26
26
|
".claude-plugin/",
|
|
27
|
-
"lib/"
|
|
27
|
+
"lib/",
|
|
28
|
+
"!hooks/test/"
|
|
28
29
|
]
|
|
29
30
|
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# Tests for slide_marker_on_subprocess_return helper (P111).
|
|
4
|
-
#
|
|
5
|
-
# Behavioural contract:
|
|
6
|
-
# - Slides an existing marker forward (touch) on PostToolUse:Agent|Bash
|
|
7
|
-
# completion, treating subprocess wall-clock as continuous parent-session
|
|
8
|
-
# work for TTL purposes.
|
|
9
|
-
# - Never CREATES a marker (creating requires a real gate review).
|
|
10
|
-
# - Skips slide on subprocess error (tool_response.is_error=true) so a failed
|
|
11
|
-
# subprocess does NOT extend the parent's trust window (ADR-009 amendment).
|
|
12
|
-
# - No-op when no marker exists or session_id is empty (fail-safe).
|
|
13
|
-
|
|
14
|
-
setup() {
|
|
15
|
-
HOOKS_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
16
|
-
source "$HOOKS_DIR/lib/gate-helpers.sh"
|
|
17
|
-
|
|
18
|
-
TEST_SESSION="bats-slide-$$-${BATS_TEST_NUMBER}"
|
|
19
|
-
MARKER="/tmp/architect-reviewed-${TEST_SESSION}"
|
|
20
|
-
rm -f "$MARKER"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
teardown() {
|
|
24
|
-
rm -f "$MARKER"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
# Helper: backdate file mtime by N seconds (portable between macOS and Linux)
|
|
28
|
-
_backdate() {
|
|
29
|
-
local file="$1" seconds="$2"
|
|
30
|
-
local stamp
|
|
31
|
-
stamp=$(date -v-${seconds}S +%Y%m%d%H%M.%S 2>/dev/null \
|
|
32
|
-
|| date -d "${seconds} seconds ago" +%Y%m%d%H%M.%S 2>/dev/null)
|
|
33
|
-
touch -t "$stamp" "$file"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@test "slide: existing marker is touched on success response" {
|
|
37
|
-
touch "$MARKER"
|
|
38
|
-
_backdate "$MARKER" 60
|
|
39
|
-
BEFORE=$(_mtime "$MARKER")
|
|
40
|
-
_HOOK_INPUT='{"tool_response":{"content":[]}}'
|
|
41
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
42
|
-
AFTER=$(_mtime "$MARKER")
|
|
43
|
-
[ "$AFTER" -gt "$BEFORE" ]
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@test "slide: long-running subprocess does NOT cause parent marker expiry on return (P111 reproduction)" {
|
|
47
|
-
# Simulate the P111 failure mode: parent's marker is set, then a long
|
|
48
|
-
# subprocess runs (we backdate the marker to simulate elapsed wall-clock),
|
|
49
|
-
# then PostToolUse fires with a successful tool_response. The marker mtime
|
|
50
|
-
# must be refreshed so the parent's NEXT PreToolUse gate check (which
|
|
51
|
-
# compares NOW - mtime against TTL) sees a fresh marker.
|
|
52
|
-
touch "$MARKER"
|
|
53
|
-
# Marker is 50 minutes old — under default 60-min TTL but close to expiry.
|
|
54
|
-
# Without the slide on subprocess return, a subsequent 15-min subprocess
|
|
55
|
-
# would push the mtime past TTL and the next PreToolUse would deny.
|
|
56
|
-
_backdate "$MARKER" 3000
|
|
57
|
-
BEFORE=$(_mtime "$MARKER")
|
|
58
|
-
_HOOK_INPUT='{"tool_response":{"content":[{"type":"text","text":"OK"}]}}'
|
|
59
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
60
|
-
AFTER=$(_mtime "$MARKER")
|
|
61
|
-
NOW=$(date +%s)
|
|
62
|
-
[ "$AFTER" -gt "$BEFORE" ]
|
|
63
|
-
# And the new mtime is approximately NOW (within 5 seconds of slide call)
|
|
64
|
-
AGE=$((NOW - AFTER))
|
|
65
|
-
[ "$AGE" -lt 5 ]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@test "slide: does NOT touch marker when tool_response.is_error=true" {
|
|
69
|
-
touch "$MARKER"
|
|
70
|
-
_backdate "$MARKER" 60
|
|
71
|
-
BEFORE=$(_mtime "$MARKER")
|
|
72
|
-
_HOOK_INPUT='{"tool_response":{"is_error":true,"content":[]}}'
|
|
73
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
74
|
-
AFTER=$(_mtime "$MARKER")
|
|
75
|
-
[ "$BEFORE" = "$AFTER" ]
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@test "slide: no-op when marker does not exist (never creates)" {
|
|
79
|
-
[ ! -f "$MARKER" ]
|
|
80
|
-
_HOOK_INPUT='{"tool_response":{"content":[]}}'
|
|
81
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
82
|
-
[ ! -f "$MARKER" ]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@test "slide: no-op when marker path argument is empty" {
|
|
86
|
-
_HOOK_INPUT='{"tool_response":{"content":[]}}'
|
|
87
|
-
run slide_marker_on_subprocess_return ""
|
|
88
|
-
[ "$status" -eq 0 ]
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@test "slide: malformed hook input is fail-safe (no slide)" {
|
|
92
|
-
touch "$MARKER"
|
|
93
|
-
_backdate "$MARKER" 60
|
|
94
|
-
BEFORE=$(_mtime "$MARKER")
|
|
95
|
-
_HOOK_INPUT='not valid json'
|
|
96
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
97
|
-
AFTER=$(_mtime "$MARKER")
|
|
98
|
-
# Fail-safe: when the hook input cannot be parsed, treat as error and skip
|
|
99
|
-
[ "$BEFORE" = "$AFTER" ]
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@test "slide: triggers correctly on Skill tool_response shape (P213, ADR-009 2026-06-08 amendment)" {
|
|
103
|
-
# hooks.json matcher expansion Agent|Bash → Agent|Bash|Skill (P213 Option D)
|
|
104
|
-
# widens slide-marker coverage to PostToolUse:Skill completions (e.g. the
|
|
105
|
-
# /wr-risk-scorer:assess-* sibling assessor SKILLs run as long subprocesses
|
|
106
|
-
# by the AFK orchestrator). The Skill tool_response shape is identical to
|
|
107
|
-
# Agent|Bash (Claude Code's uniform PostToolUse contract), so the matcher-
|
|
108
|
-
# agnostic helper composes without code changes. This test documents that
|
|
109
|
-
# contract explicitly so a future hook_input shape divergence regression
|
|
110
|
-
# surfaces here rather than at the gate-denial site.
|
|
111
|
-
touch "$MARKER"
|
|
112
|
-
_backdate "$MARKER" 60
|
|
113
|
-
BEFORE=$(_mtime "$MARKER")
|
|
114
|
-
_HOOK_INPUT='{"tool_name":"Skill","tool_response":{"content":[{"type":"text","text":"OK"}]}}'
|
|
115
|
-
slide_marker_on_subprocess_return "$MARKER"
|
|
116
|
-
AFTER=$(_mtime "$MARKER")
|
|
117
|
-
[ "$AFTER" -gt "$BEFORE" ]
|
|
118
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# Tests for style-guide-enforce-edit.sh — verifies the path-based exemption
|
|
4
|
-
# for governance-managed surfaces (docs/story-maps/, docs/stories/) per
|
|
5
|
-
# ADR-060 § Phase 2 amendment 2026-05-12 lines 481-496 (P170 Phase 2 Slice 2.5).
|
|
6
|
-
#
|
|
7
|
-
# The style-guide hook is opt-in (gates only *.css|*.html|*.jsx|*.tsx|*.vue|
|
|
8
|
-
# *.svelte|*.ejs|*.hbs). Story-map HTML files would otherwise be blocked at
|
|
9
|
-
# `*.html` matching when docs/STYLE-GUIDE.md is absent OR review-gate is open.
|
|
10
|
-
# The exemption short-circuits before the extension check.
|
|
11
|
-
|
|
12
|
-
setup() {
|
|
13
|
-
SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
14
|
-
HOOK="$SCRIPT_DIR/style-guide-enforce-edit.sh"
|
|
15
|
-
ORIG_DIR="$PWD"
|
|
16
|
-
TEST_DIR=$(mktemp -d)
|
|
17
|
-
cd "$TEST_DIR"
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
teardown() {
|
|
21
|
-
cd "$ORIG_DIR"
|
|
22
|
-
rm -rf "$TEST_DIR"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
run_hook_with_file() {
|
|
26
|
-
local file_path="$1"
|
|
27
|
-
local json="{\"tool_input\":{\"file_path\":\"${file_path}\"},\"session_id\":\"test-session-$$\"}"
|
|
28
|
-
echo "$json" | bash "$HOOK"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
assert_path_allowed() {
|
|
32
|
-
local file_path="$1"
|
|
33
|
-
run run_hook_with_file "$file_path"
|
|
34
|
-
[ "$status" -eq 0 ]
|
|
35
|
-
[[ "$output" != *"BLOCKED"* ]]
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
assert_path_blocked() {
|
|
39
|
-
local file_path="$1"
|
|
40
|
-
run run_hook_with_file "$file_path"
|
|
41
|
-
[ "$status" -eq 0 ]
|
|
42
|
-
[[ "$output" == *"BLOCKED"* ]]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
# --- Story maps + stories exemptions (P170 Phase 2 Slice 2.5 / ADR-060) ---
|
|
46
|
-
|
|
47
|
-
@test "style-guide: exempts docs/story-maps/ HTML in per-state subdir" {
|
|
48
|
-
assert_path_allowed "$PWD/docs/story-maps/draft/STORY-MAP-001-foo.html"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@test "style-guide: exempts docs/story-maps/ HTML in completed subdir" {
|
|
52
|
-
assert_path_allowed "$PWD/docs/story-maps/completed/STORY-MAP-002-bar.html"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@test "style-guide: exempts docs/stories/ files even though .md isn't normally gated" {
|
|
56
|
-
# Markdown isn't in the opt-in extension list anyway, so this passes by
|
|
57
|
-
# virtue of the extension filter — but the explicit exemption documents
|
|
58
|
-
# intent and survives a hypothetical future scope-widening.
|
|
59
|
-
assert_path_allowed "$PWD/docs/stories/draft/STORY-001-foo.md"
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
# --- Regression: non-exempt UI files still gate ---
|
|
63
|
-
|
|
64
|
-
@test "style-guide: exempts VCS-internal .git/ files even with a gated extension (P458)" {
|
|
65
|
-
assert_path_allowed "$PWD/.git/hooks/pre-commit.css"
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@test "style-guide: still blocks an unrelated .html file when no policy exists" {
|
|
69
|
-
# No docs/STYLE-GUIDE.md created — hook should still block this HTML.
|
|
70
|
-
assert_path_blocked "$PWD/public/index.html"
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@test "style-guide: still blocks a .tsx component file when no policy exists" {
|
|
74
|
-
assert_path_blocked "$PWD/src/Component.tsx"
|
|
75
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P095 / ADR-038: style-guide-eval.sh UserPromptSubmit hook must emit
|
|
4
|
-
# the full MANDATORY block only on the first prompt of a session;
|
|
5
|
-
# subsequent prompts emit a terse reminder.
|
|
6
|
-
|
|
7
|
-
setup() {
|
|
8
|
-
REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../../.." && pwd)"
|
|
9
|
-
HOOK="$REPO_ROOT/packages/style-guide/hooks/style-guide-eval.sh"
|
|
10
|
-
|
|
11
|
-
WORKDIR="$(mktemp -d)"
|
|
12
|
-
mkdir -p "$WORKDIR/docs"
|
|
13
|
-
: > "$WORKDIR/docs/STYLE-GUIDE.md"
|
|
14
|
-
|
|
15
|
-
SID="sg-eval-test-$$-$RANDOM"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
teardown() {
|
|
19
|
-
rm -f "/tmp/style-guide-announced-${SID}"
|
|
20
|
-
rm -f "/tmp/style-guide-announced-${SID}-alt"
|
|
21
|
-
rm -rf "$WORKDIR"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
run_hook() {
|
|
25
|
-
local sid="$1"
|
|
26
|
-
(cd "$WORKDIR" && echo "{\"session_id\":\"$sid\"}" | bash "$HOOK")
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
@test "style-guide-eval: first invocation emits the full MANDATORY block" {
|
|
30
|
-
run run_hook "$SID"
|
|
31
|
-
[ "$status" -eq 0 ]
|
|
32
|
-
[ "${#output}" -gt 400 ]
|
|
33
|
-
[[ "$output" == *"MANDATORY STYLE GUIDE CHECK"* ]]
|
|
34
|
-
[[ "$output" == *"wr-style-guide:agent"* ]]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@test "style-guide-eval: first invocation writes the announcement marker" {
|
|
38
|
-
run run_hook "$SID"
|
|
39
|
-
[ -f "/tmp/style-guide-announced-${SID}" ]
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@test "style-guide-eval: second invocation emits only a terse reminder" {
|
|
43
|
-
run_hook "$SID" >/dev/null
|
|
44
|
-
run run_hook "$SID"
|
|
45
|
-
[ "${#output}" -lt 250 ]
|
|
46
|
-
[[ "$output" == *"style-guide"* ]] || [[ "$output" == *"STYLE"* ]]
|
|
47
|
-
[[ "$output" == *"wr-style-guide:agent"* ]]
|
|
48
|
-
[[ "$output" != *"REQUIRED ACTIONS:"* ]]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@test "style-guide-eval: terse reminder preserves the MANDATORY signal word" {
|
|
52
|
-
run_hook "$SID" >/dev/null
|
|
53
|
-
run run_hook "$SID"
|
|
54
|
-
[[ "$output" == *"MANDATORY"* ]] || [[ "$output" == *"REQUIRED"* ]] || [[ "$output" == *"NON-OPTIONAL"* ]]
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@test "style-guide-eval: terse reminder names the trigger artifact" {
|
|
58
|
-
run_hook "$SID" >/dev/null
|
|
59
|
-
run run_hook "$SID"
|
|
60
|
-
[[ "$output" == *"STYLE-GUIDE.md"* ]]
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@test "style-guide-eval: different session_id re-emits the full block" {
|
|
64
|
-
run_hook "$SID" >/dev/null
|
|
65
|
-
local SID2="${SID}-alt"
|
|
66
|
-
run run_hook "$SID2"
|
|
67
|
-
[ "${#output}" -gt 400 ]
|
|
68
|
-
[[ "$output" == *"MANDATORY STYLE GUIDE CHECK"* ]]
|
|
69
|
-
rm -f "/tmp/style-guide-announced-${SID2}"
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@test "style-guide-eval: empty session_id emits the full block and writes no marker" {
|
|
73
|
-
run run_hook ""
|
|
74
|
-
[ "${#output}" -gt 400 ]
|
|
75
|
-
[[ "$output" == *"MANDATORY STYLE GUIDE CHECK"* ]]
|
|
76
|
-
[ ! -f "/tmp/style-guide-announced-" ]
|
|
77
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P001 / ADR-009: Stop-hook marker reset removed.
|
|
4
|
-
|
|
5
|
-
setup() {
|
|
6
|
-
PLUGIN_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/../.." && pwd)"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
@test "style-guide: hooks.json has no Stop hook entry (ADR-009)" {
|
|
10
|
-
! grep -q '"Stop"' "$PLUGIN_DIR/hooks/hooks.json"
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@test "style-guide: style-guide-reset-marker.sh has been removed" {
|
|
14
|
-
[ ! -f "$PLUGIN_DIR/hooks/style-guide-reset-marker.sh" ]
|
|
15
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# P004: style-guide-enforce-edit.sh project-root check.
|
|
4
|
-
|
|
5
|
-
setup() {
|
|
6
|
-
SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
7
|
-
HOOK="$SCRIPT_DIR/style-guide-enforce-edit.sh"
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
run_hook_with_file() {
|
|
11
|
-
local file_path="$1"
|
|
12
|
-
local json="{\"tool_input\":{\"file_path\":\"${file_path}\"},\"session_id\":\"test-$$\"}"
|
|
13
|
-
echo "$json" | bash "$HOOK"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "style-guide project-root: absolute .css outside project exits 0" {
|
|
17
|
-
run run_hook_with_file "/Users/other/project/src/style.css"
|
|
18
|
-
[ "$status" -eq 0 ]
|
|
19
|
-
[[ "$output" != *"BLOCKED"* ]]
|
|
20
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
# Behavioural tests for ADR-009 amendment 2026-06-06: substance-aware drift +
|
|
4
|
-
# atomic verdict-write — style-guide gate. Sibling-coverage to architect /
|
|
5
|
-
# jtbd / voice-tone bats files of the same name.
|
|
6
|
-
|
|
7
|
-
setup() {
|
|
8
|
-
SCRIPT_DIR="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)"
|
|
9
|
-
source "$SCRIPT_DIR/lib/review-gate.sh"
|
|
10
|
-
|
|
11
|
-
TEST_SESSION="bats-sg-substance-$$-${BATS_TEST_NUMBER}"
|
|
12
|
-
SYSTEM="style-guide"
|
|
13
|
-
TEST_DIR=$(mktemp -d -t substance-aware-drift-sg.XXXXXX)
|
|
14
|
-
POLICY_FILE="$TEST_DIR/STYLE-GUIDE.md"
|
|
15
|
-
|
|
16
|
-
MARKER="/tmp/${SYSTEM}-reviewed-${TEST_SESSION}"
|
|
17
|
-
HASH_FILE="${MARKER}.hash"
|
|
18
|
-
rm -f "$MARKER" "$HASH_FILE"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
teardown() {
|
|
22
|
-
rm -f "$MARKER" "$HASH_FILE"
|
|
23
|
-
rm -rf "$TEST_DIR"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
_install_and_mark() {
|
|
27
|
-
local body="$1"
|
|
28
|
-
printf '%s' "$body" > "$POLICY_FILE"
|
|
29
|
-
touch "$MARKER"
|
|
30
|
-
store_review_hash "$TEST_SESSION" "$SYSTEM" "$POLICY_FILE"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@test "style-guide substance-aware: trailing-whitespace edit does NOT re-trigger" {
|
|
34
|
-
_install_and_mark "# Style Guide
|
|
35
|
-
|
|
36
|
-
Use 2-space indentation.
|
|
37
|
-
"
|
|
38
|
-
printf '%s' "# Style Guide
|
|
39
|
-
|
|
40
|
-
Use 2-space indentation.
|
|
41
|
-
" > "$POLICY_FILE"
|
|
42
|
-
|
|
43
|
-
run check_review_gate "$TEST_SESSION" "$SYSTEM" "$POLICY_FILE"
|
|
44
|
-
[ "$status" -eq 0 ]
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
@test "style-guide substance-aware: new-rule edit DOES re-trigger" {
|
|
48
|
-
_install_and_mark "# Style Guide
|
|
49
|
-
|
|
50
|
-
Use 2-space indentation.
|
|
51
|
-
"
|
|
52
|
-
printf '%s' "# Style Guide
|
|
53
|
-
|
|
54
|
-
Use 2-space indentation.
|
|
55
|
-
Always trailing-comma.
|
|
56
|
-
" > "$POLICY_FILE"
|
|
57
|
-
|
|
58
|
-
run check_review_gate "$TEST_SESSION" "$SYSTEM" "$POLICY_FILE"
|
|
59
|
-
[ "$status" -ne 0 ]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
@test "style-guide atomic-write: store_review_hash lands marker + hash together" {
|
|
63
|
-
printf '%s' "# Style Guide
|
|
64
|
-
|
|
65
|
-
Body.
|
|
66
|
-
" > "$POLICY_FILE"
|
|
67
|
-
touch "$MARKER"
|
|
68
|
-
run store_review_hash "$TEST_SESSION" "$SYSTEM" "$POLICY_FILE"
|
|
69
|
-
[ "$status" -eq 0 ]
|
|
70
|
-
[ -f "$MARKER" ]
|
|
71
|
-
[ -f "$HASH_FILE" ]
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@test "style-guide conservative: single-numeral change DOES re-trigger" {
|
|
75
|
-
_install_and_mark "# Style Guide
|
|
76
|
-
|
|
77
|
-
Use 2-space indentation.
|
|
78
|
-
"
|
|
79
|
-
printf '%s' "# Style Guide
|
|
80
|
-
|
|
81
|
-
Use 4-space indentation.
|
|
82
|
-
" > "$POLICY_FILE"
|
|
83
|
-
|
|
84
|
-
run check_review_gate "$TEST_SESSION" "$SYSTEM" "$POLICY_FILE"
|
|
85
|
-
[ "$status" -ne 0 ]
|
|
86
|
-
}
|