-
Notifications
You must be signed in to change notification settings - Fork 191
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
nf-schema support #3116
nf-schema support #3116
Conversation
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.
Just a reminder that this should be added to the nf-core repo, maybe we can create a new subworkflow in case someone wants to continue using nf-validation
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.
Yep I made a PR to the modules repo with these changes :p these changes are not definitive yet
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.
beforeText = """ | ||
-${colors.dim}----------------------------------------------------${colors.reset}- | ||
${colors.green},--.${colors.black}/${colors.green},-.${colors.reset} | ||
${colors.blue} ___ __ __ __ ___ ${colors.green}/,-._.--~\'${colors.reset} | ||
${colors.blue} |\\ | |__ __ / ` / \\ |__) |__ ${colors.yellow}} {${colors.reset} | ||
${colors.blue} | \\| | \\__, \\__/ | \\ |___ ${colors.green}\\`-._,-`-,${colors.reset} | ||
${colors.green}`._,._,\'${colors.reset} | ||
${colors.purple} ${manifest.name} ${manifest.version}${colors.reset} | ||
-${colors.dim}----------------------------------------------------${colors.reset}- | ||
""" | ||
afterText = """${manifest.doi ? "* The pipeline\n" : ""}${manifest.doi.tokenize(",").collect { " https://doi.org/${it.trim().replace('https://doi.org/','')}"}.join("\n")}${manifest.doi ? "\n" : ""} | ||
* The nf-core framework | ||
https://doi.org/10.1038/s41587-020-0439-x | ||
|
||
* Software dependencies | ||
https://github.com/${manifest.name}/blob/master/CITATIONS.md | ||
""" |
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.
should we lint for this in nf-core pipelines?
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.
Good idea, but I want to implement this in a better way as it's soooo ugly right now, I'm just not sure how.
I'll also add a chrome color filter to nf-schema if validation.monochromeLogs
is set to true
. This should simplify the configs a lot already (We can hardcode the monochrome values in the message together with the pipeline name and version, same thing for the citations) I'd love to have these values as plain strings without having to use any external variables
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 think the current way will be the best I can do. This will also stay supported in Nextflow in the future
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.
Nice! Only some last comments 😄
nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf
Outdated
Show resolved
Hide resolved
nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf
Outdated
Show resolved
Hide resolved
nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf
Outdated
Show resolved
Hide resolved
nf_core/pipeline-template/subworkflows/nf-core/utils_nextflow_pipeline/main.nf
Outdated
Show resolved
Hide resolved
Co-authored-by: Júlia Mir Pedrol <[email protected]>
…line_pipeline/main.nf Co-authored-by: Júlia Mir Pedrol <[email protected]>
…line_pipeline/main.nf Co-authored-by: Júlia Mir Pedrol <[email protected]>
…line_pipeline/main.nf Co-authored-by: Júlia Mir Pedrol <[email protected]>
Co-authored-by: Júlia Mir Pedrol <[email protected]>
Co-authored-by: Júlia Mir Pedrol <[email protected]>
nf_core/pipeline-template/subworkflows/local/utils_nfcore_pipeline_pipeline/main.nf
Show resolved
Hide resolved
@@ -36,8 +36,9 @@ def schema_description(self): | |||
warned.append(f"Ungrouped param in schema: `{up}`") | |||
|
|||
# Iterate over groups and add warning for parameters without a description | |||
for group_key in self.schema_obj.schema["definitions"].keys(): | |||
group = self.schema_obj.schema["definitions"][group_key] | |||
defs_notation = self.schema_obj.defs_notation |
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.
don't see that this can be any other value than $defs
in the code
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.
This can still be definitions
if the pipeline still uses nf-validation
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 see that value written to in places different to the initialization and here
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.
It's set everytime the schema of the PipelineSchema
class is updated. This option is used heavily in schema.py
and a bit in schema_description.py
(or do you mean something else?)
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.
So it depends on which schema has been used
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 am talking about self.schema_obj.defs_notation
. where is that value set to something different than $defs
?
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.
here:
tools/nf_core/pipelines/schema.py
Line 107 in 3600db7
self.defs_notation = "definitions" |
basically if nf-validation
is set in the config, then use definitions
else use $defs
Co-authored-by: Matthias Hörtenhuber <[email protected]>
Co-authored-by: Matthias Hörtenhuber <[email protected]>
…to feat/linting-nf-schema
Not sure what I can do about the snapshotting test 😁 |
Thanks that did it! 🥳 |
PR features:
Features that are nice but not urgent (so probably not for this PR)