fix: resolve CI mypy type checking issues
Some checks failed
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / build (push) Has been cancelled
CI / test (3.10) (push) Has been cancelled

This commit is contained in:
2026-02-02 22:57:30 +00:00
parent 889aa8d0e8
commit 577025e346

View File

@@ -158,7 +158,8 @@ class {{ class_name }} {
if not path.exists():
return None
with open(path) as f:
return yaml.safe_load(f)
result = yaml.safe_load(f)
return result if isinstance(result, dict) else None
def remove_template(self, name: str) -> bool:
path = self._get_template_path(name)
@@ -208,10 +209,10 @@ class {{ class_name }} {
with open(dst, "w") as f:
yaml.dump(data, f, default_flow_style=False)
else:
for f in src.glob("*.yaml"):
with open(f) as fp:
for yaml_file in src.glob("*.yaml"):
with open(yaml_file) as fp:
data = yaml.safe_load(fp)
out_path = dst / f.name
out_path = dst / yaml_file.name
if format == "json":
with open(out_path.with_suffix(".json"), "w") as fp:
json.dump(data, fp, indent=2)