From 577025e3462d309c921923207bcefd5afe60cae2 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 22:57:30 +0000 Subject: [PATCH] fix: resolve CI mypy type checking issues --- src/patternforge/template.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/patternforge/template.py b/src/patternforge/template.py index f8276a8..124b710 100644 --- a/src/patternforge/template.py +++ b/src/patternforge/template.py @@ -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)