[#722] Get encoding from hlint options

This commit is contained in:
Nikolay Yakimov 2016-01-12 22:09:33 +03:00
parent 0a0cd8041e
commit 5425a09666

View File

@ -22,7 +22,7 @@ lint opt file = ghandle handler $
withMappedFile file $ \tempfile -> do
(flags, classify, hint) <- liftIO $ argsSettings $ optLintHlintOpts opt
hSrc <- liftIO $ openFile tempfile ReadMode
liftIO $ hSetEncoding hSrc utf8
liftIO $ hSetEncoding hSrc (encoding flags)
res <- liftIO $ parseModuleEx flags file =<< Just `fmap` hGetContents hSrc
case res of
Right m -> pack . map show $ applyHints classify hint [m]