on master help sign in
Cleaned up code
commit91010d0ec065d56c927e5e994547c7f6b7ba91f1 authoriko <ilyakooo0@gmail.com> dateSun 11 Aug 2019, 01:50 (7 years ago) parente70c298
5 files changed+18−8
app/Main.hs−2 src/Control/Hext/Config.hs+1−1 src/Control/Hext/Processor.hs+4−4 src/Data/Haskell/Parser.hs+1−1 stack.yaml+12
app/Main.hs−2
@@ -8,8 +8,6 @@ import Relude
88import Control.Hext.Arguments
99import Control.Hext.Config
1010import Control.Hext.Processor
11−import Data.Haskell.Parser
12−import Text.Megaparsec
1311
1412main :: IO ()
1513main = do
src/Control/Hext/Config.hs+1−1
@@ -31,7 +31,7 @@ data LineLimit
3131
3232instance FromJSON LineLimit where
3333 parseJSON (A.Number n)
34− | Right n' <- floatingOrInteger n
34+ | Right n' <- floatingOrInteger @Double n
3535 , n' > 0
3636 = return $ Limited n'
3737 parseJSON (A.String "none") = return Unlimited
src/Control/Hext/Processor.hs+4−4
@@ -27,8 +27,8 @@ getFiles dir = do
2727 getHs (Dir name paths) | not $ "." `isPrefixOf` name = paths >>= getHs
2828 getHs _ = []
2929
30−processFile :: Maybe LineLimit -> Text -> Text -> Text
31−processFile limit extensions file =
30+processFile :: Text -> Text -> Text
31+processFile extensions file =
3232 extensions
3333 <> "\n"
3434 <> withoutExtensions file
@@ -40,11 +40,11 @@ baseLength :: Int
4040baseLength = T.length $ wrapExtension ""
4141
4242processFiles :: Maybe LineLimit -> [Text] -> FilePath -> IO ()
43−processFiles limit extensions dir = do
43+processFiles limit allExtensions dir = do
4444 files <- getFiles dir
4545 forM_ files $ \file -> do
4646 contents <- readFileText file
47− writeFileText file . processFile limit (wrapExtensions extensions) $ contents
47+ writeFileText file . processFile (wrapExtensions allExtensions) $ contents
4848 where
4949 wrapExtensions :: [Text] -> Text
5050 wrapExtensions [] = ""
src/Data/Haskell/Parser.hs+1−1
@@ -6,7 +6,7 @@ module Data.Haskell.Parser
66 , withoutExtensionsParser
77 ) where
88
9−import Relude hiding (some, many)
9+import Relude hiding (many, some)
1010
1111import Text.Megaparsec
1212import Text.Megaparsec.Char
stack.yaml+12
@@ -64,3 +64,15 @@ packages:
6464#
6565# Allow a newer minor version of GHC than the snapshot specifies
6666# compiler-check: newer-minor
67+
68+ghc-options:
69+ "$locals":
70+ -Wall
71+ -Wincomplete-uni-patterns
72+ -Wincomplete-record-updates
73+ -Wmissing-exported-signatures
74+ -Wmissing-home-modules
75+ -Widentities
76+ -Wmissed-specialisations
77+ -Wall-missed-specialisations
78+ -Wno-unused-do-bind