<commit_before>class Kubebuilder < Formula
  desc "SDK for building Kubernetes APIs using CRDs"
  homepage "https://github.com/kubernetes-sigs/kubebuilder"
  url "https://github.com/kubernetes-sigs/kubebuilder.git",
      tag:      "v3.2.0",
      revision: "b7a730c84495122a14a0faff95e9e9615fffbfc5"
  license "Apache-2.0"
  head "https://github.com/kubernetes-sigs/kubebuilder.git"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "2a4dad1daa9263ce2173869c13261c0ec572538bd26527e442fc88f0480fba8a"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "18896f341179475b31589656f00c0bd6e5fe5cee86d83a8e74b8cfecbf999280"
    sha256 cellar: :any_skip_relocation, monterey:       "33b6ffe15f1b2ac1c0d64a3a8137fd118f5d02e8e92167ec2021a7669490e6d2"
    sha256 cellar: :any_skip_relocation, big_sur:        "c42883ef1ce3413ff25efcb9e36c271231bfc6b5bbb396a48e16391f4d8841e7"
    sha256 cellar: :any_skip_relocation, catalina:       "30d47238b140ac3df8761f2fedc1bb9c6a2460a2734f4eaff4b1c5bef1e1b81b"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "782dce15eb8760239abada37e34632610dbaaf66519b89b65b4433cecc770e72"
  end

  depends_on "git-lfs" => :build
  depends_on "go"

  def install
    goos = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOOS").chomp
    goarch = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOARCH").chomp
    ldflags = %W[
      -X main.kubeBuilderVersion=#{version}
      -X main.goos=#{goos}
      -X main.goarch=#{goarch}
      -X main.gitCommit=#{Utils.git_head}
      -X main.buildDate=#{time.iso8601}
    ]
    system "go", "build", *std_go_args(ldflags: ldflags.join(" ")), "./cmd"

    output = Utils.safe_popen_read(bin/"kubebuilder", "completion", "bash")
    (bash_completion/"kubebuilder").write output
    output = Utils.safe_popen_read(bin/"kubebuilder", "completion", "zsh")<commit_msg>kubebuilder: clean up std_go_args usage<commit_after>class Kubebuilder < Formula
  desc "SDK for building Kubernetes APIs using CRDs"
  homepage "https://github.com/kubernetes-sigs/kubebuilder"
  url "https://github.com/kubernetes-sigs/kubebuilder.git",
      tag:      "v3.2.0",
      revision: "b7a730c84495122a14a0faff95e9e9615fffbfc5"
  license "Apache-2.0"
  head "https://github.com/kubernetes-sigs/kubebuilder.git"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "2a4dad1daa9263ce2173869c13261c0ec572538bd26527e442fc88f0480fba8a"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "18896f341179475b31589656f00c0bd6e5fe5cee86d83a8e74b8cfecbf999280"
    sha256 cellar: :any_skip_relocation, monterey:       "33b6ffe15f1b2ac1c0d64a3a8137fd118f5d02e8e92167ec2021a7669490e6d2"
    sha256 cellar: :any_skip_relocation, big_sur:        "c42883ef1ce3413ff25efcb9e36c271231bfc6b5bbb396a48e16391f4d8841e7"
    sha256 cellar: :any_skip_relocation, catalina:       "30d47238b140ac3df8761f2fedc1bb9c6a2460a2734f4eaff4b1c5bef1e1b81b"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "782dce15eb8760239abada37e34632610dbaaf66519b89b65b4433cecc770e72"
  end

  depends_on "git-lfs" => :build
  depends_on "go"

  def install
    goos = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOOS").chomp
    goarch = Utils.safe_popen_read("#{Formula["go"].bin}/go", "env", "GOARCH").chomp
    ldflags = %W[
      -X main.kubeBuilderVersion=#{version}
      -X main.goos=#{goos}
      -X main.goarch=#{goarch}
      -X main.gitCommit=#{Utils.git_head}
      -X main.buildDate=#{time.iso8601}
    ]
    system "go", "build", *std_go_args(ldflags: ldflags), "./cmd"

    output = Utils.safe_popen_read(bin/"kubebuilder", "completion", "bash")
    (bash_completion/"kubebuilder").write output
    output = Utils.safe_popen_read(bin/"kubebuilder", "completion", "zsh")
{'fraction_non_alphanumeric': 0.1183651804670913, 'fraction_numerical': 0.15711252653927812, 'mean_word_length': 5.04975922953451, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5733758', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1621, 'n_words': 201}