Skip to content

Commit

Permalink
lint for default values null, empty strings or none
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Jun 20, 2023
1 parent 37c3d06 commit b1e8d07
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nf_core/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1e8d07

Please sign in to comment.