mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 15:37:27 -06:00
Report on all faulty keys at once instead of crashing on first
This makes it a lot easier to communicate back to users what is going wrong.
This commit is contained in:
parent
aa5b788b59
commit
c7c6389897
1 changed files with 4 additions and 1 deletions
|
@ -70,9 +70,12 @@ def test_validateOverridingDefaultValue(file_path: str):
|
||||||
if "overrides" not in doc:
|
if "overrides" not in doc:
|
||||||
return # No settings are being overridden. No need to check anything.
|
return # No settings are being overridden. No need to check anything.
|
||||||
parent_settings = getInheritedSettings(doc["inherits"])
|
parent_settings = getInheritedSettings(doc["inherits"])
|
||||||
|
faulty_keys = set()
|
||||||
for key, val in doc["overrides"].items():
|
for key, val in doc["overrides"].items():
|
||||||
if key in parent_settings and "value" in parent_settings[key]:
|
if key in parent_settings and "value" in parent_settings[key]:
|
||||||
assert "default_value" not in val, "Unnecessary default_value for {key} in {file_name}".format(key = key, file_name = file_path) # If there is a value in the parent settings, then the default_value is not effective.
|
if "default_value" in val:
|
||||||
|
faulty_keys.add(key)
|
||||||
|
assert not faulty_keys, "Unnecessary default_values for {faulty_keys} in {file_name}".format(faulty_keys = sorted(faulty_keys), file_name = file_path) # If there is a value in the parent settings, then the default_value is not effective.
|
||||||
|
|
||||||
## Get all settings and their properties from a definition we're inheriting
|
## Get all settings and their properties from a definition we're inheriting
|
||||||
# from.
|
# from.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue