fixing a bug of hlint options.
This commit is contained in:
parent
7c0f2511d0
commit
7fa3736bac
@ -159,9 +159,11 @@ lintStx set (LineSeparator lsep) optFile = liftIO $ E.handle handler $ do
|
|||||||
return (msgs, True, set)
|
return (msgs, True, set)
|
||||||
where
|
where
|
||||||
(opt,file) = parseLintOptions optFile
|
(opt,file) = parseLintOptions optFile
|
||||||
hopts = read opt
|
hopts = if opt == "" then [] else read opt
|
||||||
-- let's continue the session
|
-- let's continue the session
|
||||||
handler (SomeException _) = return ([], True, set)
|
handler (SomeException e) = do
|
||||||
|
print e
|
||||||
|
return ([], True, set)
|
||||||
|
|
||||||
-- |
|
-- |
|
||||||
-- >>> parseLintOptions "[\"--ignore=Use camelCase\", \"--ignore=Eta reduce\"] file name"
|
-- >>> parseLintOptions "[\"--ignore=Use camelCase\", \"--ignore=Eta reduce\"] file name"
|
||||||
@ -171,7 +173,7 @@ lintStx set (LineSeparator lsep) optFile = liftIO $ E.handle handler $ do
|
|||||||
parseLintOptions :: String -> (String, String)
|
parseLintOptions :: String -> (String, String)
|
||||||
parseLintOptions optFile = case brk (== ']') (dropWhile (/= '[') optFile) of
|
parseLintOptions optFile = case brk (== ']') (dropWhile (/= '[') optFile) of
|
||||||
("","") -> ([], optFile)
|
("","") -> ([], optFile)
|
||||||
(opt',file') -> (opt', dropWhile (/= ' ') file')
|
(opt',file') -> (opt', dropWhile (== ' ') file')
|
||||||
where
|
where
|
||||||
brk _ [] = ([],[])
|
brk _ [] = ([],[])
|
||||||
brk p (x:xs')
|
brk p (x:xs')
|
||||||
|
Loading…
Reference in New Issue
Block a user