Skip to content

Fixing the invalid xref check#1186

Merged
jamesaoverton merged 3 commits intomasterfrom
issue1127-invalidxref
May 1, 2024
Merged

Fixing the invalid xref check#1186
jamesaoverton merged 3 commits intomasterfrom
issue1127-invalidxref

Conversation

@matentzn
Copy link
Contributor

@matentzn matentzn commented Mar 10, 2024

Resolves #1127

  • docs/ have been added/updated
  • tests have been added/updated
  • mvn verify says all tests pass
  • mvn site says all JavaDocs correct
  • CHANGELOG.md has been updated

This PR fixing the regular expression used to recognise XREFs. I tested it in the https://regex101.com/ sandbox:

image

  • Match the prefix:
    • ^[A-Za-z_]: Starts with an alphabet letter (either uppercase or lowercase) or an underscore.
    • [A-Za-z0-9_.-]*: Followed by any number (including zero) of alphanumeric characters, underscores, periods, or hyphens.
    • [A-Za-z0-9_]: Ends the first part with an alphanumeric character or an underscore.
  • :: Contains a colon separating the prefix from the reference.
  • [^\\s]+$: Matches the reference, which comprises 1 or more characters that are not whitespace (including spaces, tabs, and newlines).

@matentzn matentzn requested a review from balhoff March 10, 2024 11:13
Copy link
Contributor

@balhoff balhoff left a comment

Choose a reason for hiding this comment

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

Thanks!

@matentzn
Copy link
Contributor Author

I just updated the tests to illustrates that the new check works.

matentzn added a commit to monarch-initiative/mondo that referenced this pull request Apr 22, 2024
twhetzel pushed a commit to monarch-initiative/mondo that referenced this pull request Apr 25, 2024
@jamesaoverton jamesaoverton merged commit e76c16e into master May 1, 2024
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.

invalid xref check is too strict

4 participants