From f78cfe4fd5326e7c60219dcdc0cab6544ede2d63 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Thu, 6 Jul 2023 12:21:11 +0200 Subject: [PATCH 1/5] assume default 'false' --- .../src/main/nextflow/validation/SchemaValidator.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy index 5e004e4..bb0b73d 100644 --- a/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy +++ b/plugins/nf-validation/src/main/nextflow/validation/SchemaValidator.groovy @@ -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) } } From 63ba8432300e7a71af431be3a65c5151264b6f76 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Thu, 6 Jul 2023 12:23:03 +0200 Subject: [PATCH 2/5] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0779545..a9409e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) +- Assume that a value with no default in the schema will have a default of 'false' ([#66](https://github.com/nextflow-io/nf-validation/pull/66)) ## Version 0.2.1 From eb573a322d575953de3168f8aea7cd62460d8681 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Thu, 6 Jul 2023 12:26:43 +0200 Subject: [PATCH 3/5] add documentation about assuming defaults for paramsSummaryMap and Log --- docs/parameters/summary_log.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/parameters/summary_log.md b/docs/parameters/summary_log.md index 9a918c8..07d42ad 100644 --- a/docs/parameters/summary_log.md +++ b/docs/parameters/summary_log.md @@ -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, "" 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. @@ -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, "" or false won't be returned in the map. + Typical usage: === "main.nf" From 2167acc737d2c9298430ff2501bcc2e458115b75 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Thu, 6 Jul 2023 12:28:23 +0200 Subject: [PATCH 4/5] small modification in docs --- docs/parameters/summary_log.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/parameters/summary_log.md b/docs/parameters/summary_log.md index 07d42ad..d2ad74d 100644 --- a/docs/parameters/summary_log.md +++ b/docs/parameters/summary_log.md @@ -11,7 +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, "" or false won't be returned in the map. + 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. @@ -70,7 +70,7 @@ This function takes the same arguments as `paramsSummaryLog()`: the `workflow` o !!! note - Parameters which don't have a default in the JSON Schema and which have a value of null, "" or false won't be returned in the map. + 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: From b8b9482caa0a8ea0e0103b580a78c8045a32997f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Mir=20Pedrol?= Date: Fri, 7 Jul 2023 08:50:38 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: Phil Ewels --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9409e7..86da077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +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)) -- Assume that a value with no default in the schema will have a default of 'false' ([#66](https://github.com/nextflow-io/nf-validation/pull/66)) +- 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