Skip to content

Commit 61d9710

Browse files
committed
fix mypy error
1 parent 3048627 commit 61d9710

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

nf_core/modules/lint/meta_yml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
6262
).get("meta.yml")
6363
if lines is not None:
6464
yaml = ruamel.yaml.YAML()
65-
meta_yaml = yaml.safe_load("".join(lines))
65+
meta_yaml = yaml.load("".join(lines))
6666
if meta_yaml is None:
6767
module.failed.append(("meta_yml_exists", "Module `meta.yml` does not exist", module.meta_yml))
6868
return

nf_core/subworkflows/lint/meta_yml.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44

55
import jsonschema.validators
6-
import yaml
6+
import ruamel.yaml
77

88
import nf_core.components.components_utils
99
from nf_core.components.lint import LintExceptionError
@@ -43,7 +43,8 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):
4343

4444
try:
4545
with open(subworkflow.meta_yml) as fh:
46-
meta_yaml = yaml.safe_load(fh)
46+
yaml = ruamel.yaml.YAML(typ="safe")
47+
meta_yaml = yaml.load(fh)
4748
subworkflow.passed.append(("meta_yml_exists", "Subworkflow `meta.yml` exists", subworkflow.meta_yml))
4849
except FileNotFoundError:
4950
subworkflow.failed.append(("meta_yml_exists", "Subworkflow `meta.yml` does not exist", subworkflow.meta_yml))
@@ -62,7 +63,7 @@ def meta_yml(subworkflow_lint_object, subworkflow, allow_missing: bool = False):
6263
if len(e.path) > 0:
6364
hint = f"\nCheck the entry for `{e.path[0]}`."
6465
if e.message.startswith("None is not of type 'object'") and len(e.path) > 2:
65-
hint = f"\nCheck that the child entries of {e.path[0] + '.' + e.path[2]} are indented correctly."
66+
hint = f"\nCheck that the child entries of {str(e.path[0]) + '.' + str(e.path[2])} are indented correctly."
6667
subworkflow.failed.append(
6768
(
6869
"meta_yml_valid",

0 commit comments

Comments
 (0)