diff --git a/scripts/validation/validate_config.sh b/scripts/validation/validate_config.sh index e55c421..b2ae79b 100644 --- a/scripts/validation/validate_config.sh +++ b/scripts/validation/validate_config.sh @@ -299,6 +299,16 @@ validateSystemConfiguration() local f while IFS= read -r f; do [[ -f "$f" ]] || continue + # Only judge what actually gets sourced. sourceScanFiles sources a file in + # a SUBDIRECTORY only when that directory carries .category, so an unmarked + # directory holds ordinary data — and "does not parse as shell" is a + # meaningless complaint about a file nothing executes. Reporting it as a + # config problem sends someone fixing the wrong thing. Depth-1 files + # (directly in configs/) are checked as before, matching the loader. + local parent_dir="${f%/*}" + if [[ "$parent_dir" != "${configs_dir%/}" && ! -f "$parent_dir/.category" ]]; then + continue + fi bash -n "$f" 2>/dev/null || _lpvFail "$(basename "$f") does not parse as shell." local dup dup=$(grep -oE '^CFG_[A-Z0-9_]+=' "$f" | sort | uniq -d | tr -d '=')