<commit_before>class Tflint < Formula
  desc "Linter for Terraform files"
  homepage "https://github.com/terraform-linters/tflint"
  url "https://github.com/terraform-linters/tflint/archive/v0.42.0.tar.gz"
  sha256 "c15a2ea56f11aad39219035e3c0951eb566b572cdec6fcd1d2b02bd1f9a26ee5"
  license "MPL-2.0"
  head "https://github.com/terraform-linters/tflint.git", branch: "master"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_ventura:  "d2d173aaa6daa466c198d23c400c9d1be27829e3beb579a0759863f5bf6e2c41"
    sha256 cellar: :any_skip_relocation, arm64_monterey: "3d27841ae337a4417fead8a0169a96a24f14452ddda1783f94b5e55fd7e5dfa4"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "abb3dbc6d0693b9543925df76863e8f86810ca7b844107fee01b842273bdb507"
    sha256 cellar: :any_skip_relocation, monterey:       "32219b604c51b3306d99fde287c10baf393c8242e10d55b5a46d487eee41ac1c"
    sha256 cellar: :any_skip_relocation, big_sur:        "4c4b7ccd5fd541604468bb85f590e2c9f1e78c249e72724bcddbb97ea462ca15"
    sha256 cellar: :any_skip_relocation, catalina:       "177a294a587aba1e2fea8a391adcddb42ee265b148e410704dec874e37d4573b"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "13b7a7f27914ee221cf683c981b4e45311f0037a271809cf1913b37e18dc4974"
  end

  depends_on "go" => :build

  def install
    system "go", "build", "-ldflags", "-s -w", "-o", bin/"tflint"
  end

  test do
    (testpath/"test.tf").write <<~EOS
      terraform {
        required_providers {
          aws = {
            source = "hashicorp/aws"
            version = "~> 4"
          }
        }
      }

      provider "aws" {
        region = var.aws_region
      }
    EOS

    # tflint returns exitstatus: 0 (no issues), 2 (errors occured), 3 (no errors but issues found)
    assert_match "", shell_output("#{bin}/tflint test.tf")
    assert_equal 0, $CHILD_STATUS.exitstatus
    assert_match version.to_s, shell_output("#{bin}/tflint --version")
  end
end
<commit_msg>tflint: update 0.42.0 bottle.<commit_after>class Tflint < Formula
  desc "Linter for Terraform files"
  homepage "https://github.com/terraform-linters/tflint"
  url "https://github.com/terraform-linters/tflint/archive/v0.42.0.tar.gz"
  sha256 "c15a2ea56f11aad39219035e3c0951eb566b572cdec6fcd1d2b02bd1f9a26ee5"
  license "MPL-2.0"
  head "https://github.com/terraform-linters/tflint.git", branch: "master"

  bottle do
    sha256 cellar: :any_skip_relocation, arm64_monterey: "3ca88c44ae76a070d7126f72784c55cfed68c79d30016369a348056618f09dbb"
    sha256 cellar: :any_skip_relocation, arm64_big_sur:  "3ff79886cc220203be428220f4ddfb671a0e8996f93ffe8e83a166d878f56cbd"
    sha256 cellar: :any_skip_relocation, monterey:       "059e85d692ddf42d385815d74aa895002f086565fe553a7ad2385d5a44066991"
    sha256 cellar: :any_skip_relocation, big_sur:        "c2e1be3bce845ecef445efa899e8f6bc0b295a60cda63812f70f446109cd0610"
    sha256 cellar: :any_skip_relocation, catalina:       "94844bc6918b4581e4c0277d869f0b4b62cdad3d2a4239ec29a8afd8cfd4908c"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "d9310f6a0738a2847f406b2c867fd5354da4587c50a37709e8c97ca738071628"
  end

  depends_on "go" => :build

  def install
    system "go", "build", "-ldflags", "-s -w", "-o", bin/"tflint"
  end

  test do
    (testpath/"test.tf").write <<~EOS
      terraform {
        required_providers {
          aws = {
            source = "hashicorp/aws"
            version = "~> 4"
          }
        }
      }

      provider "aws" {
        region = var.aws_region
      }
    EOS

    # tflint returns exitstatus: 0 (no issues), 2 (errors occured), 3 (no errors but issues found)
    assert_match "", shell_output("#{bin}/tflint test.tf")
    assert_equal 0, $CHILD_STATUS.exitstatus
    assert_match version.to_s, shell_output("#{bin}/tflint --version")
  end
end

{'fraction_non_alphanumeric': 0.09816272965879265, 'fraction_numerical': 0.18320209973753282, 'mean_word_length': 4.047682119205298, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6492194', 'n_tokens_mistral': 1961, 'n_tokens_neox': 1591, 'n_words': 228}