Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Nov 3, 2025

  • 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 typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Looks like the check is done twice. Let's remove the one without --strict as we migrated duplicates within official repos already.

I think this will trigger for --new formulae and maybe can be bypassed with test-bot --skip-new --skip-new-strict.

Copilot AI review requested due to automatic review settings November 3, 2025 01:38
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 refactors the formula name auditing logic by repositioning the cask token conflict check within the audit_name method.

  • Moved the cask token conflict check to execute after formula rename and alias checks
  • The cask token check now only runs when strict mode is enabled
Comments suppressed due to low confidence (1)

Library/Homebrew/formula_auditor.rb:196

  • The cask token conflict check (lines 190-196) has been moved inside the @strict mode guard (line 176), changing its behavior. Previously, this check ran for all core tap formulas regardless of strict mode. Now it only runs when @strict is true, which may allow formula names that conflict with cask tokens to pass validation in non-strict mode. If this behavior change is intentional, it should be documented; otherwise, the cask token check should be moved before the return unless @strict statement.
      return unless @strict

      problem "'#{name}' is not allowed in homebrew/core." if MissingFormula.disallowed_reason(name)

      if Formula.aliases.include? name
        problem "Formula name conflicts with existing aliases in homebrew/core."
        return
      end

      if (oldname = CoreTap.instance.formula_renames[name])
        problem "'#{name}' is reserved as the old name of #{oldname} in homebrew/core."
        return
      end

      cask_tokens = CoreCaskTap.instance.cask_tokens.presence
      cask_tokens ||= Homebrew::API.cask_tokens

      if cask_tokens.include?(name)
        problem "Formula name conflicts with an existing Homebrew/cask cask's token."
        return
      end

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

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.

Makes sense, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Nov 3, 2025
Merged via the queue into main with commit c1f0e7e Nov 3, 2025
44 checks passed
@MikeMcQuaid MikeMcQuaid deleted the formula_auditor-conflict branch November 3, 2025 09:30
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