diff --git a/docs/shell-split-verification.md b/docs/shell-split-verification.md index fc2fd151..c5d31541 100644 --- a/docs/shell-split-verification.md +++ b/docs/shell-split-verification.md @@ -114,6 +114,33 @@ Note the knock-on: renaming the nameref local hides the array from shellcheck through a variable (`CODE_FILES_MAP="LANG_CODE_FILES"`) so the reference is real, rather than suppressing. +### Verify through every entry point, especially symlinks + +Adding a `source "$SCRIPT_DIR/lib/..."` line to `meta/lint_python.sh` broke +`./lint_python.sh` from the repo root, because that root path is a **symlink** +into `meta/` (so are `pyproject.toml`, `requirements.txt`, `run.sh`, `.fvmrc`). +`SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"` does not resolve +symlinks — `dirname` is string manipulation — so it became the repo root, where +`lib/` does not exist, and `set -euo pipefail` turned that into an instant exit. + +It was invisible because every check used `bash meta/lint_python.sh`, the one +path that cannot fail. Before splitting a script, ask how else it is reachable: + +```bash +find . -maxdepth 2 -type l -lname '*