diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec68794f8..6c2c755e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Warn if container access is denied ([#2270](https://github.com/nf-core/tools/pull/2270)) - Error if module container specification has quay.io as prefix when it shouldn't have ([#2278])(https://github.com/nf-core/tools/pull/2278/files) - Detect if container is 'simple name' and try to contact quay.io server by default ([#2281](https://github.com/nf-core/tools/pull/2281)) +- Warn about null/None/empty default values in `nextflow_schema.json` ([#3328](https://github.com/nf-core/tools/pull/2328)) ### Modules diff --git a/nf_core/schema.py b/nf_core/schema.py index 75dbebce04..b00697334b 100644 --- a/nf_core/schema.py +++ b/nf_core/schema.py @@ -238,6 +238,11 @@ def validate_default_params(self): jsonschema.validate(self.schema_defaults, schema_no_required) except jsonschema.exceptions.ValidationError as e: raise AssertionError(f"Default parameters are invalid: {e.message}") + for param, default in self.schema_defaults.items(): + if default in ("null", "", None, "None"): + log.warning( + f"[yellow][!] Default parameter '{param}' is empty or null. It is advisable to remove the default from the schema" + ) log.info("[green][✓] Default parameters match schema validation") # Make sure every default parameter exists in the nextflow.config and is of correct type