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

Fix detecting version from URL #7071

Merged
merged 1 commit into from Feb 23, 2020
Merged

Fix detecting version from URL #7071

merged 1 commit into from Feb 23, 2020

Conversation

SeekingMeaning
Copy link
Contributor

@SeekingMeaning SeekingMeaning commented Feb 23, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Currently, line 264 does not work for one of the given examples unrtf_0.20.4-1

m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)

Looking closer, \d\.\d+ should be \d+\.\d+ where another + is added to indicate that there can be more than one digit \d.

(A similar change is made to line 353.)


And as for line 274 m = /-((?:\d)+-\d+)/.match(stem), some redundancy can be removed by replacing (?:\d) with \d. Usually, the syntax (?:) is used either for (1) matching a group of characters without creating a capture such as (?:\d+\.)* or (2) "or" expressions such as (?:p|rc|RC). However, since it's just \d by itself, it can be simplified.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @SeekingMeaning!

@MikeMcQuaid MikeMcQuaid merged commit 2834a75 into Homebrew:master Feb 23, 2020
@SeekingMeaning SeekingMeaning deleted the patch-1 branch February 23, 2020 21:18
@lock lock bot added the outdated PR was locked due to age label Mar 27, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants