]> git.rkrishnan.org Git - functorrent.git/commitdiff
Run HLint as a test suite.
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Mon, 23 Mar 2015 14:29:08 +0000 (19:59 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Mon, 23 Mar 2015 14:29:08 +0000 (19:59 +0530)
functorrent.cabal
test/hlint.hs [new file with mode: 0644]

index c70ff4e0c62ced4c1c66029bb15afc8e3d7ee6be..72295f66ef0d2d1df0e77fd999e57d794d59d1ed 100644 (file)
@@ -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 (file)
index 0000000..0fa2512
--- /dev/null
@@ -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