Skip to content

Commit

Permalink
Added back validation of modules in "build" if present
Browse files Browse the repository at this point in the history
If they are there we should validate them, regardless of whether
they are required to be there.

Signed-off-by: Ole Herman Schumacher Elgesem <[email protected]>
  • Loading branch information
olehermanse committed Jan 9, 2024
1 parent d84324e commit 337f8cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cfbs/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,15 @@ def _validate_config_for_build_field(config, empty_build_list_ok=False):
user_error(
'The "build" field in ./cfbs.json must be a list (of modules involved in the build)'
)
if not empty_build_list_ok:
if config["build"] == []:
user_error(
"The \"build\" field in ./cfbs.json is empty - add modules with 'cfbs add'"
)
if len(config["build"]) > 0:
# If there are modules in "build" validate them:
for index, module in enumerate(config["build"]):
name = module["name"] if "name" in module else index
_validate_module_object("build", name, module, config)
elif not empty_build_list_ok:
user_error(
"The \"build\" field in ./cfbs.json is empty - add modules with 'cfbs add'"
)


def main():
Expand Down

0 comments on commit 337f8cd

Please sign in to comment.