From 84b1b017026bb1d0a37a8d3ef553f073225b4e8d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 10 Apr 2023 17:26:25 +0200 Subject: lib/modules: Only interpret class declaration in non-shorthand mode This is to avoid stealing keys from submodules. `class` might be common enough that reinterpreting existing `class` attributes in configurations as a declaration leads to fairly widespread problems. --- lib/tests/modules.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/tests/modules.sh') diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh index c2a8e566cb8c..116a0778aebc 100755 --- a/lib/tests/modules.sh +++ b/lib/tests/modules.sh @@ -255,6 +255,8 @@ checkConfigError 'A definition for option .* is not of type .*' \ ## Freeform modules # Assigning without a declared option should work checkConfigOutput '^"24"$' config.value ./freeform-attrsOf.nix ./define-value-string.nix +# Shorthand modules interpret `meta` and `class` as config items +checkConfigOutput '^true$' options._module.args.value.result ./freeform-attrsOf.nix ./define-freeform-keywords-shorthand.nix # No freeform assignments shouldn't make it error checkConfigOutput '^{ }$' config ./freeform-attrsOf.nix # but only if the type matches -- cgit 1.4.1