From 26769f2eb5568d56977023a88f142e0d28da7e0f Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 7 Aug 2024 12:44:24 +0200 Subject: [PATCH 1/3] add option to exclude changelog from custom pipeline template --- .github/workflows/create-test-lint-wf-template.yml | 5 +++++ nf_core/pipelines/create/create.py | 6 ++++++ nf_core/pipelines/create/custompipeline.py | 11 +++++++++++ tests/data/pipeline_create_template_skip.yml | 1 + 4 files changed, 23 insertions(+) diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index c4eca40fa6..b4022d780a 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -44,6 +44,7 @@ jobs: - "template_skip_code_linters.yml" - "template_skip_citations.yml" - "template_skip_gitpod.yml" + - "template_skip_changelog.yml" runner: # use the runner given by the input if it is dispatched manually, run on github if it is a rerun or on self-hosted by default - ${{ github.event.inputs.runners || github.run_number > 1 && 'ubuntu-latest' || 'self-hosted' }} @@ -117,6 +118,10 @@ jobs: run: | printf "org: my-prefix\nskip: gitpod" > create-test-lint-wf/template_skip_gitpod.yml + - name: Create template skip changelog + run: | + printf "org: my-prefix\nskip: changelog" > create-test-lint-wf/template_skip_changelog.yml + # Create a pipeline from the template - name: create a pipeline from the template ${{ matrix.TEMPLATE }} run: | diff --git a/nf_core/pipelines/create/create.py b/nf_core/pipelines/create/create.py index 05a5804ee3..27dc729439 100644 --- a/nf_core/pipelines/create/create.py +++ b/nf_core/pipelines/create/create.py @@ -103,6 +103,7 @@ def __init__( ], "citations": ["assets/methods_description_template.yml"], "gitpod": [".gitpod.yml"], + "changelog": ["CHANGELOG.md"], } # Get list of files we're skipping with the supplied skip keys self.skip_paths = set(sp for k in skip_paths for sp in skippable_paths[k]) @@ -214,6 +215,7 @@ def obtain_jinja_params_dict(self, features_to_skip, pipeline_dir): "code_linters": {"file": True, "content": True}, "citations": {"file": True, "content": True}, "gitpod": {"file": True, "content": True}, + "changelog": {"file": True, "content": False}, } # Set the parameters for the jinja template @@ -509,6 +511,10 @@ def fix_linting(self): if not self.jinja_params["github_badges"] or not self.jinja_params["github"]: lint_config["readme"] = ["nextflow_badge"] + # Add changelog specific configurations + if not self.jinja_params["changelog"]: + lint_config["files_exist"].extend(["CHANGELOG.md"]) + # If the pipeline is not nf-core if not self.config.is_nfcore: lint_config["files_unchanged"].extend([".github/ISSUE_TEMPLATE/bug_report.yml"]) diff --git a/nf_core/pipelines/create/custompipeline.py b/nf_core/pipelines/create/custompipeline.py index 5f131a7d84..c39c26507e 100644 --- a/nf_core/pipelines/create/custompipeline.py +++ b/nf_core/pipelines/create/custompipeline.py @@ -65,6 +65,11 @@ This is useful to have all the tools ready for pipeline development. """ +markdown_changelog = """ +Having a `CHANGELOG.md` file in the pipeline root directory is useful to track the changes added to each version. +You can read more information on the recommended format here: https://keepachangelog.com/en/1.0.0/ +""" + class CustomPipeline(Screen): """Select if the pipeline will use genomic data.""" @@ -122,6 +127,12 @@ def compose(self) -> ComposeResult: "Include the configuration required to use Gitpod.", "gitpod", ), + PipelineFeature( + markdown_changelog, + "Add a changelog", + "Add a CHANGELOG.md file.", + "changelog", + ), classes="features-container", ) yield Center( diff --git a/tests/data/pipeline_create_template_skip.yml b/tests/data/pipeline_create_template_skip.yml index 1431114c08..ed0b5ef2ad 100644 --- a/tests/data/pipeline_create_template_skip.yml +++ b/tests/data/pipeline_create_template_skip.yml @@ -14,3 +14,4 @@ skip_features: - code_linters - citations - gitpod + - changelog From 4d55d7a3382e85efc8be610a8ed3211969626206 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Wed, 7 Aug 2024 11:16:38 +0000 Subject: [PATCH 2/3] [automated] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 765507c4e1..52654b5dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - add option to exclude code linters for custom pipeline template ([#3084](https://github.com/nf-core/tools/pull/3084)) - add option to exclude citations for custom pipeline template ([#3101](https://github.com/nf-core/tools/pull/3101)) - add option to exclude gitpod for custom pipeline template ([#3100](https://github.com/nf-core/tools/pull/3100)) +- add option to exclude changelog from custom pipeline template ([#3104](https://github.com/nf-core/tools/pull/3104)) ### Linting From 8b196cd9a2601e9f05270bbd4bac629cc0b8c823 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Wed, 7 Aug 2024 16:12:04 +0200 Subject: [PATCH 3/3] update textual snapshots --- tests/__snapshots__/test_create_app.ambr | 512 +++++++++++------------ 1 file changed, 256 insertions(+), 256 deletions(-) diff --git a/tests/__snapshots__/test_create_app.ambr b/tests/__snapshots__/test_create_app.ambr index 9aad37cc96..231c038c66 100644 --- a/tests/__snapshots__/test_create_app.ambr +++ b/tests/__snapshots__/test_create_app.ambr @@ -851,257 +851,257 @@ font-weight: 700; } - .terminal-2285198722-matrix { + .terminal-1308777655-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-2285198722-title { + .terminal-1308777655-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-2285198722-r1 { fill: #c5c8c6 } - .terminal-2285198722-r2 { fill: #e3e3e3 } - .terminal-2285198722-r3 { fill: #989898 } - .terminal-2285198722-r4 { fill: #e1e1e1 } - .terminal-2285198722-r5 { fill: #4ebf71;font-weight: bold } - .terminal-2285198722-r6 { fill: #1e1e1e } - .terminal-2285198722-r7 { fill: #0178d4 } - .terminal-2285198722-r8 { fill: #454a50 } - .terminal-2285198722-r9 { fill: #e2e2e2 } - .terminal-2285198722-r10 { fill: #808080 } - .terminal-2285198722-r11 { fill: #e2e3e3;font-weight: bold } - .terminal-2285198722-r12 { fill: #000000 } - .terminal-2285198722-r13 { fill: #e4e4e4 } - .terminal-2285198722-r14 { fill: #14191f } - .terminal-2285198722-r15 { fill: #507bb3 } - .terminal-2285198722-r16 { fill: #dde6ed;font-weight: bold } - .terminal-2285198722-r17 { fill: #001541 } - .terminal-2285198722-r18 { fill: #7ae998 } - .terminal-2285198722-r19 { fill: #0a180e;font-weight: bold } - .terminal-2285198722-r20 { fill: #008139 } - .terminal-2285198722-r21 { fill: #fea62b;font-weight: bold } - .terminal-2285198722-r22 { fill: #a7a9ab } - .terminal-2285198722-r23 { fill: #e2e3e3 } + .terminal-1308777655-r1 { fill: #c5c8c6 } + .terminal-1308777655-r2 { fill: #e3e3e3 } + .terminal-1308777655-r3 { fill: #989898 } + .terminal-1308777655-r4 { fill: #e1e1e1 } + .terminal-1308777655-r5 { fill: #4ebf71;font-weight: bold } + .terminal-1308777655-r6 { fill: #1e1e1e } + .terminal-1308777655-r7 { fill: #0178d4 } + .terminal-1308777655-r8 { fill: #454a50 } + .terminal-1308777655-r9 { fill: #e2e2e2 } + .terminal-1308777655-r10 { fill: #808080 } + .terminal-1308777655-r11 { fill: #e2e3e3;font-weight: bold } + .terminal-1308777655-r12 { fill: #000000 } + .terminal-1308777655-r13 { fill: #e4e4e4 } + .terminal-1308777655-r14 { fill: #14191f } + .terminal-1308777655-r15 { fill: #507bb3 } + .terminal-1308777655-r16 { fill: #dde6ed;font-weight: bold } + .terminal-1308777655-r17 { fill: #001541 } + .terminal-1308777655-r18 { fill: #7ae998 } + .terminal-1308777655-r19 { fill: #0a180e;font-weight: bold } + .terminal-1308777655-r20 { fill: #008139 } + .terminal-1308777655-r21 { fill: #fea62b;font-weight: bold } + .terminal-1308777655-r22 { fill: #a7a9ab } + .terminal-1308777655-r23 { fill: #e2e3e3 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - nf-core create + nf-core create - - - - nf-core create — Create a new pipeline with the nf-core pipeline template - - - Template features - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Use reference The pipeline will  Hide help  - ▁▁▁▁▁▁▁▁        genomesbe configured to ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - use a copy of the  - most common  - reference genome  - files from  - iGenomes - - - Nf-core pipelines are configured to use a copy of the most common  - reference genome files. - - By selecting this option, your pipeline will include a configuration - file specifying the paths to these files. - - The required code to use these files will also be included in the  - template. When the pipeline user provides an appropriate genome key,▁▁ - the pipeline will automatically download the required reference ▂▂ - files. - - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github CI The pipeline will  Show help  - ▁▁▁▁▁▁▁▁        testsinclude several ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - GitHub actions for - Continuous  - Integration (CI)  - testing - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github badgesThe README.md file Show help  - ▁▁▁▁▁▁▁▁of the pipeline ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - will include  - GitHub badges - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -  Back  Continue  - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -  d Toggle dark mode  q Quit  + + + + nf-core create — Create a new pipeline with the nf-core pipeline template + + + Template features + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use reference The pipeline will  Hide help  + ▁▁▁▁▁▁▁▁        genomesbe configured to ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + use a copy of the  + most common  + reference genome  + files from  + iGenomes + + + Nf-core pipelines are configured to use a copy of the most common  + reference genome files. + + By selecting this option, your pipeline will include a configuration + file specifying the paths to these files. + + The required code to use these files will also be included in the  + template. When the pipeline user provides an appropriate genome key, + the pipeline will automatically download the required reference ▂▂ + files. + + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github CI The pipeline will  Show help  + ▁▁▁▁▁▁▁▁        testsinclude several ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + GitHub actions for + Continuous  + Integration (CI)  + testing + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github badgesThe README.md file Show help  + ▁▁▁▁▁▁▁▁of the pipeline ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + will include  + GitHub badges + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +  Back  Continue  + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + +  d Toggle dark mode  q Quit  @@ -2233,255 +2233,255 @@ font-weight: 700; } - .terminal-3802907671-matrix { + .terminal-557041160-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-3802907671-title { + .terminal-557041160-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-3802907671-r1 { fill: #c5c8c6 } - .terminal-3802907671-r2 { fill: #e3e3e3 } - .terminal-3802907671-r3 { fill: #989898 } - .terminal-3802907671-r4 { fill: #e1e1e1 } - .terminal-3802907671-r5 { fill: #4ebf71;font-weight: bold } - .terminal-3802907671-r6 { fill: #1e1e1e } - .terminal-3802907671-r7 { fill: #507bb3 } - .terminal-3802907671-r8 { fill: #e2e2e2 } - .terminal-3802907671-r9 { fill: #808080 } - .terminal-3802907671-r10 { fill: #dde6ed;font-weight: bold } - .terminal-3802907671-r11 { fill: #001541 } - .terminal-3802907671-r12 { fill: #14191f } - .terminal-3802907671-r13 { fill: #454a50 } - .terminal-3802907671-r14 { fill: #7ae998 } - .terminal-3802907671-r15 { fill: #e2e3e3;font-weight: bold } - .terminal-3802907671-r16 { fill: #0a180e;font-weight: bold } - .terminal-3802907671-r17 { fill: #000000 } - .terminal-3802907671-r18 { fill: #008139 } - .terminal-3802907671-r19 { fill: #fea62b;font-weight: bold } - .terminal-3802907671-r20 { fill: #a7a9ab } - .terminal-3802907671-r21 { fill: #e2e3e3 } + .terminal-557041160-r1 { fill: #c5c8c6 } + .terminal-557041160-r2 { fill: #e3e3e3 } + .terminal-557041160-r3 { fill: #989898 } + .terminal-557041160-r4 { fill: #e1e1e1 } + .terminal-557041160-r5 { fill: #4ebf71;font-weight: bold } + .terminal-557041160-r6 { fill: #1e1e1e } + .terminal-557041160-r7 { fill: #507bb3 } + .terminal-557041160-r8 { fill: #e2e2e2 } + .terminal-557041160-r9 { fill: #808080 } + .terminal-557041160-r10 { fill: #dde6ed;font-weight: bold } + .terminal-557041160-r11 { fill: #001541 } + .terminal-557041160-r12 { fill: #14191f } + .terminal-557041160-r13 { fill: #454a50 } + .terminal-557041160-r14 { fill: #7ae998 } + .terminal-557041160-r15 { fill: #e2e3e3;font-weight: bold } + .terminal-557041160-r16 { fill: #0a180e;font-weight: bold } + .terminal-557041160-r17 { fill: #000000 } + .terminal-557041160-r18 { fill: #008139 } + .terminal-557041160-r19 { fill: #fea62b;font-weight: bold } + .terminal-557041160-r20 { fill: #a7a9ab } + .terminal-557041160-r21 { fill: #e2e3e3 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - nf-core create + nf-core create - - - - nf-core create — Create a new pipeline with the nf-core pipeline template - - - Template features - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Use reference The pipeline will  Show help  - ▁▁▁▁▁▁▁▁        genomesbe configured to ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - use a copy of the  - most common  - reference genome  - files from  - iGenomes - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github CI The pipeline will  Show help  - ▁▁▁▁▁▁▁▁        testsinclude several ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - GitHub actions for - Continuous  - Integration (CI)  - testing - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github badgesThe README.md file Show help  - ▁▁▁▁▁▁▁▁of the pipeline ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - will include  - GitHub badges▃▃ - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add configuration         The pipeline will  Show help  - ▁▁▁▁▁▁▁▁        filesinclude ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - configuration  - profiles  - containing custom  - parameters  - requried to run  - nf-core pipelines  - at different  - institutions - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Use code lintersThe pipeline will  Show help  - ▁▁▁▁▁▁▁▁include code ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -  Back  Continue  - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -  d Toggle dark mode  q Quit  + + + + nf-core create — Create a new pipeline with the nf-core pipeline template + + + Template features + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use reference The pipeline will  Show help  + ▁▁▁▁▁▁▁▁        genomesbe configured to ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + use a copy of the  + most common  + reference genome  + files from  + iGenomes + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github CI The pipeline will  Show help  + ▁▁▁▁▁▁▁▁        testsinclude several ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + GitHub actions for + Continuous  + Integration (CI)  + testing + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github badgesThe README.md file Show help  + ▁▁▁▁▁▁▁▁of the pipeline ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + will include ▅▅ + GitHub badges + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add configuration         The pipeline will  Show help  + ▁▁▁▁▁▁▁▁        filesinclude ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + configuration  + profiles  + containing custom  + parameters  + requried to run  + nf-core pipelines  + at different  + institutions + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use code lintersThe pipeline will  Show help  + ▁▁▁▁▁▁▁▁include code ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +  Back  Continue  + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + +  d Toggle dark mode  q Quit