Skip to content

Commit 3ff7de9

Browse files
author
Steven Cartmell
committed
Remove config_path setting and amend regex in mbed config JSON schema
- Removed the config_path setting from schema and moved the addition of the config_path value after the validation is done. - Altered the macro validation regex to be more lenient. Now verifies that if '=' is used in the macro definition that something comes after it.
1 parent d208421 commit 3ff7de9

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

tools/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ def add_config_files(self, flist):
465465
sys.stderr.write(str(exc) + "\n")
466466
continue
467467

468-
cfg["__config_path"] = full_path
469-
470468
# Validate the format of the JSON file based on the schema_lib.json
471469
schema_path = os.path.join(os.path.dirname(__file__),
472470
"schema_lib.json")
@@ -477,6 +475,8 @@ def add_config_files(self, flist):
477475
if errors:
478476
raise ConfigException(",".join(x.message for x in errors))
479477

478+
cfg["__config_path"] = full_path
479+
480480
# If there's already a configuration for a module with the same
481481
# name, exit with error
482482
if self.lib_config_data.has_key(cfg["name"]):

tools/config/schema_app.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,9 @@
9595
"type": "array",
9696
"items": {
9797
"type": "string",
98-
"pattern": "^([A-Za-z0-9_]+|[A-Za-z0-9_]+=[0-9]+|[A-Za-z0-9_]+=\\\".*\\\")$"
98+
"pattern": "(^[\\w]+$|^[\\w]+=.+$)"
9999
}
100100
},
101-
"__config_path": {
102-
"description": "Path to configuration file",
103-
"type": "string"
104-
},
105101
"artifact_name": {
106102
"type": "string"
107103
}

tools/config/schema_lib.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@
9595
"type": "array",
9696
"items": {
9797
"type": "string",
98-
"pattern": "^([A-Za-z0-9_]+|[A-Za-z0-9_]+=[0-9]+|[A-Za-z0-9_]+=\\\".*\\\")$"
98+
"pattern": "(^[\\w]+$|^[\\w]+=.+$)"
9999
}
100-
},
101-
"__config_path": {
102-
"description": "Path to configuration file",
103-
"type": "string"
104100
}
105101
},
106102
"required": [

0 commit comments

Comments
 (0)