Commit 6c5ed63fe9
Verified · cmc
Layout: unified · split
docs/design.md +1
| @@ -329,6 +329,7 @@ Fidelity is checked against Emacs itself, using the same oracle pattern as orgo' | |||
| 329 | - Encoding fixtures (BOM, CRLF, mixed endings, invalid UTF-8, non-BMP, combining characters) are public, in the repo. | 329 | - Encoding fixtures (BOM, CRLF, mixed endings, invalid UTF-8, non-BMP, combining characters) are public, in the repo. |
| 330 | - Save fault-injection tests replace the file on disk at each step of the save sequence. | 330 | - Save fault-injection tests replace the file on disk at each step of the save sequence. |
| 331 | - Personal org files are a second, private corpus run locally; phase gates use the public corpus. | 331 | - Personal org files are a second, private corpus run locally; phase gates use the public corpus. |
| 332 | - `scripts/check-file-sizes.sh` fails when a hand-written Swift file is over 1,000 lines; run it beside `swift test`. The generated `CharFold.swift` and `Queries.swift` are exempt. | ||
| 332 | 333 | ||
| 333 | ## Phases | 334 | ## Phases |
| 334 | 335 | ||
scripts/check-file-sizes.sh added +12
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # Lists hand-written Swift files over 1,000 lines and exits 1 when there are any. | ||
| 3 | # Generated files (scripts/update-char-fold.sh, scripts/update-highlight-queries.sh) are exempt. | ||
| 4 | # Usage: scripts/check-file-sizes.sh | ||
| 5 | set -eu | ||
| 6 | cd "$(dirname "$0")/.." | ||
| 7 | limit=1000 | ||
| 8 | over="$(find Sources -name '*.swift' \ | ||
| 9 | ! -path 'Sources/OrgCore/Keymap/CharFold.swift' ! -path 'Sources/OrgHighlight/Queries.swift' \ | ||
| 10 | -exec wc -l {} + | awk -v limit="$limit" '$2 != "total" && $1 > limit { printf "%6d %s\n", $1, $2 }')" | ||
| 11 | [ -z "$over" ] || { echo "Swift files over $limit lines:"; echo "$over"; exit 1; } | ||
| 12 | echo "No hand-written Swift file over $limit lines." | ||