Skip to content

Conversation

@p-linnane
Copy link
Member

  • 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 lgtm (style, typechecking and tests) with your changes locally?

After some internal discussion we've decided to no longer allow HTTP URLs in Homebrew/core and Homebrew/cask. This doesn't include mirrors since we often use them for bootstrapping.

This should produce numerous failures right now, but it'll allow us to review them.

Copilot AI review requested due to automatic review settings December 24, 2025 00:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds RuboCop rules to disallow HTTP URLs (http://) in Homebrew/core and Homebrew/cask repositories, while allowing HTTP for mirror URLs in formulae since they may be needed for bootstrapping.

Key changes:

  • Adds HttpUrls cop for formulae to detect and auto-correct http:// URLs to https://
  • Extends cask URL cop to detect and auto-correct http:// URLs to https://
  • Both cops only apply to homebrew-core and homebrew-cask taps respectively

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/rubocops/urls.rb Adds new HttpUrls FormulaCop that flags http:// URLs in homebrew-core formulae (excluding mirrors) and provides auto-correction to https://
Library/Homebrew/rubocops/cask/url.rb Extends the existing Url cop to check for http:// URLs in homebrew-cask and provides auto-correction to https://
Library/Homebrew/test/rubocops/urls/http_spec.rb Adds comprehensive test coverage for the new formula HttpUrls cop including offense detection, auto-correction, tap filtering, and mirror URL exclusion
Library/Homebrew/test/rubocops/cask/url_spec.rb Adds test coverage for http:// URL detection in casks including offense detection, auto-correction, tap filtering, and https:// URL acceptance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@daeho-ro
Copy link
Member

Recently we got an error frequently,

Top 3 slowest examples (535.28 seconds, 58.1% of total time):
  Utils::Svn::remote_exists? when svn is available returns true when remote exists
    494.03 seconds ./test/utils/svn_spec.rb:49
  Homebrew::Cmd::Reinstall reinstalls a Formula
    23.6 seconds ./test/cmd/reinstall_spec.rb:10
  Homebrew::Cmd::InstallCmd when using a bottle installs a Formula
    17.65 seconds ./test/cmd/install_spec.rb:18

Top 3 slowest example groups:
  Utils::Svn
    82.45 seconds average (494.7 seconds / 6 examples) ./test/utils/svn_spec.rb:5
  Homebrew::Cmd::Reinstall
    12.3 seconds average (24.59 seconds / 2 examples) ./test/cmd/reinstall_spec.rb:7
  Homebrew::Cmd::InstallCmd
    9.68 seconds average (48.38 seconds / 5 examples) ./test/cmd/install_spec.rb:6

Signed-off-by: Patrick Linnane <patrick@linnane.io>
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.

3 participants