-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate citation identifiers conform to known identifier patterns #76
Conversation
manubot/cite/util.py
Outdated
'PubMed Identifiers should start with digits rather than PMC. ' | ||
f'Should {citation} switch the citation source to `pmcid`?' | ||
) | ||
if not regexes['pmid'].fullmatch(identifier): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to elif
manubot/cite/util.py
Outdated
f'Invalid DOI citation: {citation}\n' | ||
'DOIs must start with `10.`.' | ||
) | ||
if not regexes['doi'].fullmatch(identifier): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to elif
1bae7fc
to
e1e0d7c
Compare
ebb6972
to
0c0640d
Compare
Validate citations for better error messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I have a few questions prompted by my local testing, but they do not necessarily require changes.
Properly distinguishes the validation needs of manuscript citation strings versus cite command citation strings.
@agitter great suggestions. I think you will be pleasantly surprised by the last three commits and their ability to address your comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These updates are great. As an error-prone user, I love informative error messages.
Closes #71