simplify hlint logic.
This commit is contained in:
parent
5dd3bb83eb
commit
60852b6980
10
Lint.hs
10
Lint.hs
@ -8,11 +8,7 @@ import Types
|
|||||||
lintSyntax :: Options -> String -> IO String
|
lintSyntax :: Options -> String -> IO String
|
||||||
lintSyntax _ file = pretty <$> lint file
|
lintSyntax _ file = pretty <$> lint file
|
||||||
where
|
where
|
||||||
pretty = unlines . map (concat . intersperse "\0")
|
pretty = unlines . map (concat . intersperse "\0" . lines)
|
||||||
. filter (\x -> length x > 1)
|
|
||||||
. groupBy (\a b -> a /= "" && b /= "") . lines
|
|
||||||
|
|
||||||
lint :: String -> IO String
|
lint :: String -> IO [String]
|
||||||
lint file = toString <$> hlint [file, "--quiet", "--ignore=Use camelCase"]
|
lint file = map show <$> hlint [file, "--quiet", "--ignore=Use camelCase"]
|
||||||
where
|
|
||||||
toString = concat . map show
|
|
||||||
|
Loading…
Reference in New Issue
Block a user