<commit_before>class Swiftgen < Formula
  desc "Swift code generator for assets, storyboards, Localizable.strings, …"
  homepage "https://github.com/SwiftGen/SwiftGen"
  url "https://github.com/SwiftGen/SwiftGen.git", :tag => "4.2.0"
  head "https://github.com/SwiftGen/SwiftGen.git"

  bottle do
    cellar :any
    sha256 "5670d735818296aa03a20e55681154feb6562868ede8a53eae9ebdf8964ed2b7" => :sierra
    sha256 "9c2987c0fcd300b14282316cb6a0614c097e197a31dfee4f4dad8f8cf8303221" => :el_capitan
  end

  depends_on :xcode => ["8.0", :build]

  def install
    rake "install[#{bin},#{lib},#{pkgshare}/templates]"

    fixtures = {
      "Resources/Fixtures/Images/Images.xcassets" => "Images.xcassets",
      "Resources/Fixtures/Colors/colors.txt" => "colors.txt",
      "Resources/Fixtures/Strings/Localizable.strings" => "Localizable.strings",
      "Resources/Fixtures/Storyboards-iOS" => "Storyboards-iOS",
      "Resources/Fixtures/Fonts" => "Fonts",
      "Resources/Tests/Expected/Images/default-context-defaults.swift" => "images.swift",
      "Resources/Tests/Expected/Colors/default-context-text-defaults.swift" => "colors.swift",
      "Resources/Tests/Expected/Strings/default-context-defaults.swift" => "strings.swift",
      "Resources/Tests/Expected/Storyboards-iOS/default-context-all.swift" => "storyboards.swift",
      "Resources/Tests/Expected/Fonts/default-context-defaults.swift" => "fonts.swift",
    }
    (pkgshare/"fixtures").install fixtures
  end

  test do<commit_msg>swiftgen 4.2.1<commit_after>class Swiftgen < Formula
  desc "Swift code generator for assets, storyboards, Localizable.strings, …"
  homepage "https://github.com/SwiftGen/SwiftGen"
  url "https://github.com/SwiftGen/SwiftGen.git",
      :tag => "4.2.1",
      :revision => "0ce335af8d3720e18b3553aede1205ae678de096"
  head "https://github.com/SwiftGen/SwiftGen.git"

  bottle do
    cellar :any
    sha256 "5670d735818296aa03a20e55681154feb6562868ede8a53eae9ebdf8964ed2b7" => :sierra
    sha256 "9c2987c0fcd300b14282316cb6a0614c097e197a31dfee4f4dad8f8cf8303221" => :el_capitan
  end

  depends_on :xcode => ["8.0", :build]

  def install
    # Disable swiftlint Build Phase to avoid build errors if versions mismatch
    ENV["NO_CODE_LINT"]="1"

    rake "cli:install[#{bin},#{lib},#{pkgshare}/templates]"

    fixtures = {
      "Resources/Fixtures/Images/Images.xcassets" => "Images.xcassets",
      "Resources/Fixtures/Colors/colors.txt" => "colors.txt",
      "Resources/Fixtures/Strings/Localizable.strings" => "Localizable.strings",
      "Resources/Fixtures/Storyboards-iOS" => "Storyboards-iOS",
      "Resources/Fixtures/Fonts" => "Fonts",
      "Resources/Tests/Expected/Images/default-context-defaults.swift" => "images.swift",
      "Resources/Tests/Expected/Colors/default-context-text-defaults.swift" => "colors.swift",
      "Resources/Tests/Expected/Strings/default-context-defaults.swift" => "strings.swift",
      "Resources/Tests/Expected/Storyboards-iOS/default-context-all.swift" => "storyboards.swift",
      "Resources/Tests/Expected/Fonts/default-context-defaults.swift" => "fonts.swift",
    }
    (pkgshare/"fixtures").install fixtures
  end

  test do
{'fraction_non_alphanumeric': 0.14650283553875237, 'fraction_numerical': 0.06836798991808443, 'mean_word_length': 4.24793388429752, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 32, 'https://': 6, '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': '7443550', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1089, 'n_words': 144}