ghc-mod/Lint.hs

15 lines
384 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
lintSyntax opt file = pretty <$> lint opt file
2010-05-06 06:29:55 +00:00
where
2010-06-08 02:27:21 +00:00
pretty = unlines . map (concat . intersperse "\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)