From 53448ce341b6280f0a4967f100c1bd0d9f649965 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 18 Sep 2024 10:38:16 +0200 Subject: [PATCH] fixes for linting modules without an input --- nf_core/components/nfcore_component.py | 1 + nf_core/modules/lint/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nf_core/components/nfcore_component.py b/nf_core/components/nfcore_component.py index b6e3520ee..84c9a651e 100644 --- a/nf_core/components/nfcore_component.py +++ b/nf_core/components/nfcore_component.py @@ -184,6 +184,7 @@ def get_inputs_from_main_nf(self) -> None: # don't match anything inside comments or after "output:" if "input:" not in data: log.debug(f"Could not find any inputs in {self.main_nf}") + return input_data = data.split("input:")[1].split("output:")[0] for line in input_data.split("\n"): channel_elements: list[dict[str, dict[str, str]]] = [] diff --git a/nf_core/modules/lint/__init__.py b/nf_core/modules/lint/__init__.py index 43a5fe71e..49012cff4 100644 --- a/nf_core/modules/lint/__init__.py +++ b/nf_core/modules/lint/__init__.py @@ -288,7 +288,7 @@ def update_meta_yml_file(self, mod): if "output" in meta_yml: correct_outputs, meta_outputs = self.obtain_correct_and_specified_outputs(mod, meta_yml) - if correct_inputs != meta_inputs: + if "input" in meta_yml and correct_inputs != meta_inputs: log.debug( f"Correct inputs: '{correct_inputs}' differ from current inputs: '{meta_inputs}' in '{mod.meta_yml}'" ) @@ -319,7 +319,7 @@ def update_meta_yml_file(self, mod): ][feature] break - if correct_outputs != meta_outputs: + if "output" in meta_yml and correct_outputs != meta_outputs: log.debug( f"Correct outputs: '{correct_outputs}' differ from current outputs: '{meta_outputs}' in '{mod.meta_yml}'" )