python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / tools / analysis / tflint / default.nix
blob061a5d348eada049002c8aae8c5a40ccd154c591
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , runCommand
5 , makeWrapper
6 , tflint
7 , tflint-plugins
8 , symlinkJoin
9 }:
11 buildGoModule rec {
12   pname = "tflint";
13   version = "0.42.2";
15   src = fetchFromGitHub {
16     owner = "terraform-linters";
17     repo = pname;
18     rev = "v${version}";
19     sha256 = "sha256-hlmIf8VD8LUxHrhEephw1e+RK6e+Jdf1HvhHu6bZxco=";
20   };
22   vendorSha256 = "sha256-KDXS/YWuA83MeBF6rXn3zm0oIHWJaxhdQazD2kRR0mM=";
24   doCheck = false;
26   subPackages = [ "." ];
28   ldflags = [ "-s" "-w" ];
30   passthru.withPlugins = plugins:
31     let
32       actualPlugins = plugins tflint-plugins;
33       pluginDir = symlinkJoin {
34         name = "tflint-plugin-dir";
35         paths = [ actualPlugins ];
36       };
37     in
38     runCommand "tflint-with-plugins"
39       {
40         nativeBuildInputs = [ makeWrapper ];
41       } ''
42       makeWrapper ${tflint}/bin/tflint $out/bin/tflint \
43         --set TFLINT_PLUGIN_DIR "${pluginDir}"
44     '';
46   meta = with lib; {
47     description = "Terraform linter focused on possible errors, best practices, and so on";
48     homepage = "https://github.com/terraform-linters/tflint";
49     changelog = "https://github.com/terraform-linters/tflint/raw/v${version}/CHANGELOG.md";
50     license = licenses.mpl20;
51     maintainers = [ maintainers.marsam ];
52   };