Skip to content

Commit

Permalink
Merge pull request #47 from nextflow-io/fix/help-params
Browse files Browse the repository at this point in the history
Fix help params being unexpected parameters
  • Loading branch information
nvnieuwk committed Aug 26, 2024
2 parents 928b416 + 1b97b26 commit 54c96b0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# nextflow-io/nf-schema: Changelog

# Version 2.1.0
# Version 2.1.1

## Bug fixes

1. The help parameters are now no longer unexpected parameters when validating parameters.
2. Fixed a typo in the docs
3. Added a URL to the help message migration docs to the `paramsHelp()` deprecation message

# Version 2.1.0 - Tantanmen

## Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Declare the plugin in your Nextflow pipeline configuration file:

```groovy title="nextflow.config"
plugins {
id '[email protected].0'
id '[email protected].1'
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/parameters/help_text.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Add the following configuration to your configuration files to enable the creati
```groovy title="nextflow.config"
validation {
help {
enabled: true
enabled = true
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ class SchemaValidator extends PluginExtensionPoint {
// Initialise expected params if not present
//
Map initialiseExpectedParams(Map params) {
if( !params.containsKey("help") ) {
params.help = false
addExpectedParams().each { param ->
params[param] = false
}
return params
}
Expand All @@ -244,7 +244,9 @@ class SchemaValidator extends PluginExtensionPoint {
//
List addExpectedParams() {
def List expectedParams = [
"help"
config.help.shortParameter,
config.help.fullParameter,
config.help.showHiddenParameter
]

return expectedParams
Expand Down Expand Up @@ -364,10 +366,9 @@ class SchemaValidator extends PluginExtensionPoint {
Map options = [:],
String command
) {
// TODO add link to help message migration guide once created
if (!options.containsKey("hideWarning") || options.hideWarning == false) {
log.warn("""
Using `paramsHelp()` is not recommended. Check out the help message migration guide: <url>
Using `paramsHelp()` is not recommended. Check out the help message migration guide: https://nextflow-io.github.io/nf-schema/latest/migration_guide/#updating-the-help-message
If you intended to use this function, please add the following option to the input of the function:
`hideWarning: true`
Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-schema/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Plugin-Id: nf-schema
Plugin-Version: 2.1.0
Plugin-Version: 2.1.1
Plugin-Class: nextflow.validation.ValidationPlugin
Plugin-Provider: nextflow
Plugin-Requires: >=23.10.0

0 comments on commit 54c96b0

Please sign in to comment.