Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run pre-comit when rendering template for pipelines sync #3371

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ params {
// TODO nf-core: Give any required params for the test so that command line flags are not needed
input = params.pipelines_testdata_base_path + 'viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'

{% if igenomes -%}
{%- if igenomes -%}
// Genome references
genome = 'R64-1-1'
{%- endif %}
Expand Down
3 changes: 3 additions & 0 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ def render_template(self) -> None:
yaml.dump(config_yml.model_dump(exclude_none=True), fh, Dumper=custom_yaml_dumper())
log.debug(f"Dumping pipeline template yml to pipeline config file '{config_fn.name}'")

# Run prettier on files for pipelines sync
run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs more testing 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, it runs prettier, it doesn't fix editorconfig errors, but the error found in test.config is fixed by this PR. I have also added a check to only run pre-commit if we are on a git repo, that way we won't run prettier when creating a pipeline as the repo is not initialised yet

def fix_linting(self):
"""
Updates the .nf-core.yml with linting configurations
Expand Down
Loading