From 834a7f25c0a453e4597400e508d1dcd9c7664a74 Mon Sep 17 00:00:00 2001 From: Florian De Temmerman Date: Thu, 29 Feb 2024 22:18:38 +0100 Subject: [PATCH] Reformat and fix linting errors --- .pre-commit-config.yaml | 27 ++++++++++--------- assets/nf-params.yml | 8 +++--- bin/collect_metadata.py | 8 ++++-- .../templates/dumpsoftwareversions.py | 4 ++- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bce64572..801e349a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,18 @@ +exclude: ^(.*.test.snap)|(assets/nf-params.yml)$ + repos: + - repo: local + hooks: + - id: nf-core/tools parameters.yaml + name: Update nf-params.yml file with schema + language: python + additional_dependencies: + - nf-core + entry: nf-core + args: [create-params-file, --output, assets/nf-params.yml, "--force", "."] + pass_filenames: false + files: ^nextflow_schema.json$ + - repo: https://github.com/pre-commit/mirrors-prettier rev: "v3.1.0" hooks: @@ -8,20 +22,9 @@ repos: hooks: - id: editorconfig-checker alias: ec + exclude: assets/nf-params.yml - repo: https://github.com/psf/black rev: 23.3.0 hooks: - id: black - - - repo: local - hooks: - - id: nf-core/tools parameters.yaml - name: Update nf-params.yml file with schema - language: python - additional_dependencies: - - nf-core - entry: nf-core - args: [create-params-file, --output, assets/nf-params.yml, "--force", "."] - pass_filenames: false - files: ^nextflow_schema.json$ diff --git a/assets/nf-params.yml b/assets/nf-params.yml index 4816169f..5e6c9928 100644 --- a/assets/nf-params.yml +++ b/assets/nf-params.yml @@ -1,5 +1,5 @@ ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -## nf-core/pixelator 1.0.3 +## nf-core/pixelator 1.1.0dev ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## This is an example parameter file to pass to the `-params-file` option ## of nextflow run with the nf-core/pixelator pipeline. @@ -19,6 +19,7 @@ ## Path to comma-separated file containing information about the samples ## in the experiment. ## Type: string +## Required ## ----------------------------------------------------------------------------- # input = null @@ -37,8 +38,9 @@ ## The output directory where the results will be saved. You have to use ## absolute paths to storage on Cloud infrastructure. ## Type: string +## Required ## ----------------------------------------------------------------------------- -# outdir = "./results" +# outdir = null ## ----------------------------------------------------------------------------- ## email @@ -404,7 +406,7 @@ ## ============================================================================= ## Less common options for the pipeline, typically set in a config file. -## (12 hidden parameters are not shown) +## (11 hidden parameters are not shown) diff --git a/bin/collect_metadata.py b/bin/collect_metadata.py index 67df83b7..8eef3d74 100755 --- a/bin/collect_metadata.py +++ b/bin/collect_metadata.py @@ -20,7 +20,9 @@ def subtool_versions(): - cutadapt_proc = subprocess.run(["cutadapt", "--version"], capture_output=True, text=True) + cutadapt_proc = subprocess.run( + ["cutadapt", "--version"], capture_output=True, text=True + ) fastp_proc = subprocess.run(["fastp", "--version"], capture_output=True, text=True) cutadapt_version = cutadapt_proc.stdout.strip("\n") @@ -73,7 +75,9 @@ def main(args): parser = argparse.ArgumentParser() parser.add_argument("--process-name", dest="process_name", type=str) - parser.add_argument("--workflow-data", dest="workflow_data", type=Path, default=None) + parser.add_argument( + "--workflow-data", dest="workflow_data", type=Path, default=None + ) args = parser.parse_args() main(args) diff --git a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py index da033408..4a993608 100755 --- a/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py +++ b/modules/nf-core/custom/dumpsoftwareversions/templates/dumpsoftwareversions.py @@ -58,7 +58,9 @@ def main(): } with open("$versions") as f: - versions_by_process = yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module + versions_by_process = ( + yaml.load(f, Loader=yaml.BaseLoader) | versions_this_module + ) # aggregate versions by the module name (derived from fully-qualified process name) versions_by_module = {}