Skip to content
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

Merged
merged 14 commits into from
Nov 13, 2018

Conversation

dhimmel
Copy link
Member

@dhimmel dhimmel commented Oct 19, 2018

Closes #71

'PubMed Identifiers should start with digits rather than PMC. '
f'Should {citation} switch the citation source to `pmcid`?'
)
if not regexes['pmid'].fullmatch(identifier):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to elif

f'Invalid DOI citation: {citation}\n'
'DOIs must start with `10.`.'
)
if not regexes['doi'].fullmatch(identifier):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to elif

@dhimmel dhimmel requested a review from agitter November 13, 2018 14:35
Copy link
Member

@agitter agitter left a 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.

manubot/cite/cite_command.py Show resolved Hide resolved
manubot/cite/util.py Outdated Show resolved Hide resolved
Properly distinguishes the validation needs of manuscript citation
strings versus cite command citation strings.
@dhimmel
Copy link
Member Author

dhimmel commented Nov 13, 2018

@agitter great suggestions. I think you will be pleasantly surprised by the last three commits and their ability to address your comments!

Copy link
Member

@agitter agitter left a 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.

manubot/cite/util.py Outdated Show resolved Hide resolved
manubot/cite/util.py Show resolved Hide resolved
@dhimmel dhimmel merged commit f9673fe into manubot:master Nov 13, 2018
@dhimmel dhimmel deleted the citation-validator branch November 13, 2018 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants