-
Notifications
You must be signed in to change notification settings - Fork 68
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
.trim() removed to keep new lines between collected versions #306
Conversation
✅ Deploy Preview for nextflow-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks!
@@ -156,10 +156,10 @@ workflow { | |||
Channel.topic('versions') // [!code ++] | |||
| unique() | |||
| map { process, name, version -> | |||
""" | |||
"""\ |
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 don't think that we need this do we?
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.
Or rather, I should ask: was it intentional to add this and if so why?
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.
You are right, we do not necessarily need the backslash here!
What it does is that it prevent Groovy from inserting a newline immediately after opening the triple quotes.
So this would be the output with the backslash:
PREPROCESSING:
cutadapt: 4.7
PREPROCESSING:
ribodetector: 0.3.1
GET_SAMPLE_INFO:
scd: 1.4.22
... and this would be the output without the backslash:
PREPROCESSING:
ribodetector: 0.3.1
PREPROCESSING:
cutadapt: 4.7
GET_SAMPLE_INFO:
scd: 1.4.22
Saw the backslash in Ben Sherman's slack reply, though it was cool way of removing extra newlines :) But the pipeline would run either way, so the backslash in this case is a preference thing, I guess.
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.
Ben also mentioned .leftTrim()
, this would be the output (looks the same way as when adding the backslash):
PREPROCESSING:
cutadapt: 4.7
PREPROCESSING:
ribodetector: 0.3.1
GET_SAMPLE_INFO:
scd: 1.4.22
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.
Ah ok great, let's leave it in then! I was worried that it would kill the newline and break the yaml, but if it's double spaced already then that's perfect.
Thanks for the explanation! 🙌🏻
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.
Thanks!
On the page with 20.04 release highlights, in the Collecting version subsection, within an example code snippet, .trim() was removed to keep newline between recorded versions.
old:
new:
Output file example after
.trim()
is removed: