From 7fa3736bac1501059b211aec50cf0b3cbd1aec46 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Fri, 28 Mar 2014 15:03:41 +0900 Subject: [PATCH] fixing a bug of hlint options. --- src/GHCModi.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GHCModi.hs b/src/GHCModi.hs index 660e9ca..6474670 100644 --- a/src/GHCModi.hs +++ b/src/GHCModi.hs @@ -159,9 +159,11 @@ lintStx set (LineSeparator lsep) optFile = liftIO $ E.handle handler $ do return (msgs, True, set) where (opt,file) = parseLintOptions optFile - hopts = read opt + hopts = if opt == "" then [] else read opt -- 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" @@ -171,7 +173,7 @@ lintStx set (LineSeparator lsep) optFile = liftIO $ E.handle handler $ do parseLintOptions :: String -> (String, String) parseLintOptions optFile = case brk (== ']') (dropWhile (/= '[') optFile) of ("","") -> ([], optFile) - (opt',file') -> (opt', dropWhile (/= ' ') file') + (opt',file') -> (opt', dropWhile (== ' ') file') where brk _ [] = ([],[]) brk p (x:xs')