From 3b3d940aa2f31af7524010f04f1dc132378664de 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/pipelines/create/create.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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(