From a4fa8b3203e6409cd067c872a7afb5c4a37ab71b Mon Sep 17 00:00:00 2001 From: Dylan Arbour Date: Sat, 13 Jul 2019 23:35:08 -0400 Subject: [PATCH] tflint 0.9.1 (new formula) Add tflint formula to brew. Signed-off-by: Dylan Arbour Closes #41937. Signed-off-by: FX Coudert --- Formula/tflint.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/tflint.rb diff --git a/Formula/tflint.rb b/Formula/tflint.rb new file mode 100644 index 0000000000..5e7f1b1d84 --- /dev/null +++ b/Formula/tflint.rb @@ -0,0 +1,31 @@ +class Tflint < Formula + desc "Linter for Terraform files" + homepage "https://github.com/wata727/tflint" + url "https://github.com/wata727/tflint/archive/v0.9.1.tar.gz" + sha256 "a4f9f845584c51b3d0db3d2ee9ab48435db52ade3ddde1a8689e2ad8cf9acdca" + head "https://github.com/wata727/tflint.git" + + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + ENV["GO111MODULE"] = "on" + + dir = buildpath/"src/github.com/wata727/tflint" + dir.install buildpath.children + + cd dir do + system "go", "build", "-o", bin/"tflint" + prefix.install_metafiles + end + end + + test do + (testpath/"test.tf").write <<~EOS + provider "aws" { + region = "${var.aws_region}" + } + EOS + assert_match "Awesome! Your code is following the best practices :)", shell_output("#{bin}/tflint test.tf") + end +end