From 2a79fd67e8a29e4e37cda38acd9390c5f4594dc2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 27 Jun 2026 22:43:42 +0300 Subject: rr0: data-driven config_html via indirect expansion of source_name Replace the hardcoded per-name case in prepare_template_render_var__config_html (HEIGHT/MAXPREVIEWS/ ORIGINAL_BASEPATH/SOURCE_URL/STATS_PAGE/THUMBHEIGHT/TITLE) with a single indirect read of the spec's source_name: context_value=${!source_name-}. The handler is now fully data-driven and never needs editing when a new config render-var is added (Open/Closed), matching the module's spec-driven dispatch. source_name is already passed to every handler by prepare_template_render_vars, so no dispatch contract changed. Output is byte-identical for all reachable states: apply_config_defaults always runs before render (HEIGHT/ORIGINAL_BASEPATH/SOURCE_URL/STATS_PAGE/ TITLE always set, so the old defensive :- fallbacks like STATS_PAGE :-no were unreachable), and the unset-safe '-' default reproduces the empty result for refresh-only MAXPREVIEWS/THUMBHEIGHT. Dropping the literal ${TITLE:-} re-surfaced a previously-suppressed SC2153 on $TITLE in generation-metadata.source.sh (lowercase 'title' locals in the stats modules); add a targeted shellcheck disable there. Regenerated bin/shuriken. just test/shellcheck/check-generated all green. Co-Authored-By: Claude Opus 4.8 --- src/lib/generation-metadata.source.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib/generation-metadata.source.sh') diff --git a/src/lib/generation-metadata.source.sh b/src/lib/generation-metadata.source.sh index 931bd92..dc3578a 100644 --- a/src/lib/generation-metadata.source.sh +++ b/src/lib/generation-metadata.source.sh @@ -29,6 +29,11 @@ _collect_generation_metadata() { ) _GENERATION_METADATA["tarball_included"]="$TARBALL_INCLUDE" _GENERATION_METADATA["tarball_file"]="$tarball_file" + # SC2153: a lowercase "title" local in the --check-sourced stats modules + # makes shellcheck suspect $TITLE is a misspelling. The config global is + # correct here; the suppression used to ride on a literal ${TITLE:-} in + # template.source.sh, which is now an indirect expansion, so disable it here. + # shellcheck disable=SC2153 _GENERATION_METADATA["settings_title"]="$TITLE" _GENERATION_METADATA["settings_height"]="$HEIGHT" _GENERATION_METADATA["settings_thumbheight"]="$THUMBHEIGHT" -- cgit v1.2.3