From 51bbd4664e51adcf396a41219bf9b927bcbce7d6 Mon Sep 17 00:00:00 2001 From: mirpedrol Date: Thu, 10 Oct 2024 11:19:08 +0200 Subject: [PATCH 1/2] assign schema_default when a param is found in the schema but not in the config --- nf_core/pipelines/lint/nextflow_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nf_core/pipelines/lint/nextflow_config.py b/nf_core/pipelines/lint/nextflow_config.py index dd45621bc..6ae55501b 100644 --- a/nf_core/pipelines/lint/nextflow_config.py +++ b/nf_core/pipelines/lint/nextflow_config.py @@ -465,6 +465,7 @@ def nextflow_config(self) -> Dict[str, List[str]]: f"Config default value incorrect: `{param}` is set as {self._wrap_quotes(schema_default)} in `nextflow_schema.json` but is {self._wrap_quotes(self.nf_config[param])} in `nextflow.config`." ) else: + schema_default = str(schema.schema_defaults[param_name]) failed.append( f"Default value from the Nextflow schema `{param} = {self._wrap_quotes(schema_default)}` not found in `nextflow.config`." ) From d4980cad66eb1c88e08198895ed7fee5962a4eb8 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 10 Oct 2024 14:19:03 +0200 Subject: [PATCH 2/2] parse defaultIgnoreParams correctly --- nf_core/pipelines/schema.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nf_core/pipelines/schema.py b/nf_core/pipelines/schema.py index 1f0b4d5e3..127aa123d 100644 --- a/nf_core/pipelines/schema.py +++ b/nf_core/pipelines/schema.py @@ -97,11 +97,16 @@ def _update_validation_plugin_from_config(self) -> None: conf.get("validation.help.fullParameter", "helpFull"), conf.get("validation.help.showHiddenParameter", "showHidden"), ] # Help parameter should be ignored by default - ignored_params_config = conf.get("validation.defaultIgnoreParams", []) + ignored_params_config_str = conf.get("validation.defaultIgnoreParams", "") + ignored_params_config = [ + item.strip().strip("'") for item in ignored_params_config_str[1:-1].split(",") + ] # Extract list elements and remove whitespace + if len(ignored_params_config) > 0: log.debug(f"Ignoring parameters from config: {ignored_params_config}") ignored_params.extend(ignored_params_config) self.ignored_params = ignored_params + log.debug(f"Ignoring parameters: {self.ignored_params}") self.schema_draft = "https://json-schema.org/draft/2020-12/schema" else: