Skip to content

Commit 945fdce

Browse files
Biksu-Okusiclaude
andcommitted
feat(bcscheck): add to Makefile install and document
Add bcscheck convenience wrapper to official installation: - Install/uninstall in Makefile (now 24 commands) - Add to symlink detection loops - Document in README.md quick start and check sections - Refactor script to use variable for append prompt Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cc6e447 commit 945fdce

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ install:
283283
@# Phase 1: Detect existing symlinks in destination
284284
@echo "Checking for existing symlinks in $(BINDIR)..."
285285
@SYMLINKS=""; \
286-
for FILE in bcs md2ansi md mdheaders libmdheaders.bash whichx dir-sizes printline bcx \
286+
for FILE in bcs bcscheck md2ansi md mdheaders libmdheaders.bash whichx dir-sizes printline bcx \
287287
shlock timer post_slug remblanks hr2int int2hr \
288288
ltrim rtrim trim trimall trimv squeeze; do \
289289
if [ -L "$(BINDIR)/$$FILE" ]; then \
@@ -305,7 +305,7 @@ install:
305305
case "$$REPLY" in \
306306
[Yy]*) \
307307
echo "Removing symlinks..."; \
308-
for FILE in bcs md2ansi md mdheaders libmdheaders.bash whichx dir-sizes printline bcx \
308+
for FILE in bcs bcscheck md2ansi md mdheaders libmdheaders.bash whichx dir-sizes printline bcx \
309309
shlock timer post_slug remblanks hr2int int2hr \
310310
ltrim rtrim trim trimall trimv squeeze; do \
311311
[ -L "$(BINDIR)/$$FILE" ] && rm -f "$(BINDIR)/$$FILE"; \
@@ -325,6 +325,7 @@ install:
325325
@# Phase 2: Normal installation
326326
install -d $(BINDIR)
327327
install -m 755 bcs $(BINDIR)/
328+
install -m 755 bcscheck $(BINDIR)/
328329
ln -sf bcs $(BINDIR)/bash-coding-standard
329330
install -m 755 lib/md2ansi/md2ansi $(BINDIR)/
330331
install -m 755 lib/md2ansi/md $(BINDIR)/
@@ -369,8 +370,9 @@ install:
369370
@echo ""
370371
@echo "✓ Installed to $(PREFIX)"
371372
@echo ""
372-
@echo "Installed files (23 commands):"
373+
@echo "Installed files (24 commands):"
373374
@echo " - Main executable: $(BINDIR)/bcs (and bash-coding-standard symlink)"
375+
@echo " - Compliance checker: bcscheck (wrapper for bcs check)"
374376
@echo " - Markdown tools: md2ansi, md, mdheaders"
375377
@echo " - Command locator: whichx (and which symlink)"
376378
@echo " - Directory analyzer: dir-sizes (and dux symlink)"
@@ -392,6 +394,7 @@ install:
392394
@echo "Usage examples:"
393395
@echo " bcs # View BCS standard"
394396
@echo " bcs --help # Show help"
397+
@echo " bcscheck script.sh # AI compliance check"
395398
@echo " md file.md # View markdown file"
396399
@echo " mdheaders upgrade file.md # Manipulate headers"
397400
@echo " which <command> # Locate command"
@@ -416,6 +419,7 @@ install:
416419

417420
uninstall:
418421
rm -f $(BINDIR)/bcs
422+
rm -f $(BINDIR)/bcscheck
419423
rm -f $(BINDIR)/bash-coding-standard
420424
rm -f $(BINDIR)/md2ansi
421425
rm -f $(BINDIR)/md

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ bcs template -t complete -n myscript -o myscript.sh -x
120120

121121
# Check script compliance (requires Claude CLI)
122122
bcs check myscript.sh
123+
bcscheck myscript.sh # Quick check with defaults
123124

124125
# Look up BCS rules
125126
bcs codes # List all 101 rule codes
@@ -220,8 +221,11 @@ AI-powered compliance checking using Claude CLI.
220221
bcs check myscript.sh # Comprehensive check
221222
bcs check --strict deploy.sh # Strict mode (for CI/CD)
222223
bcs check --format json script.sh # JSON output
224+
bcscheck myscript.sh # Quick check (wrapper with defaults)
223225
```
224226

227+
**Quick Check:** The `bcscheck` command is a convenience wrapper that runs `bcs check` with recommended defaults (summary tier, strict mode, enhanced prompt).
228+
225229
**Options:**
226230
| Option | Description |
227231
|--------|-------------|

bcscheck

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
exec bcs check --tier summary --strict \
5-
--append-prompt "Do a comprehesive analysis of the submitted Bash script, checking for its compliance with the Bash Coding Standard (BCS).
4+
declare -- APPEND_PROMPT='
5+
Do a comprehesive analysis of the submitted Bash script, checking for its compliance with the Bash Coding Standard (BCS).
66
Highlight actual coding errors.
7-
List any possible improvements." \
7+
List any possible improvements.
8+
'
9+
10+
exec bcs check --tier summary --strict \
11+
--append-prompt "$APPEND_PROMPT" \
812
--add-dir "$PWD" \
913
"$@"
1014

0 commit comments

Comments
 (0)