From 41e9f51a78e9a75095936f52f748e214d495f7ae Mon Sep 17 00:00:00 2001 From: John Rodewald Date: Mon, 16 Oct 2023 16:04:05 +0200 Subject: [PATCH] `tflint-plugins.tflint-ruleset-google`: init --- maintainers/maintainer-list.nix | 6 +++ .../tools/analysis/tflint-plugins/default.nix | 1 + .../tflint-plugins/tflint-ruleset-google.nix | 38 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-google.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 61cffc8c8d93..3f323d231a37 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -8502,6 +8502,12 @@ githubId = 6321578; name = "John Rinehart"; }; + john-rodewald = { + email = "jnrodewald99@gmail.com"; + github = "john-rodewald"; + githubId = 51028009; + name = "John Rodewald"; + }; john-shaffer = { email = "jdsha@proton.me"; github = "john-shaffer"; diff --git a/pkgs/development/tools/analysis/tflint-plugins/default.nix b/pkgs/development/tools/analysis/tflint-plugins/default.nix index 409d7d1e4684..1f4d50a90d10 100644 --- a/pkgs/development/tools/analysis/tflint-plugins/default.nix +++ b/pkgs/development/tools/analysis/tflint-plugins/default.nix @@ -1,3 +1,4 @@ { callPackage, ... }: { tflint-ruleset-aws = callPackage ./tflint-ruleset-aws.nix { }; + tflint-ruleset-google = callPackage ./tflint-ruleset-google.nix { }; } diff --git a/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-google.nix b/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-google.nix new file mode 100644 index 000000000000..fefd319523ca --- /dev/null +++ b/pkgs/development/tools/analysis/tflint-plugins/tflint-ruleset-google.nix @@ -0,0 +1,38 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "tflint-ruleset-google"; + version = "0.24.0"; + + src = fetchFromGitHub { + owner = "terraform-linters"; + repo = pname; + rev = "v${version}"; + hash = "sha256-1eF/uzOYP/gi+ooHN8OfCR2nz+/z98theO0Lr/BBhWM="; + }; + + vendorHash = "sha256-owpNcsxuP+sG27vv9V7ArMK1NLBNbnw11KpdpVyWAD0="; + + # upstream Makefile also does a go test $(go list ./... | grep -v integration) + preCheck = '' + rm integration/integration_test.go + ''; + + subPackages = [ "." ]; + + postInstall = '' + mkdir -p $out/github.com/terraform-linters/${pname}/${version} + mv $out/bin/${pname} $out/github.com/terraform-linters/${pname}/${version}/ + ''; + + meta = with lib; { + homepage = "https://github.com/terraform-linters/tflint-ruleset-google"; + description = "TFLint ruleset plugin for Terraform Google Provider"; + platforms = platforms.unix; + maintainers = with maintainers; [ john-rodewald ]; + license = with licenses; [ mpl20 ]; + }; +}