Skip to content

Commit 5c46250

Browse files
author
Test User
committed
Add abstract and summary tier files to repository for distribution
Removed *.abstract.md and *.summary.md from .gitignore so they're included when installing from GitHub clones. These files are needed by bcs commands like 'codes' and 'about --stats'. Fixes installation issue where GitHub installs were missing 108 tier files, causing 'bcs codes' to report "No rule files found".
1 parent d0aa9c8 commit 5c46250

207 files changed

Lines changed: 35807 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
data.backup*
2+
.gitignore
3+
shellcheck
4+
*.backup*
5+
BASH-CODING-STYLE.md
6+
*~
7+
.*~
8+
*$py.class
9+
AUDIT-EVALUATE.md
10+
*.bak
11+
build/
12+
CHANGES.md
13+
.claude
14+
.claude/
15+
CLAUDE.md
16+
.coverage
17+
coverage_html/
18+
curtest.sh
19+
.dev/
20+
dev/
21+
DEVELOPMENT.md
22+
DISCOVER.md
23+
dist/
24+
.DS_Store
25+
*.egg-info/
26+
.env
27+
env/
28+
ENV/
29+
.env.local
30+
.git
31+
.git/*
32+
git/
33+
.gitcommit
34+
gitcommit
35+
.gitignore
36+
gitignore
37+
.gudang
38+
gudang
39+
htmlcov/
40+
.idea/
41+
IMPROVEMENTS.md
42+
index.php
43+
.ipynb_checkpoints/
44+
*.json
45+
*.mp3
46+
*.old
47+
.old
48+
old/
49+
PURPOSE-FUNCTIONALITY-USAGE.md
50+
__pycache__
51+
__pycache__/
52+
*.py[cod]
53+
.pytest_cache/
54+
*.raw
55+
refactor*
56+
.script
57+
*.srt
58+
*.swo
59+
*.swp
60+
.symlink
61+
t
62+
t1
63+
t2
64+
t3
65+
t4
66+
.temp
67+
temp
68+
temp/
69+
t.htm*
70+
Thumbs.db
71+
.tmp
72+
tmp
73+
tmp/
74+
t.py
75+
tt
76+
tt.htm*
77+
tt.py
78+
ttt
79+
ttt.htm*
80+
ttt.py
81+
.venv/
82+
venv/
83+
.vscode/
84+
*.vtt
85+
*.wav
86+
ANALYSIS-AND-FIXES.md
87+
INSTALLATION-SUMMARY.md
88+
RESTRUCTURE-VALIDATION.md
89+
90+
# Generated rule variants in data/
91+
# Removed abstract.md and summary.md from gitignore so they're included in distributions
92+
# data/BASH-CODING-STANDARD.abstract.md
93+
# data/BASH-CODING-STANDARD.summary.md
94+
# data/**/*.abstract.md
95+
# data/**/*.summary.md
96+
97+
# Temporary files
98+
*.tmp
99+
.compress_helpers.tmp
100+
101+
# Analysis and planning documents (archived to .gudang/)
102+
BCS-SHELLCHECK-INTEGRATION.md
103+
BCS-SHELLCHECK.md
104+
BCS-SHELLCHECK-STRUCTURAL-ANALYSIS.md
105+
DEFICIENT-RULES-REPORT.md
106+
DEVELOPMENT.md
107+
FUTURE-SUBCOMMANDS.md
108+
IMPROVEMENTS-NEEDED.md
109+
REBUTTALS-FAQ.md
110+
rule-mdfile-format.md
111+
112+
# Legacy scripts
113+
BASH-CODING-STANDARD.sh
114+
115+
# Builtins build artifacts
116+
builtins/*.so
117+
builtins/**/*.o
118+
builtins/lib/*.a
119+
120+
# Lib sync manifest and script (development environment only)
121+
lib/.sync-manifest
122+
lib/sync-lib.sh
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Script Structure & Layout
2+
3+
**Scripts must follow mandatory 13-step layout for consistency and safe initialization.**
4+
5+
Steps: (1) Shebang `#!/usr/bin/env bash`, (2) ShellCheck directives if needed, (3) Brief description comment, (4) `set -euo pipefail`, (5) `shopt -s inherit_errexit shift_verbose extglob nullglob`, (6) Metadata (`VERSION`, `SCRIPT_PATH`, `SCRIPT_DIR`, `SCRIPT_NAME` made `readonly`), (7) Global variables, (8) Colors if terminal output, (9) Utility functions (messaging, helpers), (10) Business logic functions, (11) `main()` for scripts >40 lines, (12) Script invocation `main "$@"`, (13) End marker `#fin`.
6+
7+
**Function organization: bottom-up.** Define messaging functions first (lowest level), then helpers, validators, business logic, with `main()` last (highest orchestration level). Each function safely calls functions defined above it.
8+
9+
**Dual-purpose scripts** (executable and sourceable): Check `[[ ${BASH_SOURCE[0]} != "$0" ]] && return 0` early. When sourced, skip `set -e` to avoid modifying caller's shell.
10+
11+
**FHS compliance:** Install to `/usr/local/share/{org}/{project}/` (local) or `/usr/share/{org}/{project}/` (system). Support uninstalled mode (script directory) for development.
12+
13+
**File extensions:** Omit `.sh` for user-facing commands; use `.sh` for libraries and internal tools.
14+
15+
**Ref:** BCS01
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Script Structure & Layout
2+
3+
This section defines the mandatory 13-step structural layout ensuring consistency, maintainability, and safe initialization. Covers organization from shebang through `#fin` marker, including metadata, shopt settings, dual-purpose patterns, FHS compliance, file extensions, and bottom-up function organization where low-level utilities precede high-level orchestration.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## General Layouts for Standard Script
2+
3+
**Mandatory 13-step structural layout for all Bash scripts.**
4+
5+
### The 13 Steps
6+
7+
1. **Shebang**: `#!/bin/bash` (or `#!/usr/bin/bash`, `#!/usr/bin/env bash`)
8+
2. **ShellCheck directives** (if needed): `#shellcheck disable=SCxxxx` with comments
9+
3. **Brief description**: One-line purpose comment
10+
4. **Error handling**: `set -euo pipefail` (MANDATORY before commands)
11+
5. **Shell options**: `shopt -s inherit_errexit shift_verbose extglob nullglob`
12+
6. **Metadata**: `declare -r VERSION SCRIPT_PATH SCRIPT_DIR SCRIPT_NAME` (readonly together)
13+
7. **Global variables**: Explicit types - `declare -i`, `declare --`, `declare -a`, `declare -A`
14+
8. **Color definitions** (if terminal output): Conditional with readonly
15+
9. **Utility functions**: `_msg()`, `vecho()`, `info()`, `warn()`, `error()`, `die()` - lowest level
16+
10. **Business logic**: Core functions organized bottom-up
17+
11. **main()**: Required >100 lines; includes argument parsing; readonly after parsing
18+
12. **Invocation**: `main "$@"` (always quote)
19+
13. **End marker**: `#fin` or `#end` (MANDATORY)
20+
21+
**Rationale**: Guarantees safe initialization, prevents undefined references, enables testing.
22+
23+
**Anti-pattern**: Missing `set -euo pipefail`, variables before declaration, logic before utilities, no `main()` in large scripts.
24+
25+
**Ref:** BCS0101

0 commit comments

Comments
 (0)