diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd9da103f..ae1f898184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ ### Linting +- Handle default values of type number from nextflow schema ([#2703](https://github.com/nf-core/tools/pull/2703)) + ### Modules ### Subworkflows diff --git a/nf_core/lint/nextflow_config.py b/nf_core/lint/nextflow_config.py index 1e0a6c4995..15794ef677 100644 --- a/nf_core/lint/nextflow_config.py +++ b/nf_core/lint/nextflow_config.py @@ -390,9 +390,13 @@ def nextflow_config(self): if str(self.nf_config[param]) == schema_default: passed.append(f"Config default value correct: {param}") else: - failed.append( - 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`." - ) + # Handle "number" type + if schema_default.endswith(".0") and str(self.nf_config[param]) == schema_default[:-2]: + passed.append(f"Config default value correct: {param}") + else: + failed.append( + 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: failed.append( f"Default value from the Nextflow schema '{param} = {self._wrap_quotes(schema_default)}' not found in `nextflow.config`."