Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #66 from mirpedrol/default-bool-false
Browse files Browse the repository at this point in the history
assume default 'false'
  • Loading branch information
mirpedrol authored Jul 7, 2023
2 parents 823b097 + b8b9482 commit 8c16c6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Handle errors when sample sheet not provided or doesn't have a schema ([#56](https://github.com/nextflow-io/nf-validation/pull/56))
- Silently ignore samplesheet fields that are not defined in samplesheet schema ([#59](https://github.com/nextflow-io/nf-validation/pull/59))
- Correctly handle double-quoted fields containing commas in csv files by `.fromSamplesheet()` [#63](https://github.com/nextflow-io/nf-validation/pull/63))
- Do not return parameter in summary if it has no default in the schema and is set to 'false' ([#66](https://github.com/nextflow-io/nf-validation/pull/66))

## Version 0.2.1

Expand Down
5 changes: 5 additions & 0 deletions docs/parameters/summary_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This function returns a string that can be logged to the terminal, summarizing t
!!! note

The summary prioritizes displaying only the parameters that are **different** the default schema values.
Parameters which don't have a default in the JSON Schema and which have a value of `null`, `""`, `false` or `'false'` won't be returned in the map.
This is to streamline the extensive parameter lists often associated with pipelines, and highlight the customized elements.
This feature is essential for users to verify their configurations, like checking for typos or confirming proper resolution,
without wading through an array of default settings.
Expand Down Expand Up @@ -67,6 +68,10 @@ As above, it **only** returns the provided parameters that are **different** to

This function takes the same arguments as `paramsSummaryLog()`: the `workflow` object and an optional schema file path.

!!! note

Parameters which don't have a default in the JSON Schema and which have a value of `null`, `""`, `false` or `'false'` won't be returned in the map.

Typical usage:

=== "main.nf"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ class SchemaValidator extends PluginExtensionPoint {
if (schema_value != null && params_value != schema_value) {
sub_params.put(param, params_value)
}
// No default in the schema, and this isn't empty
else if (schema_value == null && params_value != "" && params_value != null && params_value != false) {
// No default in the schema, and this isn't empty or false
else if (schema_value == null && params_value != "" && params_value != null && params_value != false && params_value != 'false') {
sub_params.put(param, params_value)
}
}
Expand Down

0 comments on commit 8c16c6d

Please sign in to comment.