-
Notifications
You must be signed in to change notification settings - Fork 192
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. |
nf_core/pipelines/create/create.py
Outdated
# Run prettier on files for pipelines sync | ||
run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs more testing 👀
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
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 theTEMPLATE
branchShould fix #3372