<commit_before># `brew readall` tries to import all formulae one-by-one.
# This can be useful for debugging issues across all formulae
# when making significant changes to formula.rb,
# or to determine if any current formulae have Ruby issues

require "formula"
require "tap"
require "thread"

module Homebrew
  def readall
    if ARGV.delete("--syntax")
      ruby_files = Queue.new
      Dir.glob("#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb").each do |rb|
        next if rb.include?("/vendor/")
        ruby_files << rb
      end

      failed = false
      workers = (0...Hardware::CPU.cores).map do
        Thread.new do
          begin
            while rb = ruby_files.pop(true)
              # As a side effect, print syntax errors/warnings to `$stderr`.
              failed = true if syntax_errors_or_warnings?(rb)<commit_msg>readall: also check 'brew.rb' for issues<commit_after># `brew readall` tries to import all formulae one-by-one.
# This can be useful for debugging issues across all formulae
# when making significant changes to formula.rb,
# or to determine if any current formulae have Ruby issues

require "formula"
require "tap"
require "thread"

module Homebrew
  def readall
    if ARGV.delete("--syntax")
      ruby_files = Queue.new
      scan_files = %W[
        #{HOMEBREW_LIBRARY}/*.rb
        #{HOMEBREW_LIBRARY}/Homebrew/**/*.rb
      ]
      Dir.glob(scan_files).each do |rb|
        next if rb.include?("/vendor/")
        ruby_files << rb
      end

      failed = false
      workers = (0...Hardware::CPU.cores).map do
        Thread.new do
          begin
            while rb = ruby_files.pop(true)
              # As a side effect, print syntax errors/warnings to `$stderr`.
              failed = true if syntax_errors_or_warnings?(rb)
{'fraction_non_alphanumeric': 0.10180995475113122, 'fraction_numerical': 0.0011312217194570137, 'mean_word_length': 2.5168986083499005, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7462966', 'n_tokens_mistral': 542, 'n_tokens_neox': 512, 'n_words': 172}