refactoring for lineSeparator.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
module Language.Haskell.GhcMod.Lint where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import Data.List (intercalate)
|
||||
import Language.Haskell.GhcMod.Types
|
||||
import Language.Haskell.GhcMod.Utils (replace)
|
||||
import Language.Haskell.HLint (hlint)
|
||||
|
||||
-- | Checking syntax of a target file using hlint.
|
||||
@@ -10,8 +10,8 @@ import Language.Haskell.HLint (hlint)
|
||||
lintSyntax :: Options
|
||||
-> FilePath -- ^ A target file.
|
||||
-> IO String
|
||||
lintSyntax opt file = pack . map show <$> hlint (file : "--quiet" : hopts)
|
||||
lintSyntax opt file = pack <$> hlint (file : "--quiet" : hopts)
|
||||
where
|
||||
LineSeparator lsep = lineSeparator opt
|
||||
pack = convert opt . map (intercalate lsep . lines)
|
||||
pack = convert opt . map (replace '\n' lsep . init . show)
|
||||
hopts = hlintOpts opt
|
||||
|
||||
Reference in New Issue
Block a user