<commit_before># Used to track formulae that cannot be installed at the same time
FormulaConflict = Struct.new(:name, :reason)

# Used to annotate formulae that duplicate macOS provided software
# or cause conflicts when linked in.
class KegOnlyReason
  attr_reader :reason

  def initialize(reason, explanation)
    @reason = reason
    @explanation = explanation
  end

  def valid?
    case @reason
    when :provided_pre_mountain_lion
      MacOS.version < :mountain_lion
    when :provided_pre_mavericks
      MacOS.version < :mavericks
    when :provided_pre_el_capitan
      MacOS.version < :el_capitan
    when :provided_until_xcode43
      MacOS::Xcode.installed? && MacOS::Xcode.version < "4.3"
    when :provided_until_xcode5
      MacOS::Xcode.installed? && MacOS::Xcode.version < "5.0"
    else
      true
    end
  end

  def to_s
    return @explanation unless @explanation.empty?
    case @reason
    when :versioned_formula then <<-EOS.undent
      this is an alternate version of another formula
    EOS
    when :provided_by_macos, :provided_by_osx then <<-EOS.undent
      macOS already provides this software and installing another version in
      parallel can cause all kinds of trouble
    EOS
    when :shadowed_by_macos, :shadowed_by_osx then <<-EOS.undent
      macOS provides similar software and installing this software in
      parallel can cause all kinds of trouble
    EOS
    when :provided_pre_mountain_lion then <<-EOS.undent
      macOS already provides this software in versions before Mountain Lion
    EOS
    when :provided_pre_mavericks then <<-EOS.undent
      macOS already provides this software in versions before Mavericks
    EOS
    when :provided_pre_el_capitan then <<-EOS.undent
      macOS already provides this software in versions before El Capitan
    EOS
    when :provided_until_xcode43 then <<-EOS.undent
      Xcode provides this software prior to version 4.3
    EOS
    when :provided_until_xcode5 then <<-EOS.undent
      Xcode provides this software prior to version 5<commit_msg>formula_support: add provided_pre_high_sierra keg_only<commit_after># Used to track formulae that cannot be installed at the same time
FormulaConflict = Struct.new(:name, :reason)

# Used to annotate formulae that duplicate macOS provided software
# or cause conflicts when linked in.
class KegOnlyReason
  attr_reader :reason

  def initialize(reason, explanation)
    @reason = reason
    @explanation = explanation
  end

  def valid?
    case @reason
    when :provided_pre_mountain_lion
      MacOS.version < :mountain_lion
    when :provided_pre_mavericks
      MacOS.version < :mavericks
    when :provided_pre_el_capitan
      MacOS.version < :el_capitan
    when :provided_pre_high_sierra
      MacOS.version < :high_sierra
    when :provided_until_xcode43
      MacOS::Xcode.installed? && MacOS::Xcode.version < "4.3"
    when :provided_until_xcode5
      MacOS::Xcode.installed? && MacOS::Xcode.version < "5.0"
    else
      true
    end
  end

  def to_s
    return @explanation unless @explanation.empty?
    case @reason
    when :versioned_formula then <<-EOS.undent
      this is an alternate version of another formula
    EOS
    when :provided_by_macos, :provided_by_osx then <<-EOS.undent
      macOS already provides this software and installing another version in
      parallel can cause all kinds of trouble
    EOS
    when :shadowed_by_macos, :shadowed_by_osx then <<-EOS.undent
      macOS provides similar software and installing this software in
      parallel can cause all kinds of trouble
    EOS
    when :provided_pre_mountain_lion then <<-EOS.undent
      macOS already provides this software in versions before Mountain Lion
    EOS
    when :provided_pre_mavericks then <<-EOS.undent
      macOS already provides this software in versions before Mavericks
    EOS
    when :provided_pre_el_capitan then <<-EOS.undent
      macOS already provides this software in versions before El Capitan
    EOS
    when :provided_pre_high_sierra then <<-EOS.undent
      macOS already provides this software in versions before High Sierra
    EOS
    when :provided_until_xcode43 then <<-EOS.undent
      Xcode provides this software prior to version 4.3
    EOS
    when :provided_until_xcode5 then <<-EOS.undent
      Xcode provides this software prior to version 5
{'fraction_non_alphanumeric': 0.05487664284067328, 'fraction_numerical': 0.005994927369149181, 'mean_word_length': 3.3951367781155017, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5306068', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1267, 'n_words': 439}