Skip to content

Commit

Permalink
Merge pull request #3213 from mirpedrol/fix-params-validation
Browse files Browse the repository at this point in the history
Linting: Fix bug when linting schema params
  • Loading branch information
mashehu authored Oct 10, 2024
2 parents 93a5bce + d4980ca commit 16dc3b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions nf_core/pipelines/lint/nextflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`."
)
Expand Down
7 changes: 6 additions & 1 deletion nf_core/pipelines/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 16dc3b9

Please sign in to comment.