Skip to content

Commit e1f2a11

Browse files
committed
Formatting
1 parent b9976d7 commit e1f2a11

5 files changed

Lines changed: 40 additions & 40 deletions

File tree

hdi

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ _RE_CMD_SPACE="^($CMD_PREFIXES) "
336336
_RE_CMD_END="^($CMD_PREFIXES)( |$)"
337337
_RE_INDENTED_CMD="^[[:space:]]*(\\\$[[:space:]]+)?($CMD_PREFIXES)( |$)"
338338

339-
# Extract backtick-wrapped commands from a line of text.
340-
# Sets _FBC_RESULT (newline-separated) instead of printing to stdout.
339+
# Extract backtick-wrapped commands from a line of text
340+
# Sets _FBC_RESULT (newline-separated) instead of printing to stdout
341341
# Usage: find_backtick_commands "text" [require_args]
342342
# require_args=true (default) - prefix must be followed by a space (prose)
343343
# require_args=false - bare prefix allowed (headings like `make`)
@@ -359,8 +359,8 @@ find_backtick_commands() {
359359
done
360360
}
361361

362-
# Strip shell prompt prefixes ($ or %) from fenced code block lines.
363-
# The regex requires whitespace after $ so "$HOME/bin" is never mangled.
362+
# Strip shell prompt prefixes ($ or %) from fenced code block lines
363+
# The regex requires whitespace after $ so "$HOME/bin" is never mangled
364364
# Sets _SP_RESULT instead of printing to stdout (avoids subshell per call).
365365
strip_prompt() {
366366
if [[ "$1" =~ ^[[:space:]]*[\$%][[:space:]]+(.*) ]]; then
@@ -370,12 +370,12 @@ strip_prompt() {
370370
fi
371371
}
372372

373-
# Extract commands from section body text.
374-
# Sets _EC_RESULT instead of printing to stdout (avoids subshell per call).
373+
# Extract commands from section body text
374+
# Sets _EC_RESULT instead of printing to stdout (avoids subshell per call)
375375
#
376376
# When _EC_GROUPED=true, sub-headings (##+ ) and bold pseudo-headings
377377
# (**text**) in the prose are emitted as marker lines prefixed with \x01
378-
# so the caller can create display sub-groups without a second pass.
378+
# so the caller can create display sub-groups without a second pass
379379
_EC_GROUPED=false
380380
_EC_SUBHDR=$'\x01'
381381

@@ -561,9 +561,9 @@ build_display_list() {
561561
done <<< "$title_cmds"
562562
fi
563563

564-
# Extract commands with sub-group markers (single pass over the body).
564+
# Extract commands with sub-group markers (single pass over the body)
565565
# Sub-headings and bold pseudo-headings produce \x01-prefixed marker
566-
# lines; everything else is a command or empty line.
566+
# lines; everything else is a command or empty line
567567
_EC_GROUPED=true
568568
extract_commands "$body"
569569
_EC_GROUPED=false
@@ -1052,9 +1052,9 @@ run_interactive() {
10521052
# Shell builtins and coreutils that are always available - not worth checking
10531053
_CHECK_SKIP="^(cd|cp|mv|rm|mkdir|echo|export|source|cat|chmod|chown|ln|touch|ls|printf|trap|pwd|set|unset|eval|exec|exit|return|read|test|true|false|tee|head|tail|wc|sort|grep|xargs|find|tar|gzip|gunzip|sed|awk|tr|cut|diff|date|sleep|kill|whoami|env|which|man|less|more)$"
10541054

1055-
# Extract the tool name from a command string.
1056-
# Strips leading env vars (FOO=bar) and sudo, returns the first word.
1057-
# Sets _CT_RESULT or "" if nothing useful.
1055+
# Extract the tool name from a command string
1056+
# Strips leading env vars (FOO=bar) and sudo, returns the first word
1057+
# Sets _CT_RESULT or "" if nothing useful
10581058
_check_tool_name() {
10591059
local cmd="$1"
10601060

@@ -1145,7 +1145,7 @@ run_check() {
11451145

11461146
# ── JSON output ───────────────────────────────────────────────────────────────
11471147

1148-
# Escape a string for safe embedding in JSON.
1148+
# Escape a string for safe embedding in JSON
11491149
_json_esc() {
11501150
local s="$1"
11511151
s="${s//\\/\\\\}"
@@ -1155,7 +1155,7 @@ _json_esc() {
11551155
printf '%s' "$s"
11561156
}
11571157

1158-
# Set PATTERN for a given mode name (mirrors the case in args.sh).
1158+
# Set PATTERN for a given mode name (mirrors the case in args.sh)
11591159
_json_set_pattern() {
11601160
case "$1" in
11611161
install) PATTERN="($KW_INSTALL)" ;;
@@ -1166,8 +1166,8 @@ _json_set_pattern() {
11661166
esac
11671167
}
11681168

1169-
# Print the modes display-list array as JSON for the current DISPLAY_LINES.
1170-
# Skips trailing blank separators (empty type + empty text).
1169+
# Print the modes display-list array as JSON for the current DISPLAY_LINES
1170+
# Skips trailing blank separators (empty type + empty text)
11711171
_json_display_list() {
11721172
local mode="$1"
11731173
printf ' "%s": [' "$mode"
@@ -1183,7 +1183,7 @@ _json_display_list() {
11831183
printf '\n ]'
11841184
}
11851185

1186-
# Print the fullProse array as JSON for the current SECTION_TITLES/BODIES.
1186+
# Print the fullProse array as JSON for the current SECTION_TITLES/BODIES
11871187
_json_full_prose() {
11881188
local mode="$1"
11891189
printf ' "%s": [' "$mode"
@@ -1195,7 +1195,7 @@ _json_full_prose() {
11951195
printf '\n {"type": "%s", "text": "%s"}' "$1" "$(_json_esc "$2")"
11961196
}
11971197

1198-
# Render a plain prose line (not inside a code block).
1198+
# Render a plain prose line (not inside a code block)
11991199
_fp_prose_line() {
12001200
local l="$1"
12011201
# Empty / whitespace-only
@@ -1306,7 +1306,7 @@ _json_full_prose() {
13061306
printf '\n ]'
13071307
}
13081308

1309-
# Print the check array as JSON using the current DISPLAY_LINES.
1309+
# Print the check array as JSON using the current DISPLAY_LINES
13101310
_json_check() {
13111311
local -a tools=()
13121312
local tool
@@ -1345,7 +1345,7 @@ _json_check() {
13451345
printf '\n ]'
13461346
}
13471347

1348-
# Main JSON renderer: outputs all modes, fullProse, and check.
1348+
# Main JSON renderer: outputs all modes, fullProse, and check
13491349
render_json() {
13501350
local _modes=("default" "install" "run" "test" "deploy" "all")
13511351
local first

src/check.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Shell builtins and coreutils that are always available - not worth checking
44
_CHECK_SKIP="^(cd|cp|mv|rm|mkdir|echo|export|source|cat|chmod|chown|ln|touch|ls|printf|trap|pwd|set|unset|eval|exec|exit|return|read|test|true|false|tee|head|tail|wc|sort|grep|xargs|find|tar|gzip|gunzip|sed|awk|tr|cut|diff|date|sleep|kill|whoami|env|which|man|less|more)$"
55

6-
# Extract the tool name from a command string.
7-
# Strips leading env vars (FOO=bar) and sudo, returns the first word.
8-
# Sets _CT_RESULT or "" if nothing useful.
6+
# Extract the tool name from a command string
7+
# Strips leading env vars (FOO=bar) and sudo, returns the first word
8+
# Sets _CT_RESULT or "" if nothing useful
99
_check_tool_name() {
1010
local cmd="$1"
1111

src/display.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ build_display_list() {
4040
done <<< "$title_cmds"
4141
fi
4242

43-
# Extract commands with sub-group markers (single pass over the body).
43+
# Extract commands with sub-group markers (single pass over the body)
4444
# Sub-headings and bold pseudo-headings produce \x01-prefixed marker
45-
# lines; everything else is a command or empty line.
45+
# lines; everything else is a command or empty line
4646
_EC_GROUPED=true
4747
extract_commands "$body"
4848
_EC_GROUPED=false

src/extract.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ _RE_CMD_SPACE="^($CMD_PREFIXES) "
3333
_RE_CMD_END="^($CMD_PREFIXES)( |$)"
3434
_RE_INDENTED_CMD="^[[:space:]]*(\\\$[[:space:]]+)?($CMD_PREFIXES)( |$)"
3535

36-
# Extract backtick-wrapped commands from a line of text.
37-
# Sets _FBC_RESULT (newline-separated) instead of printing to stdout.
36+
# Extract backtick-wrapped commands from a line of text
37+
# Sets _FBC_RESULT (newline-separated) instead of printing to stdout
3838
# Usage: find_backtick_commands "text" [require_args]
3939
# require_args=true (default) - prefix must be followed by a space (prose)
4040
# require_args=false - bare prefix allowed (headings like `make`)
@@ -56,8 +56,8 @@ find_backtick_commands() {
5656
done
5757
}
5858

59-
# Strip shell prompt prefixes ($ or %) from fenced code block lines.
60-
# The regex requires whitespace after $ so "$HOME/bin" is never mangled.
59+
# Strip shell prompt prefixes ($ or %) from fenced code block lines
60+
# The regex requires whitespace after $ so "$HOME/bin" is never mangled
6161
# Sets _SP_RESULT instead of printing to stdout (avoids subshell per call).
6262
strip_prompt() {
6363
if [[ "$1" =~ ^[[:space:]]*[\$%][[:space:]]+(.*) ]]; then
@@ -67,12 +67,12 @@ strip_prompt() {
6767
fi
6868
}
6969

70-
# Extract commands from section body text.
71-
# Sets _EC_RESULT instead of printing to stdout (avoids subshell per call).
70+
# Extract commands from section body text
71+
# Sets _EC_RESULT instead of printing to stdout (avoids subshell per call)
7272
#
7373
# When _EC_GROUPED=true, sub-headings (##+ ) and bold pseudo-headings
7474
# (**text**) in the prose are emitted as marker lines prefixed with \x01
75-
# so the caller can create display sub-groups without a second pass.
75+
# so the caller can create display sub-groups without a second pass
7676
_EC_GROUPED=false
7777
_EC_SUBHDR=$'\x01'
7878

src/json.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ── JSON output ───────────────────────────────────────────────────────────────
22

3-
# Escape a string for safe embedding in JSON.
3+
# Escape a string for safe embedding in JSON
44
_json_esc() {
55
local s="$1"
66
s="${s//\\/\\\\}"
@@ -10,7 +10,7 @@ _json_esc() {
1010
printf '%s' "$s"
1111
}
1212

13-
# Set PATTERN for a given mode name (mirrors the case in args.sh).
13+
# Set PATTERN for a given mode name (mirrors the case in args.sh)
1414
_json_set_pattern() {
1515
case "$1" in
1616
install) PATTERN="($KW_INSTALL)" ;;
@@ -21,8 +21,8 @@ _json_set_pattern() {
2121
esac
2222
}
2323

24-
# Print the modes display-list array as JSON for the current DISPLAY_LINES.
25-
# Skips trailing blank separators (empty type + empty text).
24+
# Print the modes display-list array as JSON for the current DISPLAY_LINES
25+
# Skips trailing blank separators (empty type + empty text)
2626
_json_display_list() {
2727
local mode="$1"
2828
printf ' "%s": [' "$mode"
@@ -38,7 +38,7 @@ _json_display_list() {
3838
printf '\n ]'
3939
}
4040

41-
# Print the fullProse array as JSON for the current SECTION_TITLES/BODIES.
41+
# Print the fullProse array as JSON for the current SECTION_TITLES/BODIES
4242
_json_full_prose() {
4343
local mode="$1"
4444
printf ' "%s": [' "$mode"
@@ -50,7 +50,7 @@ _json_full_prose() {
5050
printf '\n {"type": "%s", "text": "%s"}' "$1" "$(_json_esc "$2")"
5151
}
5252

53-
# Render a plain prose line (not inside a code block).
53+
# Render a plain prose line (not inside a code block)
5454
_fp_prose_line() {
5555
local l="$1"
5656
# Empty / whitespace-only
@@ -161,7 +161,7 @@ _json_full_prose() {
161161
printf '\n ]'
162162
}
163163

164-
# Print the check array as JSON using the current DISPLAY_LINES.
164+
# Print the check array as JSON using the current DISPLAY_LINES
165165
_json_check() {
166166
local -a tools=()
167167
local tool
@@ -200,7 +200,7 @@ _json_check() {
200200
printf '\n ]'
201201
}
202202

203-
# Main JSON renderer: outputs all modes, fullProse, and check.
203+
# Main JSON renderer: outputs all modes, fullProse, and check
204204
render_json() {
205205
local _modes=("default" "install" "run" "test" "deploy" "all")
206206
local first

0 commit comments

Comments
 (0)