diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 2672d1e21..b38c1ea5a 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -152,6 +152,12 @@ jobs: run: nf-core --log-file log.txt --hide-progress pipelines lint --dir my-prefix-testpipeline --fail-warned working-directory: create-test-lint-wf + # Run code style linting + - name: run pre-commit + shell: bash + run: pre-commit run --all-files + working-directory: create-test-lint-wf + # Run bump-version - name: nf-core pipelines bump-version run: nf-core --log-file log.txt pipelines bump-version --dir my-prefix-testpipeline/ 1.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index a449cf681..b15fe92c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ ### Linting +- General: Run pre-commit when testing linting the template pipeline ([#3280](https://github.com/nf-core/tools/pull/3280)) + ### Modules - add a panel around diff previews when updating ([#3246](https://github.com/nf-core/tools/pull/3246)) diff --git a/nf_core/pipeline-template/conf/modules.config b/nf_core/pipeline-template/conf/modules.config index 35e861d9b..1614e2b1a 100644 --- a/nf_core/pipeline-template/conf/modules.config +++ b/nf_core/pipeline-template/conf/modules.config @@ -18,13 +18,15 @@ process { saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] - {% if fastqc -%} + {%- if fastqc %} + withName: FASTQC { ext.args = '--quiet' } {%- endif %} {%- if multiqc %} + withName: 'MULTIQC' { ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } publishDir = [ diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index 6644d74a2..70bdc274e 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -109,8 +109,10 @@ workflow { {%- endif %} params.outdir, params.monochrome_logs, - {% if adaptivecard or slackreport %}params.hook_url,{% endif %} - {% if multiqc %}{{ prefix_nodash|upper }}_{{ short_name|upper }}.out.multiqc_report{% endif %} + {%- if adaptivecard or slackreport %} + params.hook_url,{% endif %} + {%- if multiqc %} + {{ prefix_nodash|upper }}_{{ short_name|upper }}.out.multiqc_report{% endif %} ) {%- endif %} } diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 599998f38..6970d0518 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -13,39 +13,47 @@ params { // Input options input = null - {% if igenomes -%} + {%- if igenomes %} + // References genome = null igenomes_base = 's3://ngi-igenomes/igenomes/' igenomes_ignore = false {%- endif %} - {% if multiqc -%} + {%- if multiqc %} + // MultiQC options multiqc_config = null multiqc_title = null multiqc_logo = null max_multiqc_email_size = '25.MB' - {% if citations %}multiqc_methods_description = null{% endif %} + {%- if citations %} + multiqc_methods_description = null{% endif %} {%- endif %} // Boilerplate options outdir = null - {% if modules %}publish_dir_mode = 'copy'{% endif %} + {%- if modules %} + publish_dir_mode = 'copy'{% endif %} {%- if email %} email = null email_on_fail = null plaintext_email = false {%- endif %} - {% if modules %}monochrome_logs = false{% endif %} - {% if slackreport or adaptivecard %}hook_url = null{% endif %} - {% if nf_schema %}help = false + {%- 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 %} version = false - {% if test_config %}pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/'{% endif %} + {%- if test_config %} + pipelines_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/'{% endif %} - {% if nf_core_configs -%} + {%- if nf_core_configs -%} // Config options config_profile_name = null config_profile_description = null @@ -56,7 +64,8 @@ params { config_profile_url = null {%- endif %} - {% if nf_schema -%} + {%- if nf_schema %} + // Schema validation default options validate_params = true {%- endif %} @@ -173,7 +182,7 @@ profiles { wave.freeze = true wave.strategy = 'conda,container' } - {% if gitpod -%} + {%- if gitpod %} gitpod { executor.name = 'local' executor.cpus = 4 @@ -187,7 +196,7 @@ profiles { } } {%- endif %} - {% if test_config -%} + {%- if test_config %} test { includeConfig 'conf/test.config' } test_full { includeConfig 'conf/test_full.config' } {%- endif %} diff --git a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf index 263eca55d..be5776b83 100644 --- a/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf @@ -128,8 +128,10 @@ workflow PIPELINE_COMPLETION { {%- endif %} outdir // path: Path to output directory where results will be published monochrome_logs // boolean: Disable ANSI colour codes in log output - {% if adaptivecard or slackreport %}hook_url // string: hook URL for notifications{% endif %} - {% if multiqc %}multiqc_report // string: Path to MultiQC report{% endif %} + {%- if adaptivecard or slackreport %} + hook_url // string: hook URL for notifications{% endif %} + {%- if multiqc %} + multiqc_report // string: Path to MultiQC report{% endif %} main: {%- if nf_schema %} @@ -237,8 +239,10 @@ def toolCitationText() { // Uncomment function in methodsDescriptionText to render in MultiQC report def citation_text = [ "Tools used in the workflow included:", - {% if fastqc %}"FastQC (Andrews 2010),",{% endif %} - {% if multiqc %}"MultiQC (Ewels et al. 2016)",{% endif %} + {%- if fastqc %} + "FastQC (Andrews 2010),",{% endif %} + {%- if multiqc %} + "MultiQC (Ewels et al. 2016)",{% endif %} "." ].join(' ').trim() @@ -250,8 +254,10 @@ def toolBibliographyText() { // Can use ternary operators to dynamically construct based conditions, e.g. params["run_xyz"] ? "