From e71d85b5ce9c5000a4d111b2526ed9f7e69c4f7f Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 19 Mar 2021 10:10:42 +0100 Subject: [PATCH 1/3] added check for missing emit statement --- nf_core/modules/lint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index 00ef496e9d..fe773690bf 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -261,7 +261,6 @@ def _print_results(self, show_passed=False): log.debug("Printing final results") console = Console(force_terminal=rich_force_colors()) - # Find maximum module name length max_mod_name_len = 40 for idx, tests in enumerate([self.passed, self.warned, self.failed]): @@ -794,7 +793,8 @@ def _parse_output(self, line): output = [] if "meta" in line: output.append("meta") - # TODO: should we ignore outputs without emit statement? + if not "emit" in line: + self.failed.append(("missing_emit", f"Missing emit statement: {line}", self.main_nf)) if "emit" in line: output.append(line.split("emit:")[1].strip()) From 95ea08bc85f28132c0399638ea52d05cc240ee1b Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 19 Mar 2021 10:20:09 +0100 Subject: [PATCH 2/3] fixed conda version warning --- nf_core/modules/lint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index fe773690bf..0c6ade24a5 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -721,9 +721,9 @@ def check_process_section(self, lines): # response = _bioconda_package(bp) response = nf_core.utils.anaconda_package(bp) except LookupError as e: - self.warned.append(e) + self.warned.append(("bioconda_version", "Conda version not specified correctly", self.main_nf)) except ValueError as e: - self.failed.append(e) + self.failed.append(("bioconda_version", "Conda version not specified correctly", self.main_nf)) else: # Check that required version is available at all if bioconda_version not in response.get("versions"): From 1d3f7167d96bd845b6a15124120bd6f21dc17e6d Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Fri, 19 Mar 2021 10:35:04 +0100 Subject: [PATCH 3/3] remove extra space --- nf_core/modules/lint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index 0c6ade24a5..59229cffcd 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -794,7 +794,7 @@ def _parse_output(self, line): if "meta" in line: output.append("meta") if not "emit" in line: - self.failed.append(("missing_emit", f"Missing emit statement: {line}", self.main_nf)) + self.failed.append(("missing_emit", f"Missing emit statement: {line.strip()}", self.main_nf)) if "emit" in line: output.append(line.split("emit:")[1].strip())