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

bump-formula-pr: more enhancements. #3729

Merged
merged 6 commits into from
Jan 30, 2018

Conversation

ilovezfs
Copy link
Contributor

  • 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?

  • improve formula name guessing
  • update GNU mirror handling
  • add Debian mirror handling
  • detect download strategy from url
  • regex escape urls in replacements
  • improve version formula component regex

base_url = if new_url_split.count > 5
new_url_split[0..4].join("/")
else
new_url_split[0..(new_url_split.count - 2)].join("/")
Copy link
Member

Choose a reason for hiding this comment

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

With all these splits a comment would be cool explaining what's going on here (as I have no idea). Perhaps using some/a new variables for the 5, 4, new_url_split.count - 2?

new_mirror
else
new_url
new_mirror = if requested_spec != :devel && new_url =~ %r{.*ftp.gnu.org/gnu.*}
Copy link
Member

Choose a reason for hiding this comment

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

Could maybe make this a case statement if you anticipate more of these in future.

@@ -260,7 +264,7 @@ def bump_formula_pr
end
elsif forced_version && forced_version == "0"
if requested_spec == :stable
replacement_pairs << [/^ version \"[a-z\d+\.]+\"\n/m, ""]
replacement_pairs << [/^ version \"[a-zA-Z\d+\.\-\_]+\"\n/m, ""]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could be shortened to this, I think:

/^  version \"[\w\.\-]+\"\n/m

@ilovezfs ilovezfs force-pushed the bump-formula-pr-more-enhancements branch from 6f6313c to ccbe494 Compare January 28, 2018 16:12
@ilovezfs
Copy link
Contributor Author

PR refreshed.

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.

Looks good, way more readable. 👍 thanks!

@ilovezfs ilovezfs merged commit c77cafc into Homebrew:master Jan 30, 2018
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants