Skip to content

Commit 9ba68ae

Browse files
Merge branch 'main' into issue-276-retire-MC-1-Google-Doc
2 parents fcbde54 + 3dde85f commit 9ba68ae

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.pre-commit-config.yaml

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

46
repos:
57
- 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)