Skip to content

Commit

Permalink
fix schema check
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Aug 27, 2024
1 parent 5b3dabd commit da91519
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/nextflow_schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/{{ name }}/master/nextflow_schema.json",
"$id": "https://raw.githubusercontent.com/{{ name }}/{{ default_branch }}/nextflow_schema.json",
"title": "{{ name }} pipeline parameters",
"description": "{{ description }}",
"type": "object",
Expand Down
12 changes: 6 additions & 6 deletions nf_core/pipelines/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def validate_schema(self, schema=None):
def validate_schema_title_description(self, schema=None):
"""
Extra validation command for linting.
Checks that the schema "$id", "title" and "description" attributes match the piipeline config.
Checks that the schema "$id", "title" and "description" attributes match the pipeline config.
"""
if schema is None:
schema = self.schema
Expand All @@ -427,11 +427,11 @@ def validate_schema_title_description(self, schema=None):
if "title" not in self.schema:
raise AssertionError("Schema missing top-level `title` attribute")
# Validate that id, title and description match the pipeline manifest
id_attr = "https://raw.githubusercontent.com/{}/main/nextflow_schema.json".format(
self.pipeline_manifest["name"].strip("\"'")
)
if self.schema["$id"] != id_attr:
raise AssertionError(f"Schema `$id` should be `{id_attr}`\n Found `{self.schema['$id']}`")
id_attr = f"https://raw.githubusercontent.com/{self.pipeline_manifest["name"].strip("\"'")}/main/nextflow_schema.json"
if self.schema["$id"] not in [id_attr, id_attr.replace("/main/", "/master/")]:
raise AssertionError(
f"Schema `$id` should be `{id_attr}` or {id_attr.replace("/main/", "/master/")}. \n Found `{self.schema['$id']}`"
)

title_attr = "{} pipeline parameters".format(self.pipeline_manifest["name"].strip("\"'"))
if self.schema["title"] != title_attr:
Expand Down

0 comments on commit da91519

Please sign in to comment.