From d20dc69595f596a1d90daeb07eebcb9703a0b4f1 Mon Sep 17 00:00:00 2001 From: maxulysse Date: Tue, 19 Aug 2025 18:02:23 +0200 Subject: [PATCH] lint + code polish unzip --- modules/nf-core/unzip/main.nf | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/nf-core/unzip/main.nf b/modules/nf-core/unzip/main.nf index a0c02109cde8..39a6e9832cfe 100644 --- a/modules/nf-core/unzip/main.nf +++ b/modules/nf-core/unzip/main.nf @@ -1,32 +1,34 @@ process UNZIP { - tag "$archive" + tag "${archive}" label 'process_single' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/p7zip:16.02' : - 'biocontainers/p7zip:16.02' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://depot.galaxyproject.org/singularity/p7zip:16.02' + : 'biocontainers/p7zip:16.02'}" input: tuple val(meta), path(archive) output: tuple val(meta), path("${prefix}/"), emit: unzipped_archive - path "versions.yml" , emit: versions + path "versions.yml", emit: versions when: task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' - if ( archive instanceof List && archive.name.size > 1 ) { error "[UNZIP] error: 7za only accepts a single archive as input. Please check module input." } - prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.baseName) + if (archive instanceof List && archive.name.size > 1) { + error("[UNZIP] error: 7za only accepts a single archive as input. Please check module input.") + } + prefix = task.ext.prefix ?: (meta.id ? "${meta.id}" : archive.baseName) """ 7za \\ x \\ -o"${prefix}"/ \\ - $args \\ - $archive + ${args} \\ + ${archive} cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -35,9 +37,10 @@ process UNZIP { """ stub: - def args = task.ext.args ?: '' - if ( archive instanceof List && archive.name.size > 1 ) { error "[UNZIP] error: 7za only accepts a single archive as input. Please check module input." } - prefix = task.ext.prefix ?: ( meta.id ? "${meta.id}" : archive.baseName) + if (archive instanceof List && archive.name.size > 1) { + error("[UNZIP] error: 7za only accepts a single archive as input. Please check module input.") + } + prefix = task.ext.prefix ?: (meta.id ? "${meta.id}" : archive.baseName) """ mkdir "${prefix}"