Skip to content

Commit

Permalink
don't try running pre-commit if code-linters or github are not used i…
Browse files Browse the repository at this point in the history
…n the template
  • Loading branch information
mirpedrol committed Dec 16, 2024
1 parent 13e553f commit d19e3e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions nf_core/pipeline-template/nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
{
Expand Down
13 changes: 9 additions & 4 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d19e3e0

Please sign in to comment.