<commit_before>require "language/node"
class TerraformRover < Formula
  desc "Terraform Visualizer"
  homepage "https://github.com/im2nguyen/rover"
  url "https://github.com/im2nguyen/rover/archive/refs/tags/v0.3.0.tar.gz"
  sha256 "9f04708e30770000116c5e00ffc9307812177d0049854c0f28139c478653d7fa"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "de30fe4fcaf5c9389680870deef5810aeb4126b7ab4e3ad6da5768913006b02d"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "25c2b2f422a99bfaa7f528d046f66bc46461ed92aee11240e9ab48265d7996c8"
    sha256 cellar: :any_skip_relocation, monterey:       "f91c58bd82b597fd0aba039832677e7774b8d63e12952733dc583ec57aaecff0"
    sha256 cellar: :any_skip_relocation, big_sur:        "409ec855c86bd24d245df20e5e83d32301351afc9eb1f54add4eb014568c3be9"
    sha256 cellar: :any_skip_relocation, catalina:       "db3558eac800beb9a876e1c72689b50440e3f2743363a465e2d53fd8603a2273"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "e89bed21e89d0a7485113d6d1507a34d6dcfbedaa0034583ead024eabc88cc68"
  end

  depends_on "go" => :build
  depends_on "node"
  depends_on "terraform"

  def install
    Language::Node.setup_npm_environment
    cd "ui" do
      system "npm", "install", *Language::Node.local_npm_install_args
      system "npm", "run", "build"
    end
    system "go", "build", *std_go_args
  end

  test do
    (testpath/"main.tf").write <<~EOS<commit_msg>terraform-rover 0.3.1<commit_after>require "language/node"
class TerraformRover < Formula
  desc "Terraform Visualizer"
  homepage "https://github.com/im2nguyen/rover"
  url "https://github.com/im2nguyen/rover/archive/refs/tags/v0.3.1.tar.gz"
  sha256 "8d880bdd2a4f0c6817c71d5da4e22c5ba5dafa2cec712101950fce530f20ea12"
  license "MIT"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "de30fe4fcaf5c9389680870deef5810aeb4126b7ab4e3ad6da5768913006b02d"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "25c2b2f422a99bfaa7f528d046f66bc46461ed92aee11240e9ab48265d7996c8"
    sha256 cellar: :any_skip_relocation, monterey:       "f91c58bd82b597fd0aba039832677e7774b8d63e12952733dc583ec57aaecff0"
    sha256 cellar: :any_skip_relocation, big_sur:        "409ec855c86bd24d245df20e5e83d32301351afc9eb1f54add4eb014568c3be9"
    sha256 cellar: :any_skip_relocation, catalina:       "db3558eac800beb9a876e1c72689b50440e3f2743363a465e2d53fd8603a2273"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "e89bed21e89d0a7485113d6d1507a34d6dcfbedaa0034583ead024eabc88cc68"
  end

  depends_on "go" => :build
  depends_on "node"
  depends_on "terraform"

  def install
    Language::Node.setup_npm_environment
    cd "ui" do
      system "npm", "install", *Language::Node.local_npm_install_args
      system "npm", "run", "build"
    end
    system "go", "build", *std_go_args
  end

  test do
    (testpath/"main.tf").write <<~EOS
{'fraction_non_alphanumeric': 0.08546712802768167, 'fraction_numerical': 0.2190311418685121, 'mean_word_length': 5.707656612529003, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '5869239', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1258, 'n_words': 160}