From a59f497a20487ecc7bc15a0cc4c09ffef855f365 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Mon, 22 Mar 2021 09:09:19 +0100 Subject: [PATCH 1/3] fix bug for updated messages --- nf_core/modules/lint.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index 909dd91170..285fb2798e 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -375,7 +375,6 @@ def check_module_changes(self, nfcore_modules): Downloads the 'main.nf', 'functions.nf' and 'meta.yml' files for every module and compare them to the local copies """ - all_modules_up_to_date = True files_to_check = ["main.nf", "functions.nf", "meta.yml"] progress_bar = rich.progress.Progress( @@ -420,13 +419,21 @@ def check_module_changes(self, nfcore_modules): remote_copy = r.content.decode("utf-8") if local_copy != remote_copy: - all_modules_up_to_date = False self.warned.append( LintResult( mod, "check_local_copy", "Local copy of module outdated", - f"{os.path.join(mod.module_dir, f)}", + f"{os.path.join(mod.module_dir, f)}" + ) + ) + else: + self.passed.append( + LintResult( + mod, + "check_local_copy", + "Local copy of module up to date", + f"{os.path.join(mod.module_dir, f)}" ) ) except UnicodeDecodeError as e: @@ -435,12 +442,10 @@ def check_module_changes(self, nfcore_modules): mod, "check_local_copy", f"Could not decode file from {url}. Skipping comparison ({e})", - f"{os.path.join(mod.module_dir, f)}", + f"{os.path.join(mod.module_dir, f)}" ) ) - if all_modules_up_to_date: - self.passed.append("All modules are up to date!") class NFCoreModule(object): From d1a9fb7e7a59df5dcd5b739f0a4fdafbbfa331e5 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Mon, 22 Mar 2021 09:12:11 +0100 Subject: [PATCH 2/3] update pytests --- tests/test_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_modules.py b/tests/test_modules.py index 5296270092..b4809dd270 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -83,7 +83,7 @@ def test_modules_lint_fastqc(self): self.mods.install("fastqc") module_lint = nf_core.modules.ModuleLint(dir=self.pipeline_dir) module_lint.lint(print_results=False, all_modules=True) - assert len(module_lint.passed) == 16 + assert len(module_lint.passed) == 18 assert len(module_lint.warned) == 0 assert len(module_lint.failed) == 0 From 153e5fa943a9b6f0bb61411b24fc770a79818668 Mon Sep 17 00:00:00 2001 From: kevinmenden Date: Mon, 22 Mar 2021 09:15:06 +0100 Subject: [PATCH 3/3] black --- nf_core/modules/lint.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index 285fb2798e..c5dc501a5b 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -424,7 +424,7 @@ def check_module_changes(self, nfcore_modules): mod, "check_local_copy", "Local copy of module outdated", - f"{os.path.join(mod.module_dir, f)}" + f"{os.path.join(mod.module_dir, f)}", ) ) else: @@ -433,7 +433,7 @@ def check_module_changes(self, nfcore_modules): mod, "check_local_copy", "Local copy of module up to date", - f"{os.path.join(mod.module_dir, f)}" + f"{os.path.join(mod.module_dir, f)}", ) ) except UnicodeDecodeError as e: @@ -442,12 +442,11 @@ def check_module_changes(self, nfcore_modules): mod, "check_local_copy", f"Could not decode file from {url}. Skipping comparison ({e})", - f"{os.path.join(mod.module_dir, f)}" + f"{os.path.join(mod.module_dir, f)}", ) ) - class NFCoreModule(object): """ A class to hold the information a bout a nf-core module