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

Conversation

mirpedrol
Copy link
Member

@mirpedrol mirpedrol commented Dec 20, 2024

Pre-commit was not running when creating a pipeline (because there isn't a git repo yet at the point of creating the pipeline), but it is running when we use nf-core pipelines sync and create a new pipeline in the TEMPLATE branch

Should fix #3372

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.16%. Comparing base (b685800) to head (80e06dc).
Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
nf_core/pipelines/lint_utils.py 80.00% 4 Missing ⚠️
Additional details and impacted files

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 389 to 391
# 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

@@ -70,6 +70,15 @@ def print_fixes(lint_obj):
)


def check_git_repo() -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we had already a function like this, but doesn't look like it.

@mirpedrol mirpedrol merged commit d4d3f36 into nf-core:dev Jan 13, 2025
89 checks passed
@mirpedrol mirpedrol deleted the run-prettier-on-sync branch January 13, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants