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

Add pipeline linting for ifEmpty(null) to produce a warning #2506

Open
mahesh-panchal opened this issue Nov 9, 2023 · 0 comments
Open

Add pipeline linting for ifEmpty(null) to produce a warning #2506

mahesh-panchal opened this issue Nov 9, 2023 · 0 comments

Comments

@mahesh-panchal
Copy link
Member

mahesh-panchal commented Nov 9, 2023

Description of feature

There are two general cases for workflows to use the channel operator ifEmpty. The first is ifEmpty( [ ] ) to ensure a process executes, for example when an input file is optional (although this can be replaced by toList()). The second is when a channel should not be empty and throws an error ifEmpty { error ... }, e.g. reading from an empty samplesheet.

There are multiple examples of workflows that inject null objects into channels using ifEmpty (see https://github.com/search?q=org%3Anf-core+ifEmpty&type=code&p=2), which could cause unhandled null pointer exceptions as was the case in #1966.
The feature request is that linting throws up a warning when this operation is found.

@ewels ewels added this to the 2.13.1 milestone Feb 22, 2024
edmundmiller added a commit to nf-core/methylseq that referenced this issue Feb 28, 2024
@mirpedrol mirpedrol removed this from the 2.13.1 milestone Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

No branches or pull requests

4 participants