conf: ensure that "hidden" features actually exist during validation
This commit is contained in:
parent
1c970e51fd
commit
e7946fa571
2 changed files with 5 additions and 1 deletions
|
@ -468,6 +468,10 @@ class TomlConf:
|
||||||
for enabled in enable_list:
|
for enabled in enable_list:
|
||||||
if enabled not in features:
|
if enabled not in features:
|
||||||
raise ConfError(f'Unrecognized "enabled" feature: {enabled!r}')
|
raise ConfError(f'Unrecognized "enabled" feature: {enabled!r}')
|
||||||
|
if hide_list := features_list.get("hide"):
|
||||||
|
for hidden in hide_list:
|
||||||
|
if hidden not in features:
|
||||||
|
raise ConfError(f'Unrecognized "hidden" feature: {hidden!r}')
|
||||||
|
|
||||||
if requires_table := toml.get("requires"):
|
if requires_table := toml.get("requires"):
|
||||||
if features_list := requires_table.get("features"):
|
if features_list := requires_table.get("features"):
|
||||||
|
|
|
@ -92,7 +92,7 @@ def test_ini_conf_load(
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"chrono-0.4.23.rust2rpm.toml",
|
"chrono-0.4.23.rust2rpm.toml",
|
||||||
set(),
|
{"__doctest"},
|
||||||
TomlConf(
|
TomlConf(
|
||||||
{
|
{
|
||||||
"features": {
|
"features": {
|
||||||
|
|
Loading…
Reference in a new issue