Skip to content

Commit

Permalink
Merge pull request #1348 from lldelisle/patch-1
Browse files Browse the repository at this point in the history
fix orcid regex for dockstore_init
  • Loading branch information
nsoranzo committed Jan 26, 2023
2 parents 6747e88 + 6cde259 commit 9d9471f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions planemo/workflow_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ def generate_dockstore_yaml(directory: str, publish: bool = True) -> str:
continue
if field == "identifier":
# Check if it is an orcid:
orcid = re.findall(r"(?:\d{4}-){3}\d{3}", value)
orcid = re.findall(r"(?:\d{4}-){3}\d{4}", value)
if len(orcid) > 0:
# Check the orcid is valid
if (
requests.get(
f"https://orcid.org/{orcid[0]}", headers={"Accept": "application/xml"}
f"https://orcid.org/{orcid[0]}",
headers={"Accept": "application/xml"},
allow_redirects=False,
).status_code
== 200
):
Expand Down
1 change: 1 addition & 0 deletions tests/test_cmd_dockstore_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ def run_dockstore_init_with_creator(self):
assert "workflows" in dockstore_config
assert len(dockstore_config["workflows"]) == 1
assert "authors" in dockstore_config["workflows"]
assert dockstore_config["workflows"]["authors"]["orcid"] == "0000-0002-1964-4960"
workflow_lint_cmd = ["workflow_lint", "--skip", "tool_ids", "--fail_level", "error", f]
self._check_exit_code(workflow_lint_cmd)

0 comments on commit 9d9471f

Please sign in to comment.