fix: resolve CI mypy type checking issues
This commit is contained in:
@@ -158,7 +158,8 @@ class {{ class_name }} {
|
|||||||
if not path.exists():
|
if not path.exists():
|
||||||
return None
|
return None
|
||||||
with open(path) as f:
|
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:
|
def remove_template(self, name: str) -> bool:
|
||||||
path = self._get_template_path(name)
|
path = self._get_template_path(name)
|
||||||
@@ -208,10 +209,10 @@ class {{ class_name }} {
|
|||||||
with open(dst, "w") as f:
|
with open(dst, "w") as f:
|
||||||
yaml.dump(data, f, default_flow_style=False)
|
yaml.dump(data, f, default_flow_style=False)
|
||||||
else:
|
else:
|
||||||
for f in src.glob("*.yaml"):
|
for yaml_file in src.glob("*.yaml"):
|
||||||
with open(f) as fp:
|
with open(yaml_file) as fp:
|
||||||
data = yaml.safe_load(fp)
|
data = yaml.safe_load(fp)
|
||||||
out_path = dst / f.name
|
out_path = dst / yaml_file.name
|
||||||
if format == "json":
|
if format == "json":
|
||||||
with open(out_path.with_suffix(".json"), "w") as fp:
|
with open(out_path.with_suffix(".json"), "w") as fp:
|
||||||
json.dump(data, fp, indent=2)
|
json.dump(data, fp, indent=2)
|
||||||
|
|||||||
Reference in New Issue
Block a user