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

More patch fixes #49

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
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
4. The old `validation.showHiddenParams` config option works again to ensure backwards compatibility. Using `validation.help.showHidden` is still preffered and the old option will emit a deprecation message.

# Version 2.1.0 - Tantanmen

Expand Down
4 changes: 2 additions & 2 deletions docs/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ The creation of the help message now needs to be enabled in the configuration fi
```groovy title="nextflow.config"
validation {
help {
enabled: true
command: "nextflow run my_pipeline --input input_file.csv"
enabled = true
command = "nextflow run my_pipeline --input input_file.csv"
}
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HelpConfig {
final public String command
final public Boolean showHidden

HelpConfig(Map map, Map params, Boolean monochromeLogs) {
HelpConfig(Map map, Map params, Boolean monochromeLogs, Boolean showHiddenParams) {
def config = map ?: Collections.emptyMap()
enabled = config.enabled ?: false
shortParameter = config.shortParameter ?: "help"
Expand All @@ -41,6 +41,6 @@ class HelpConfig {
afterText = config.afterText ?: ""
command = config.command ?: ""
}
showHidden = params.get(showHiddenParameter) ?: config.showHidden ?: false
showHidden = params.containsKey(showHiddenParameter) ? params.get(showHiddenParameter) : config.showHidden ?: showHiddenParams ?: false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ValidationConfig {
final public Boolean monochromeLogs
final public Boolean failUnrecognisedParams
final public String parametersSchema
final public Boolean showHiddenParams = false
final public Boolean showHiddenParams
final public HelpConfig help
final public SummaryConfig summary

Expand All @@ -33,11 +33,12 @@ class ValidationConfig {
lenientMode = config.lenientMode ?: false
monochromeLogs = config.monochromeLogs ?: false
failUnrecognisedParams = config.failUnrecognisedParams ?: false
if(config.showHiddenParams) {
showHiddenParams = config.showHiddenParams ?: false
if(config.containsKey("showHiddenParams")) {
log.warn("configuration option `validation.showHiddenParams` is deprecated, please use `validation.help.showHidden` or the `--showHidden` parameter instead")
}
parametersSchema = config.parametersSchema ?: "nextflow_schema.json"
help = new HelpConfig(config.help as Map ?: [:], params, monochromeLogs)
help = new HelpConfig(config.help as Map ?: [:], params, monochromeLogs, showHiddenParams)
summary = new SummaryConfig(config.summary as Map ?: [:], monochromeLogs)

if(config.ignoreParams && !(config.ignoreParams instanceof List<String>)) {
Expand Down
Loading