From d19e3e071e7a792354221664f0b0b0ba4e409625 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Mon, 16 Dec 2024 12:11:49 +0100 Subject: [PATCH] don't try running pre-commit if code-linters or github are not used in the template --- nf_core/pipeline-template/nextflow_schema.json | 4 ++-- nf_core/pipelines/create/create.py | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/nf_core/pipeline-template/nextflow_schema.json b/nf_core/pipeline-template/nextflow_schema.json index 97359a1f93..e2aac58cc0 100644 --- a/nf_core/pipeline-template/nextflow_schema.json +++ b/nf_core/pipeline-template/nextflow_schema.json @@ -243,10 +243,10 @@ { "$ref": "#/$defs/input_output_options" }, - {% if igenomes %}{ + {%- if igenomes %}{ "$ref": "#/$defs/reference_genome_options" },{% endif %} - {% if nf_core_configs %}{ + {%- if nf_core_configs %}{ "$ref": "#/$defs/institutional_config_options" },{% endif %} { diff --git a/nf_core/pipelines/create/create.py b/nf_core/pipelines/create/create.py index 1c1821793c..bcc0fbd6b5 100644 --- a/nf_core/pipelines/create/create.py +++ b/nf_core/pipelines/create/create.py @@ -267,10 +267,15 @@ def init_pipeline(self): if not self.no_git: self.git_init_pipeline() # Run prettier on files - current_dir = Path.cwd() - os.chdir(self.outdir) - run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")]) - os.chdir(current_dir) + if ( + self.config.skip_features is None + or "code_linters" not in self.config.skip_features + or "github" not in self.config.skip_features + ): + current_dir = Path.cwd() + os.chdir(self.outdir) + run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")]) + os.chdir(current_dir) if self.config.is_nfcore and not self.is_interactive: log.info(