-
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
Add linting for ifEmpty(null) #3411
base: dev
Are you sure you want to change the base?
Conversation
@nf-core-bot fix linting |
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.
Hi @lmReef, thanks for contributing!
It is looking good, but we should also add a test for this. You can find samples for other linting tests in tests/pipelines/lint
, I think https://github.com/nf-core/tools/blob/main/tests/pipelines/lint/test_template_strings.py will be useful for this case
awesome thanks for the feedback, I'll make those changes |
@nf-core-bot fix linting |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files☔ View full report in Codecov by Sentry. |
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.
LGTM! 🙂
file_paths = [] | ||
pattern = re.compile(r"ifEmpty\s*\(\s*null\s*\)") | ||
|
||
# Pipelines don"t provide a path, so use the workflow path. |
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.
# Pipelines don"t provide a path, so use the workflow path. | |
# Pipelines don't provide a path, so use the workflow path. |
Add pipeline and subworkflow linting for ifEmpty(null)
Resolves issue #2506
Description from original issue
Warning message example:
Implementation based on
pipeline_todos
as it's very similar (link to main file)Uses regex pattern
ifEmpty\(\s*null\s*\)
PR checklist
CHANGELOG.md
is updateddocs
is updated