<commit_before>class Werf < Formula
  desc "Consistent delivery tool for Kubernetes"
  homepage "https://werf.io/"
  url "https://github.com/werf/werf/archive/refs/tags/v1.2.141.tar.gz"
  sha256 "b4a8eac457f1f4732ae9aded5616da969e57f1d5bd2e924695a62141102f745d"
  license "Apache-2.0"
  head "https://github.com/werf/werf.git", branch: "main"

  # This repository has some tagged versions that are higher than the newest
  # stable release (e.g., `v1.5.2`) and the `GithubLatest` strategy is
  # currently necessary to identify the correct latest version.
  livecheck do
    url :stable
    strategy :github_latest
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "68e779f62b0513a7cd4bb556077615f5eaa9ca60d43bf13506c26fd4e4087f4d"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "de38430f1a3a9730bcf4f8cf93a9690959618ecfa087af736c69cf72046f7945"
    sha256 cellar: :any_skip_relocation, monterey:       "49f75ff5dd2de46b83a02ca50abe6b6ac8b3fc9347842f4b5e66a9726b1ceec7"
    sha256 cellar: :any_skip_relocation, big_sur:        "6a86812fdb079b935f1e96459ad7b526ddcdbd6c67fb6680f312371608199d8e"
    sha256 cellar: :any_skip_relocation, catalina:       "b0597ec18dae557c11098fce2b1b8db814844cd28c86c1ea331345b8d348644b"
  end

  depends_on "go" => :build
  # due to missing libbtrfs headers, only supports macos at the moment
  depends_on :macos

  def install
    ldflags = "-s -w -X github.com/werf/werf/pkg/werf.Version=#{version}"
    tags = "dfrunmount dfssh containers_image_openpgp"

    system "go", "build", *std_go_args(ldflags: ldflags), "-tags", tags, "./cmd/werf"

    bash_output = Utils.safe_popen_read(bin/"werf", "completion", "bash")
    (bash_completion/"werf").write bash_output
    zsh_output = Utils.safe_popen_read(bin/"werf", "completion", "zsh")
    (zsh_completion/"_werf").write zsh_output
    fish_output = Utils.safe_popen_read(bin/"werf", "completion", "fish")
    (fish_completion/"werf.fish").write fish_output
  end

  test do
    werf_config = testpath/"werf.yaml"
    werf_config.write <<~EOS
      configVersion: 1
      project: quickstart-application
      ---
      image: vote
      dockerfile: Dockerfile
      context: vote
      ---<commit_msg>werf: update 1.2.141 bottle.<commit_after>class Werf < Formula
  desc "Consistent delivery tool for Kubernetes"
  homepage "https://werf.io/"
  url "https://github.com/werf/werf/archive/refs/tags/v1.2.141.tar.gz"
  sha256 "b4a8eac457f1f4732ae9aded5616da969e57f1d5bd2e924695a62141102f745d"
  license "Apache-2.0"
  head "https://github.com/werf/werf.git", branch: "main"

  # This repository has some tagged versions that are higher than the newest
  # stable release (e.g., `v1.5.2`) and the `GithubLatest` strategy is
  # currently necessary to identify the correct latest version.
  livecheck do
    url :stable
    strategy :github_latest
  end

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "d72e0207215f4c8889b6b0a273cf7cec944a29c111f472ff112effc00b3aba27"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "d8748dcb81a38afe55b55bf2d614a4a1d7e6ec0111144d772f5adcffffe465e9"
    sha256 cellar: :any_skip_relocation, monterey:       "152e2cf9dc000c79440308fc84587e6a5515c7535947c4a0de23143c958c691f"
    sha256 cellar: :any_skip_relocation, big_sur:        "1e85ce5062bae326b01e627fafd4ecaa86028fe8d5290f129378882a3058e463"
    sha256 cellar: :any_skip_relocation, catalina:       "d0e87bac6edc639e5dbe8cba303c0cc495e3ba9c6eb06e347fb6ff09ac859764"
  end

  depends_on "go" => :build
  # due to missing libbtrfs headers, only supports macos at the moment
  depends_on :macos

  def install
    ldflags = "-s -w -X github.com/werf/werf/pkg/werf.Version=#{version}"
    tags = "dfrunmount dfssh containers_image_openpgp"

    system "go", "build", *std_go_args(ldflags: ldflags), "-tags", tags, "./cmd/werf"

    bash_output = Utils.safe_popen_read(bin/"werf", "completion", "bash")
    (bash_completion/"werf").write bash_output
    zsh_output = Utils.safe_popen_read(bin/"werf", "completion", "zsh")
    (zsh_completion/"_werf").write zsh_output
    fish_output = Utils.safe_popen_read(bin/"werf", "completion", "fish")
    (fish_completion/"werf.fish").write fish_output
  end

  test do
    werf_config = testpath/"werf.yaml"
    werf_config.write <<~EOS
      configVersion: 1
      project: quickstart-application
      ---
      image: vote
      dockerfile: Dockerfile
      context: vote
      ---
{'fraction_non_alphanumeric': 0.10051604218083914, 'fraction_numerical': 0.12272829257347992, 'mean_word_length': 4.351740696278512, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '1724064', 'n_tokens_mistral': 2044, 'n_tokens_neox': 1730, 'n_words': 313}