From 66a3947c4d76ee9ab104c56e34b5851a0371fc83 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Mon, 23 Mar 2015 19:59:08 +0530
Subject: [PATCH] Run HLint as a test suite.

---
 functorrent.cabal |  8 ++++++++
 test/hlint.hs     | 12 ++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 test/hlint.hs

diff --git a/functorrent.cabal b/functorrent.cabal
index c70ff4e..72295f6 100644
--- a/functorrent.cabal
+++ b/functorrent.cabal
@@ -66,3 +66,11 @@ test-suite functorrent-test
                      doctest,
                      tasty,
                      tasty-hunit
+
+test-suite functorrent-hlint
+  type:              exitcode-stdio-1.0
+  default-language:  Haskell2010
+  hs-source-dirs:    test
+  main-is:           hlint.hs
+  build-depends:     base,
+                     hlint
diff --git a/test/hlint.hs b/test/hlint.hs
new file mode 100644
index 0000000..0fa2512
--- /dev/null
+++ b/test/hlint.hs
@@ -0,0 +1,12 @@
+module Main where
+
+import Control.Monad
+import Language.Haskell.HLint
+import System.Environment
+import System.Exit
+
+main :: IO ()
+main = do
+  args <- getArgs
+  hints <- hlint $ ["src", "--cpp-define=HLINT", "--cpp-ansi"] ++ args
+  unless (null hints) exitFailure
-- 
2.45.2