Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit hook astral-sh/ruff-pre-commit to v0.9.3 #3413

Merged
merged 4 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix mypy error
mashehu committed Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tdmorello Tim Morello
commit 61d971045728307963752d534ad3f6898ab49071
2 changes: 1 addition & 1 deletion nf_core/modules/lint/meta_yml.py
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ def meta_yml(module_lint_object: ComponentLint, module: NFCoreComponent, allow_m
).get("meta.yml")
if lines is not None:
yaml = ruamel.yaml.YAML()
meta_yaml = yaml.safe_load("".join(lines))
meta_yaml = yaml.load("".join(lines))
if meta_yaml is None:
module.failed.append(("meta_yml_exists", "Module `meta.yml` does not exist", module.meta_yml))
return
7 changes: 4 additions & 3 deletions nf_core/subworkflows/lint/meta_yml.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from pathlib import Path

import jsonschema.validators
import yaml
import ruamel.yaml

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

try:
with open(subworkflow.meta_yml) as fh:
meta_yaml = yaml.safe_load(fh)
yaml = ruamel.yaml.YAML(typ="safe")
meta_yaml = yaml.load(fh)
subworkflow.passed.append(("meta_yml_exists", "Subworkflow `meta.yml` exists", subworkflow.meta_yml))
except FileNotFoundError:
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):
if len(e.path) > 0:
hint = f"\nCheck the entry for `{e.path[0]}`."
if e.message.startswith("None is not of type 'object'") and len(e.path) > 2:
hint = f"\nCheck that the child entries of {e.path[0] + '.' + e.path[2]} are indented correctly."
hint = f"\nCheck that the child entries of {str(e.path[0]) + '.' + str(e.path[2])} are indented correctly."
subworkflow.failed.append(
(
"meta_yml_valid",