diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 85ce2230a..1fb521b4b 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -44,7 +44,7 @@ jobs: - name: Create Matrix id: create_matrix run: | - echo "matrix=$(yq 'keys | filter(. != "github") | filter(. != "is_nfcore") | filter(. != "test_config") | tojson(0)' nf_core/pipelines/create/templatefeatures.yml)" >> $GITHUB_OUTPUT + echo "matrix=$(yq 'keys | filter(. != "github") | filter(. != "is_nfcore") | filter(. != "test_config") | tojson(0)' nf_core/pipelines/create/template_features.yml)" >> $GITHUB_OUTPUT RunTestWorkflow: runs-on: ${{ matrix.runner }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e198caa5..8858c89bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - add option to exclude documentation from pipeline template ([#3130](https://github.com/nf-core/tools/pull/3130)) - add option to exclude test configs from pipeline template ([#3133](https://github.com/nf-core/tools/pull/3133)) - add option to exclude tower.yml from pipeline template ([#3134](https://github.com/nf-core/tools/pull/3134)) +- Add tests to ensure all files are part of a template customisation group and all groups are tested ([#3099](https://github.com/nf-core/tools/pull/3099)) ### Linting diff --git a/MANIFEST.in b/MANIFEST.in index 2bec40380..ce2e08c09 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,4 +10,4 @@ include nf_core/assets/logo/nf-core-repo-logo-base-darkbg.png include nf_core/assets/logo/placeholder_logo.svg include nf_core/assets/logo/MavenPro-Bold.ttf include nf_core/pipelines/create/create.tcss -include nf_core/pipelines/create/templatefeatures.yml +include nf_core/pipelines/create/template_features.yml diff --git a/nf_core/pipeline-template/README.md b/nf_core/pipeline-template/README.md index 1fa210c0e..beb45ed51 100644 --- a/nf_core/pipeline-template/README.md +++ b/nf_core/pipeline-template/README.md @@ -7,6 +7,10 @@ +{%- else %} + +# {{ name }} + {% endif -%} {% if github_badges -%} [![GitHub Actions CI Status](https://github.com/{{ name }}/actions/workflows/ci.yml/badge.svg)](https://github.com/{{ name }}/actions/workflows/ci.yml) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 7776bc03f..8201916b3 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -31,14 +31,14 @@ params { // Boilerplate options outdir = null - publish_dir_mode = 'copy' + {% if modules %}publish_dir_mode = 'copy'{% endif %} {%- if email %} email = null email_on_fail = null plaintext_email = false {%- endif %} - monochrome_logs = false - hook_url = null + {% if modules %}monochrome_logs = false{% endif %} + {% if slackreport or adaptivecard %}hook_url = null{% endif %} {% if nf_schema %}help = false help_full = false show_hidden = false{% endif %} @@ -62,9 +62,10 @@ params { max_cpus = 16 max_time = '240.h' + {%- if nf_schema %} // Schema validation default options validate_params = true - + {% endif %} } {% if modules %} // Load base.config by default for all pipelines diff --git a/nf_core/pipeline-template/nextflow_schema.json b/nf_core/pipeline-template/nextflow_schema.json index c84f652d0..446da25ae 100644 --- a/nf_core/pipeline-template/nextflow_schema.json +++ b/nf_core/pipeline-template/nextflow_schema.json @@ -184,6 +184,7 @@ "fa_icon": "fas fa-question-circle", "hidden": true }, + {%- if modules %} "publish_dir_mode": { "type": "string", "default": "copy", @@ -192,7 +193,7 @@ "fa_icon": "fas fa-copy", "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], "hidden": true - },{% if email %} + },{% endif %}{% if email %} "email_on_fail": { "type": "string", "description": "Email address for completion summary, only when pipeline fails.", @@ -215,21 +216,22 @@ "default": "25.MB", "fa_icon": "fas fa-file-upload", "hidden": true - }, - {% endif %} + },{% endif %} + {%- if modules %} "monochrome_logs": { "type": "boolean", "description": "Do not use coloured log outputs.", "fa_icon": "fas fa-palette", "hidden": true - }, + },{% endif %} + {%- if slackreport or adaptivecard %} "hook_url": { "type": "string", "description": "Incoming hook URL for messaging service", "fa_icon": "fas fa-people-group", "help_text": "Incoming hook URL for messaging service. Currently, MS Teams and Slack are supported.", "hidden": true - }, + },{% endif %} {%- if multiqc %} "multiqc_config": { "type": "string", diff --git a/nf_core/pipelines/create/templatefeatures.yml b/nf_core/pipelines/create/template_features.yml similarity index 95% rename from nf_core/pipelines/create/templatefeatures.yml rename to nf_core/pipelines/create/template_features.yml index d72e2cff7..b59a2e51a 100644 --- a/nf_core/pipelines/create/templatefeatures.yml +++ b/nf_core/pipelines/create/template_features.yml @@ -1,10 +1,18 @@ github: skippable_paths: - - ".github/" - - ".gitignore" - short_description: "Skip the creation of a local Git repository." - description: "" - help_text: "" + - ".github" + - ".gitattributes" + short_description: "Use a GitHub repository." + description: "Create a GitHub repository for the pipeline." + help_text: | + This will create a GitHub repository for the pipeline. + + The repository will include: + - Continuous Integration (CI) tests + - Issues and pull requests templates + + The initialisation of a git repository is required to use the nf-core/tools. + This means that even if you unselect this option, your pipeline will still contain a `.git` directory and `.gitignore` file. linting: files_exist: - ".github/ISSUE_TEMPLATE/bug_report.yml" @@ -12,7 +20,6 @@ github: - ".github/PULL_REQUEST_TEMPLATE.md" - ".github/CONTRIBUTING.md" - ".github/.dockstore.yml" - - ".gitignore" files_unchanged: - ".github/ISSUE_TEMPLATE/bug_report.yml" - ".github/ISSUE_TEMPLATE/config.yml" @@ -26,7 +33,7 @@ github: readme: - "nextflow_badge" nfcore_pipelines: False - custom_pipelines: False + custom_pipelines: True ci: skippable_paths: - ".github/workflows/" @@ -282,12 +289,22 @@ changelog: nf_schema: skippable_paths: - "subworkflows/nf-core/utils_nfschema_plugin" + - "nextflow_schema.json" + - "assets/schema_input.json" + - "assets/samplesheet.csv" short_description: "Use nf-schema" description: "Use the nf-schema Nextflow plugin for this pipeline." help_text: | [nf-schema](https://nextflow-io.github.io/nf-schema/latest/) is used to validate input parameters based on a JSON schema. It also provides helper functionality to create help messages, get a summary of changed parameters and validate and convert a samplesheet to a channel. + linting: + files_exist: + - "nextflow_schema.json" + schema_params: False + schema_lint: False + schema_description: False + nextflow_config: False nfcore_pipelines: True custom_pipelines: True license: diff --git a/nf_core/pipelines/create/utils.py b/nf_core/pipelines/create/utils.py index 0b72c2bcf..9b331c2a3 100644 --- a/nf_core/pipelines/create/utils.py +++ b/nf_core/pipelines/create/utils.py @@ -37,7 +37,7 @@ def init_context(value: Dict[str, Any]) -> Iterator[None]: NFCORE_PIPELINE_GLOBAL: bool = True # YAML file describing template features -features_yml_path = Path(nf_core.__file__).parent / "pipelines" / "create" / "templatefeatures.yml" +features_yml_path = Path(nf_core.__file__).parent / "pipelines" / "create" / "template_features.yml" class CreateConfig(NFCoreTemplateConfig): diff --git a/tests/pipelines/__snapshots__/test_create_app.ambr b/tests/pipelines/__snapshots__/test_create_app.ambr index 8a0f4dd68..6e3009e18 100644 --- a/tests/pipelines/__snapshots__/test_create_app.ambr +++ b/tests/pipelines/__snapshots__/test_create_app.ambr @@ -851,257 +851,257 @@ font-weight: 700; } - .terminal-2784035137-matrix { + .terminal-1208643741-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-2784035137-title { + .terminal-1208643741-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-2784035137-r1 { fill: #c5c8c6 } - .terminal-2784035137-r2 { fill: #e3e3e3 } - .terminal-2784035137-r3 { fill: #989898 } - .terminal-2784035137-r4 { fill: #e1e1e1 } - .terminal-2784035137-r5 { fill: #4ebf71;font-weight: bold } - .terminal-2784035137-r6 { fill: #1e1e1e } - .terminal-2784035137-r7 { fill: #507bb3 } - .terminal-2784035137-r8 { fill: #e2e2e2 } - .terminal-2784035137-r9 { fill: #808080 } - .terminal-2784035137-r10 { fill: #dde6ed;font-weight: bold } - .terminal-2784035137-r11 { fill: #001541 } - .terminal-2784035137-r12 { fill: #0178d4 } - .terminal-2784035137-r13 { fill: #454a50 } - .terminal-2784035137-r14 { fill: #e2e3e3;font-weight: bold } - .terminal-2784035137-r15 { fill: #000000 } - .terminal-2784035137-r16 { fill: #14191f } - .terminal-2784035137-r17 { fill: #e4e4e4 } - .terminal-2784035137-r18 { fill: #7ae998 } - .terminal-2784035137-r19 { fill: #0a180e;font-weight: bold } - .terminal-2784035137-r20 { fill: #008139 } - .terminal-2784035137-r21 { fill: #fea62b;font-weight: bold } - .terminal-2784035137-r22 { fill: #a7a9ab } - .terminal-2784035137-r23 { fill: #e2e3e3 } + .terminal-1208643741-r1 { fill: #c5c8c6 } + .terminal-1208643741-r2 { fill: #e3e3e3 } + .terminal-1208643741-r3 { fill: #989898 } + .terminal-1208643741-r4 { fill: #e1e1e1 } + .terminal-1208643741-r5 { fill: #4ebf71;font-weight: bold } + .terminal-1208643741-r6 { fill: #1e1e1e } + .terminal-1208643741-r7 { fill: #507bb3 } + .terminal-1208643741-r8 { fill: #e2e2e2 } + .terminal-1208643741-r9 { fill: #808080 } + .terminal-1208643741-r10 { fill: #dde6ed;font-weight: bold } + .terminal-1208643741-r11 { fill: #001541 } + .terminal-1208643741-r12 { fill: #14191f } + .terminal-1208643741-r13 { fill: #0178d4 } + .terminal-1208643741-r14 { fill: #454a50 } + .terminal-1208643741-r15 { fill: #e2e3e3;font-weight: bold } + .terminal-1208643741-r16 { fill: #000000 } + .terminal-1208643741-r17 { fill: #e4e4e4 } + .terminal-1208643741-r18 { fill: #7ae998 } + .terminal-1208643741-r19 { fill: #0a180e;font-weight: bold } + .terminal-1208643741-r20 { fill: #008139 } + .terminal-1208643741-r21 { fill: #fea62b;font-weight: bold } + .terminal-1208643741-r22 { fill: #a7a9ab } + .terminal-1208643741-r23 { fill: #e2e3e3 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - nf-core create + nf-core create - - - - nf-core create — Create a new pipeline with the nf-core pipeline template - - - Template features - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github CI testsThe pipeline will  Show help  - ▁▁▁▁▁▁▁▁include several GitHub▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - actions for Continuous - Integration (CI)  - testing - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Use reference genomesThe pipeline will be  Hide help  - ▁▁▁▁▁▁▁▁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. - ▅▅ - For more information about reference genomes in nf-core pipelines, see the  - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github badgesThe README.md file of  Show help  - ▁▁▁▁▁▁▁▁the pipeline will ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - include GitHub badges - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add configuration The pipeline will  Show help  - ▁▁▁▁▁▁▁▁        filesinclude configuration ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - profiles containing  - custom parameters  - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -  Back  Continue  - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -  d Toggle dark mode  q Quit  + + + + nf-core create — Create a new pipeline with the nf-core pipeline template + + + Template features + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use a GitHub Create a GitHub  Show help  + ▁▁▁▁▁▁▁▁        repository.repository for the ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + pipeline. + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github CI testsThe pipeline will  Show help  + ▁▁▁▁▁▁▁▁include several GitHub▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + actions for Continuous + Integration (CI)  + testing▄▄ + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use reference genomesThe pipeline will be  Hide help  + ▁▁▁▁▁▁▁▁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. + ▅▅ + For more information about reference genomes in nf-core pipelines, see the  + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github badgesThe README.md file of  Show help  + ▁▁▁▁▁▁▁▁the pipeline will ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + include GitHub badges + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +  Back  Continue  + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + +  d Toggle dark mode  q Quit  @@ -2233,254 +2233,255 @@ font-weight: 700; } - .terminal-1508200152-matrix { + .terminal-3747616910-matrix { font-family: Fira Code, monospace; font-size: 20px; line-height: 24.4px; font-variant-east-asian: full-width; } - .terminal-1508200152-title { + .terminal-3747616910-title { font-size: 18px; font-weight: bold; font-family: arial; } - .terminal-1508200152-r1 { fill: #c5c8c6 } - .terminal-1508200152-r2 { fill: #e3e3e3 } - .terminal-1508200152-r3 { fill: #989898 } - .terminal-1508200152-r4 { fill: #e1e1e1 } - .terminal-1508200152-r5 { fill: #4ebf71;font-weight: bold } - .terminal-1508200152-r6 { fill: #1e1e1e } - .terminal-1508200152-r7 { fill: #507bb3 } - .terminal-1508200152-r8 { fill: #e2e2e2 } - .terminal-1508200152-r9 { fill: #808080 } - .terminal-1508200152-r10 { fill: #dde6ed;font-weight: bold } - .terminal-1508200152-r11 { fill: #001541 } - .terminal-1508200152-r12 { fill: #454a50 } - .terminal-1508200152-r13 { fill: #7ae998 } - .terminal-1508200152-r14 { fill: #e2e3e3;font-weight: bold } - .terminal-1508200152-r15 { fill: #0a180e;font-weight: bold } - .terminal-1508200152-r16 { fill: #000000 } - .terminal-1508200152-r17 { fill: #008139 } - .terminal-1508200152-r18 { fill: #fea62b;font-weight: bold } - .terminal-1508200152-r19 { fill: #a7a9ab } - .terminal-1508200152-r20 { fill: #e2e3e3 } + .terminal-3747616910-r1 { fill: #c5c8c6 } + .terminal-3747616910-r2 { fill: #e3e3e3 } + .terminal-3747616910-r3 { fill: #989898 } + .terminal-3747616910-r4 { fill: #e1e1e1 } + .terminal-3747616910-r5 { fill: #4ebf71;font-weight: bold } + .terminal-3747616910-r6 { fill: #1e1e1e } + .terminal-3747616910-r7 { fill: #507bb3 } + .terminal-3747616910-r8 { fill: #e2e2e2 } + .terminal-3747616910-r9 { fill: #808080 } + .terminal-3747616910-r10 { fill: #dde6ed;font-weight: bold } + .terminal-3747616910-r11 { fill: #001541 } + .terminal-3747616910-r12 { fill: #14191f } + .terminal-3747616910-r13 { fill: #454a50 } + .terminal-3747616910-r14 { fill: #7ae998 } + .terminal-3747616910-r15 { fill: #e2e3e3;font-weight: bold } + .terminal-3747616910-r16 { fill: #0a180e;font-weight: bold } + .terminal-3747616910-r17 { fill: #000000 } + .terminal-3747616910-r18 { fill: #008139 } + .terminal-3747616910-r19 { fill: #fea62b;font-weight: bold } + .terminal-3747616910-r20 { fill: #a7a9ab } + .terminal-3747616910-r21 { fill: #e2e3e3 } - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - nf-core create + nf-core create - - - - nf-core create — Create a new pipeline with the nf-core pipeline template - - - Template features - - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github CI testsThe pipeline will  Show help  - ▁▁▁▁▁▁▁▁include several GitHub▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - actions for Continuous - Integration (CI)  - testing - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Use reference genomesThe pipeline will be  Show help  - ▁▁▁▁▁▁▁▁configured to use a ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - copy of the most  - common reference  - genome files from  - iGenomes - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Add Github badgesThe README.md file of  Show help  - ▁▁▁▁▁▁▁▁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 linters ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - and CI tests to lint  - your code: pre-commit, - editor-config and  - prettier. - - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -         Include citationsInclude pipeline tools Show help  - ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ -  Back  Continue  - ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ - -  d Toggle dark mode  q Quit  + + + + nf-core create — Create a new pipeline with the nf-core pipeline template + + + Template features + + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use a GitHub Create a GitHub  Show help  + ▁▁▁▁▁▁▁▁        repository.repository for the ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + pipeline. + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github CI testsThe pipeline will  Show help  + ▁▁▁▁▁▁▁▁include several GitHub▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + actions for Continuous + Integration (CI)  + testing + ▃▃ + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Use reference genomesThe pipeline will be  Show help  + ▁▁▁▁▁▁▁▁configured to use a ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + copy of the most  + common reference  + genome files from  + iGenomes + + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +         Add Github badgesThe README.md file of  Show help  + ▁▁▁▁▁▁▁▁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 linters ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + and CI tests to lint  + your code: pre-commit, + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ +  Back  Continue  + ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ + +  d Toggle dark mode  q Quit  diff --git a/tests/pipelines/test_create.py b/tests/pipelines/test_create.py index 13fd3b24c..f83cc274f 100644 --- a/tests/pipelines/test_create.py +++ b/tests/pipelines/test_create.py @@ -15,6 +15,7 @@ PIPELINE_TEMPLATE_YML = TEST_DATA_DIR / "pipeline_create_template.yml" PIPELINE_TEMPLATE_YML_SKIP = TEST_DATA_DIR / "pipeline_create_template_skip.yml" +PIPELINE_TEMPLATE = Path(nf_core.__file__).parent / "pipeline-template" class NfcoreCreateTest(unittest.TestCase): @@ -134,3 +135,41 @@ def test_pipeline_creation_with_yml_skip(self, tmp_path): assert not (pipeline.outdir / ".github").exists() assert not (pipeline.outdir / "conf" / "igenomes.config").exists() assert not (pipeline.outdir / ".editorconfig").exists() + + def test_template_customisation_all_files_grouping(self): + """Test that all pipeline template files are included in a pipeline customisation group.""" + template_features_yml = load_features_yaml() + base_required_files = [ + ".gitignore", + ".nf-core.yml", + "README.md", + "nextflow.config", + "CITATIONS.md", + "main.nf", + "workflows/pipeline.nf", + ] + all_skipped_files = [] + for feature in template_features_yml.keys(): + if template_features_yml[feature]["skippable_paths"]: + all_skipped_files.extend(template_features_yml[feature]["skippable_paths"]) + + for root, _, files in os.walk(PIPELINE_TEMPLATE): + for file in files: + str_path = str((Path(root) / file).relative_to(PIPELINE_TEMPLATE)) + if str_path not in base_required_files: + try: + assert ( + str_path in all_skipped_files + ), f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`." + except AssertionError: + if "/" in str_path: + # Check if the parent directory is in the skipped files + upper_dir_present = False + for i in range(1, len(str_path.split("/"))): + upper_dir = "/".join(str_path.split("/")[:i]) + if upper_dir in all_skipped_files: + upper_dir_present = True + break + assert upper_dir_present, f"Template file `{str_path}` not present in a group for pipeline customisation in `template_features.yml`." + else: + raise