ghc-mod/Lint.hs

15 lines
375 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
2011-08-24 06:58:12 +00:00
pretty = 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)