@@ -71,11 +71,6 @@ def ensure_source(fname):
71
71
return ensure_ext (fname , extensions )
72
72
73
73
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
-
79
74
def ensure_json (fname ):
80
75
"""Return true if the path passed in specifies a JSON file"""
81
76
return ensure_ext (fname , ".json" )
@@ -169,38 +164,6 @@ def _validate_json(json_object: object, schema_name: str) -> bool:
169
164
return True
170
165
171
166
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
-
204
167
def _validate_toml (toml_object : object , schema_name : str ) -> bool :
205
168
"""
206
169
Validate TOML against a schema.
@@ -241,7 +204,7 @@ def _load_json(file_object: typing.TextIO, schema_name: str) -> object:
241
204
file_object : typing.TextIO
242
205
The file object to load from.
243
206
244
- schema_name : {'compiledb', 'config', ' coverage'}
207
+ schema_name : {'compiledb', 'coverage'}
245
208
The schema to validate against.
246
209
247
210
Returns
0 commit comments