aboutsummaryrefslogtreecommitdiff
path: root/lib/naming/config.mli
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 14:09:09 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-19 14:09:09 +0200
commitd869a4410a88333d328358c723609577d32f3380 (patch)
tree0d787e6ae95af9cace13e96b888ef85852f6c422 /lib/naming/config.mli
parent59fbd3718dbf2721557b97d7b4e87dce38fb745c (diff)
downloadcolitur-d869a4410a88333d328358c723609577d32f3380.tar.gz
colitur-d869a4410a88333d328358c723609577d32f3380.zip
fix(naming): config.ml merges every [defaults] block, like lang.ml
config.ml and lang.ml both parse the INI format through the same reader, Colitur_kernel.Overlay_ini.parse_sections, but resolved a repeated [section] header oppositely: lang.ml folds over every section sharing a name, while config.ml used List.find_opt and silently discarded every [defaults] block after the first. Two modules parsing one file format must not disagree about what a duplicate section header means. of_string now folds a single accumulator across every section named [defaults], in file order, matching lang.ml's of_string shape. A scalar key (lang/template/format) repeated across two blocks resolves to the later value, consistent with the existing within-section last-wins rule; overlay keeps accumulating across every block, not only the first; and unknown_sections still excludes every [defaults] block, merged or not, since merging it is the point. config.mli's lang doc comment is extended to say the last-wins rule holds across block boundaries too, cross-referencing lang.ml's own duplicate-section policy so the two do not drift again unnoticed.
Diffstat (limited to 'lib/naming/config.mli')
-rw-r--r--lib/naming/config.mli7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/naming/config.mli b/lib/naming/config.mli
index 27f0c44..a84f95b 100644
--- a/lib/naming/config.mli
+++ b/lib/naming/config.mli
@@ -17,7 +17,12 @@ val of_string : string -> (t, string) result
repeated key is LAST-WINS -- the opposite direction from
{!Colitur_kernel.Overlay_ini.get}'s first-wins over the same [section]
type -- because the natural reading of a config file a user edited by
- hand and appended to is "the bottom line is the one that took effect". *)
+ hand and appended to is "the bottom line is the one that took effect".
+ This holds whether the repeat is within one [\[defaults\]] block or
+ across two of them: every section named [defaults] is merged, not only
+ the first, the same duplicate-section policy {!Lang.of_string} documents
+ for its own sections -- the two modules read the same underlying format
+ and must not disagree about what a repeated header means. *)
val lang : t -> string option
val overlays : t -> string list