ghc-mod/Lint.hs

15 lines
371 B
Haskell
Raw Normal View History

2010-05-06 06:29:55 +00:00
module Lint where
import Control.Applicative
import Data.List
2010-06-08 02:12:59 +00:00
import Language.Haskell.HLint
2010-05-06 06:29:55 +00:00
import Types
lintSyntax :: Options -> String -> IO String
2013-03-12 07:19:44 +00:00
lintSyntax opt file = pack <$> lint opt file
2010-05-06 06:29:55 +00:00
where
2013-03-12 07:19:44 +00:00
pack = unlines . map (intercalate "\0" . lines)
2010-05-06 06:29:55 +00:00
lint :: Options -> String -> IO [String]
lint opt file = map show <$> hlint ([file, "--quiet"] ++ hlintOpts opt)