Skip to content

Commit 0cc85fc

Browse files
committed
Warning-free for -Wall and -Wcompat
1 parent 1394ec6 commit 0cc85fc

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

FixWhitespace.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import qualified Data.Text.IO as Text -- Strict IO.
1414
import System.Directory ( getCurrentDirectory, doesFileExist)
1515
import System.Environment
1616
import System.Exit
17-
import System.FilePath
18-
import System.FilePattern
17+
-- import System.FilePath
18+
-- import System.FilePattern
1919
import System.FilePattern.Directory
2020
import System.IO
2121
import System.Console.GetOpt
@@ -40,6 +40,7 @@ data Options = Options
4040
-- ^ The location to the configuration file.
4141
}
4242

43+
defaultOptions :: Options
4344
defaultOptions = Options
4445
{ optVerbose = False
4546
, optHelp = False
@@ -214,8 +215,8 @@ transform =
214215
n = 8 - p `mod` 8
215216
convertOne (a, p) c = (c:a, p+1)
216217

217-
addSpaces 0 x = x
218-
addSpaces n x = addSpaces (n-1) (' ':x)
218+
addSpaces :: Int -> String -> String
219+
addSpaces n = (replicate n ' ' ++)
219220

220221
-- | 'dropWhile' except keep the first of the dropped elements
221222
dropWhile1 :: (a -> Bool) -> [a] -> [a]

ParseConfig.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ instance FromJSON RawConfig where
3232
v .:? "excluded-files"
3333
parseJSON _ = fail "Expected Object for Config value"
3434

35-
parseRawConfig :: FilePath -> IO (Either Y.ParseException RawConfig)
36-
parseRawConfig = Y.decodeFileEither
35+
-- -- UNUSED
36+
-- parseRawConfig :: FilePath -> IO (Either Y.ParseException RawConfig)
37+
-- parseRawConfig = Y.decodeFileEither
3738

3839
parseConfig :: FilePath -> IO Config
3940
parseConfig fp = do

fix-whitespace.cabal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ executable fix-whitespace
4848
-- The other GHC versions can restrict to >= 1.2.3.1.
4949
if impl(ghc < 8.4.1) || impl(ghc > 8.4.3)
5050
build-depends: text >= 1.2.3.1
51+
52+
ghc-options:
53+
-Wall
54+
-Wcompat

0 commit comments

Comments
 (0)