2010-05-06 15:29:55 +09:00
|
|
|
module Lint where
|
|
|
|
|
|
|
|
|
|
import Control.Applicative
|
|
|
|
|
import Data.List
|
2010-06-08 11:12:59 +09:00
|
|
|
import Language.Haskell.HLint
|
2010-05-06 15:29:55 +09:00
|
|
|
import Types
|
|
|
|
|
|
|
|
|
|
lintSyntax :: Options -> String -> IO String
|
2010-06-14 11:56:35 +09:00
|
|
|
lintSyntax opt file = pretty <$> lint opt file
|
2010-05-06 15:29:55 +09:00
|
|
|
where
|
2011-08-24 15:58:12 +09:00
|
|
|
pretty = unlines . map (intercalate "\0" . lines)
|
2010-05-06 15:29:55 +09:00
|
|
|
|
2010-06-14 11:56:35 +09:00
|
|
|
lint :: Options -> String -> IO [String]
|
|
|
|
|
lint opt file = map show <$> hlint ([file, "--quiet"] ++ hlintOpts opt)
|