Skip to content

Commit c4dd61d

Browse files
committed
Remove functionality related to YAML validation
Signed-off-by: John Pennycook <john.pennycook@intel.com>
1 parent e0c8515 commit c4dd61d

File tree

2 files changed

+1
-124
lines changed

2 files changed

+1
-124
lines changed

codebasin/schema/config.schema

Lines changed: 0 additions & 86 deletions
This file was deleted.

codebasin/util.py

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ def ensure_source(fname):
7171
return ensure_ext(fname, extensions)
7272

7373

74-
def ensure_yaml(fname):
75-
"""Return true if the path passed in specifies a YAML file"""
76-
return ensure_ext(fname, ".yaml")
77-
78-
7974
def ensure_json(fname):
8075
"""Return true if the path passed in specifies a JSON file"""
8176
return ensure_ext(fname, ".json")
@@ -169,38 +164,6 @@ def _validate_json(json_object: object, schema_name: str) -> bool:
169164
return True
170165

171166

172-
def _validate_yaml(yaml_object: object, schema_name: str) -> bool:
173-
"""
174-
Validate YAML against a schema.
175-
176-
Parameters
177-
----------
178-
yaml_object : Object
179-
The YAML to validate.
180-
181-
schema_name : {'config'}
182-
The schema to validate against.
183-
184-
Returns
185-
-------
186-
bool
187-
True if the YAML is valid.
188-
189-
Raises
190-
------
191-
ValueError
192-
If the YAML fails to validate, or the schema name is unrecognized.
193-
194-
RuntimeError
195-
If the schema file cannot be located.
196-
"""
197-
if schema_name != "config":
198-
raise ValueError("Unrecognized schema name.")
199-
200-
# We don't use any advanced features of YAML, so can use JSON here
201-
return _validate_json(yaml_object, schema_name)
202-
203-
204167
def _validate_toml(toml_object: object, schema_name: str) -> bool:
205168
"""
206169
Validate TOML against a schema.
@@ -241,7 +204,7 @@ def _load_json(file_object: typing.TextIO, schema_name: str) -> object:
241204
file_object : typing.TextIO
242205
The file object to load from.
243206
244-
schema_name : {'compiledb', 'config', 'coverage'}
207+
schema_name : {'compiledb', 'coverage'}
245208
The schema to validate against.
246209
247210
Returns

0 commit comments

Comments
 (0)