From 71262fbc5ceee768cd91ce26c0f1871c74569bc5 Mon Sep 17 00:00:00 2001 From: monacoremo <59358383+monacoremo@users.noreply.github.com> Date: Wed, 3 Nov 2021 18:16:43 +0100 Subject: [PATCH] nix: Hook hsie check-aliases into postgrest-lint --- default.nix | 2 +- nix/tools/style.nix | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 1162a0fc1..9fa62800e 100644 --- a/default.nix +++ b/default.nix @@ -138,7 +138,7 @@ rec { # Linting and styling tools. style = - pkgs.callPackage nix/tools/style.nix { }; + pkgs.callPackage nix/tools/style.nix { inherit hsie; }; # Scripts for running tests. tests = diff --git a/nix/tools/style.nix b/nix/tools/style.nix index a35ae6d55..5f171c522 100644 --- a/nix/tools/style.nix +++ b/nix/tools/style.nix @@ -3,6 +3,7 @@ , checkedShellScript , git , hlint +, hsie , nixpkgs-fmt , shellcheck , silver-searcher @@ -53,12 +54,16 @@ let inRootDir = true; } '' - # Lint Haskell files + echo "Checking consistency of import aliases in Haskell code..." + ${hsie} check-aliases main src + + + echo "Linting Haskell files..." # --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753 ${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \ | xargs ${hlint}/bin/hlint -X QuasiQuotes -X NoPatternSynonyms - # Lint bash scripts + echo "Linting bash scripts..." ${shellcheck}/bin/shellcheck test/with_tmp_db '';