Skip to content

Commit fcf1e58

Browse files
WIP
1 parent 5372eb5 commit fcf1e58

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
---
22
exclude: ^docs/ruby/ # All generated code
3-
default_language_version:
4-
python: python3.9
53

64
repos:
75
- repo: https://github.com/pre-commit/pre-commit-hooks

lib/yaml_resolver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def resolve(rel_path : str | Path, arch_root : str | Path, do_checks: bool) -> d
214214
exit(1)
215215
fn_name = Path(rel_path).stem
216216
if do_checks and (fn_name != unresolved_arch_data["name"]):
217-
print(f'ERROR: "name" key ({unresolved_arch_data["name"]}) must match filename ({fn_name} in {arch_root}/{rel_path}', file=sys.stderr)
217+
print(f'ERROR: \'name\' key ({unresolved_arch_data["name"]}) must match filename ({fn_name} in {arch_root}/{rel_path}', file=sys.stderr)
218218
exit(1)
219219
resolved_objs[str(rel_path)] = _resolve(unresolved_arch_data, [], rel_path, unresolved_arch_data, arch_root, do_checks)
220220
return resolved_objs[str(rel_path)]
@@ -266,11 +266,11 @@ def _resolve(obj, obj_path, obj_file_path, doc_obj, arch_root, do_checks):
266266

267267
if "$parent_of" in ref_obj:
268268
if isinstance(ref_obj["$parent_of"], list):
269-
ref_obj["$parent_of"].append(f'{obj_file_path}#/{"/".join(obj_path)}')
269+
ref_obj["$parent_of"].append(f"{obj_file_path}#/{'/'.join(obj_path)}")
270270
else:
271-
ref_obj["$parent_of"] = [ref_obj["$parent_of"], f'{obj_file_path}#/{"/".join(obj_path)}']
271+
ref_obj["$parent_of"] = [ref_obj["$parent_of"], f"{obj_file_path}#/{'/'.join(obj_path)}"]
272272
else:
273-
ref_obj["$parent_of"] = f'{obj_file_path}#/{"/".join(obj_path)}'
273+
ref_obj["$parent_of"] = f"{obj_file_path}#/{'/'.join(obj_path)}"
274274

275275
del obj["$inherits"]
276276

0 commit comments

Comments
 (0)