From 7a1c333a480f7ad9d6184e20933fe3b449d365a4 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 23 Mar 2021 13:31:17 +0100 Subject: [PATCH 1/4] Copy file if any exception with jinja in pipeline create --- nf_core/create.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nf_core/create.py b/nf_core/create.py index bf4271b6d3..85c60b7bc4 100644 --- a/nf_core/create.py +++ b/nf_core/create.py @@ -132,7 +132,11 @@ def render_template(self): except (AttributeError, UnicodeDecodeError) as e: log.debug(f"Copying file without Jinja: '{output_path}' - {e}") shutil.copy(template_fn_path, output_path) - continue + + # Something else went wrong + except Exception as e: + log.error(f"Copying raw file as error rendering with Jinja: '{output_path}' - {e}") + shutil.copy(template_fn_path, output_path) # Mirror file permissions template_stat = os.stat(template_fn_path) From 719d22d4666378e2dcaa02b2c0f41994f79d7a07 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 23 Mar 2021 13:31:37 +0100 Subject: [PATCH 2/4] Make lint summary table coloured according to overall status --- nf_core/lint/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nf_core/lint/__init__.py b/nf_core/lint/__init__.py index 338c908bbb..4d9c5de35d 100644 --- a/nf_core/lint/__init__.py +++ b/nf_core/lint/__init__.py @@ -318,14 +318,15 @@ def _s(some_list): console.print(table) # Summary table - table = Table(box=rich.box.ROUNDED) - table.add_column("[bold green]LINT RESULTS SUMMARY".format(len(self.passed)), no_wrap=True) - table.add_row(r"[✔] {:>3} Test{} Passed".format(len(self.passed), _s(self.passed)), style="green") + summary_colour = "red" if len(self.failed) > 0 else "green" + table = Table(box=rich.box.ROUNDED, style=summary_colour) + table.add_column(f"LINT RESULTS SUMMARY".format(len(self.passed)), no_wrap=True) + table.add_row(r"[green][✔] {:>3} Test{} Passed".format(len(self.passed), _s(self.passed))) if len(self.fix): - table.add_row(r"[?] {:>3} Test{} Fixed".format(len(self.fixed), _s(self.fixed)), style="bright_blue") - table.add_row(r"[?] {:>3} Test{} Ignored".format(len(self.ignored), _s(self.ignored)), style="grey58") - table.add_row(r"[!] {:>3} Test Warning{}".format(len(self.warned), _s(self.warned)), style="yellow") - table.add_row(r"[✗] {:>3} Test{} Failed".format(len(self.failed), _s(self.failed)), style="red") + table.add_row(r"[bright blue][?] {:>3} Test{} Fixed".format(len(self.fixed), _s(self.fixed))) + table.add_row(r"[grey58][?] {:>3} Test{} Ignored".format(len(self.ignored), _s(self.ignored))) + table.add_row(r"[yellow][!] {:>3} Test Warning{}".format(len(self.warned), _s(self.warned))) + table.add_row(r"[red][✗] {:>3} Test{} Failed".format(len(self.failed), _s(self.failed))) console.print(table) if len(self.could_fix): From 6084456892e7457d8f5bb971861ef9590a373ed5 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 23 Mar 2021 13:33:10 +0100 Subject: [PATCH 3/4] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b50dc04d..ff7a7847af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Fixed template creation error regarding file permissions [[#932](https://github.com/nf-core/tools/issues/932)] * Split the `create-lint-wf` tests up into separate steps in GitHub Actions to make the CI results easier to read * Added automated PR comments to the Markdownlint and Python Black lint CI tests to explain failures +* Make `nf-core lint` summary table borders coloured according to overall pass / fail status ## [v1.13.1 - Copper Crocodile Patch :crocodile: :pirate_flag:](https://github.com/nf-core/tools/releases/tag/1.13.1) - [2021-03-19] From 17fbcf8de2104aefc769850dc57e626ebb8bc4e5 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 23 Mar 2021 13:44:56 +0100 Subject: [PATCH 4/4] Use '21.03.0-edge' in bump-versions code --- nf_core/bump_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/bump_version.py b/nf_core/bump_version.py index 28e3f9eeaa..b770cb2e65 100644 --- a/nf_core/bump_version.py +++ b/nf_core/bump_version.py @@ -145,8 +145,8 @@ def bump_nextflow_version(pipeline_obj, new_version): pipeline_obj, [ ( - r"nxf_ver: \[[\'\"]?{}[\'\"]?, ''\]".format(current_version.replace(".", r"\.")), - "nxf_ver: ['{}', '']".format(new_version), + r"nxf_ver: \[[\'\"]?{}[\'\"]?, '21.03.0-edge'\]".format(current_version.replace(".", r"\.")), + "nxf_ver: ['{}', '21.03.0-edge']".format(new_version), ) ], )