<commit_before>class Topgrade < Formula
  desc "Upgrade all the things"
  homepage "https://github.com/r-darwish/topgrade"
  url "https://github.com/r-darwish/topgrade/archive/v4.0.1.tar.gz"
  sha256 "d60b28b6c7670453549f6b3b69a43cd8df0074ca988697c4580a2baa0d730c9e"

  bottle do
    cellar :any_skip_relocation
    sha256 "ca082a8725bd3b0e67a0c1f6fc217e5f1fc112fc6a87127942a99b900aba9169" => :catalina
    sha256 "809b9f531f667e3b111d406254a66882023d47d8868b64a2e5215aa0d215ee80" => :mojave
    sha256 "7697e12ac06247913735bfaae5e61f63121f548a6a8f066bb4509879f740e896" => :high_sierra
  end

  depends_on "rust" => :build

  def install
    system "cargo", "install", "--locked", "--root", prefix, "--path", "."
  end

  test do
    # Configuraton path details: https://github.com/r-darwish/topgrade/blob/master/README.md#configuration-path
    # Sample config file: https://github.com/r-darwish/topgrade/blob/master/config.example.toml
    (testpath/"Library/Preferences/topgrade.toml").write <<~EOS
      # Additional git repositories to pull
      #git_repos = [
      #    "~/src/*/",
      #    "~/.config/something"
      #]
    EOS

    assert_match version.to_s, shell_output("#{bin}/topgrade --version")

    output = shell_output("#{bin}/topgrade -n")
    assert_match "Dry running: #{HOMEBREW_PREFIX}/bin/brew upgrade", output
    assert_not_match /\sSelf update\s/, output
  end
end
<commit_msg>topgrade 4.0.2<commit_after>class Topgrade < Formula
  desc "Upgrade all the things"
  homepage "https://github.com/r-darwish/topgrade"
  url "https://github.com/r-darwish/topgrade/archive/v4.0.2.tar.gz"
  sha256 "83c9396f57da870240ae36108bcf25c838fffccf10636e5fb6cad88978bdb648"

  bottle do
    cellar :any_skip_relocation
    sha256 "ca082a8725bd3b0e67a0c1f6fc217e5f1fc112fc6a87127942a99b900aba9169" => :catalina
    sha256 "809b9f531f667e3b111d406254a66882023d47d8868b64a2e5215aa0d215ee80" => :mojave
    sha256 "7697e12ac06247913735bfaae5e61f63121f548a6a8f066bb4509879f740e896" => :high_sierra
  end

  depends_on "rust" => :build

  def install
    system "cargo", "install", "--locked", "--root", prefix, "--path", "."
  end

  test do
    # Configuraton path details: https://github.com/r-darwish/topgrade/blob/master/README.md#configuration-path
    # Sample config file: https://github.com/r-darwish/topgrade/blob/master/config.example.toml
    (testpath/"Library/Preferences/topgrade.toml").write <<~EOS
      # Additional git repositories to pull
      #git_repos = [
      #    "~/src/*/",
      #    "~/.config/something"
      #]
    EOS

    assert_match version.to_s, shell_output("#{bin}/topgrade --version")

    output = shell_output("#{bin}/topgrade -n")
    assert_match "Dry running: #{HOMEBREW_PREFIX}/bin/brew upgrade", output
    assert_not_match /\sSelf update\s/, output
  end
end

{'fraction_non_alphanumeric': 0.12637557685481007, 'fraction_numerical': 0.13489527866524673, 'mean_word_length': 3.961267605633803, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 8, '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': '5243534', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1093, 'n_words': 163}