Skip to content

Commit

Permalink
Added HLint to the pipeline of test suites.
Browse files Browse the repository at this point in the history
Notice the --reorder-goals switch in cabal install. More information about
it can be found at: haskell/cabal#1780.
  • Loading branch information
moodmosaic committed Jan 29, 2015
1 parent 225767f commit 4d696f5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
7 changes: 7 additions & 0 deletions HLint.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{-# LANGUAGE PackageImports #-}

module HLint () where

import "hint" HLint.Default
import "hint" HLint.Dollar
import "hint" HLint.Generalise
5 changes: 4 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ cabal update # Download the most recent list of packages
cabal install cabal-install # Optional, can be prompted by cabal update

cabal sandbox init # Initialise the sandbox
cabal install --only-dependencies # Install dependencies into the sandbox
cabal install \ # Install dependencies into the sandbox
--enable-tests \
--only-dependencies \
--reorder-goals
cabal build # Build your package inside the sandbox

cabal configure --enable-tests # Enable the test suites
Expand Down
9 changes: 9 additions & 0 deletions quickcheck-samples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ Test-Suite spec
Build-Depends: base
, hspec
, QuickCheck

Test-Suite style
Type: exitcode-stdio-1.0
Default-Language: Haskell2010
Hs-Source-Dirs: tests
Ghc-Options: -Wall
Main-Is: HLint.hs
Build-Depends: base
, hlint == 1.*
16 changes: 16 additions & 0 deletions tests/HLint.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Main (main) where

import Language.Haskell.HLint (hlint)
import System.Exit (exitFailure, exitSuccess)

arguments :: [String]
arguments =
[ "tests"
]

main :: IO ()
main = do
hints <- hlint arguments
if null hints
then exitSuccess
else exitFailure

0 comments on commit 4d696f5

Please sign in to comment.