on master help sign in
Merge pull request #766 from obsidiansystems/eac@eradicate-warnings
86545e2Elliot Cameron
lib/asset/manifest/obelisk-asset-manifest.cabal+3−1
@@ -33,7 +33,9 @@ library
33 Obelisk.Asset.TH
33 Obelisk.Asset.TH
34
34
35 other-extensions: TemplateHaskell
35 other-extensions: TemplateHaskell
36+ ghc-options:
37+ -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O2
36− ghc-options: -Wall -Werror -fno-warn-unused-do-bind -fwarn-tabs -funbox-strict-fields -O2 -fprof-auto-calls
38+ -fno-warn-unused-do-bind -funbox-strict-fields -fprof-auto-calls
37
39
38executable obelisk-asset-manifest-generate
40executable obelisk-asset-manifest-generate
39 hs-source-dirs: src-bin
41 hs-source-dirs: src-bin
lib/asset/serve-snap/obelisk-asset-serve-snap.cabal+3−1
@@ -29,4 +29,6 @@ library
29 Obelisk.Asset.Serve.Snap
29 Obelisk.Asset.Serve.Snap
30
30
31 other-extensions: TemplateHaskell
31 other-extensions: TemplateHaskell
32+ ghc-options:
33+ -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O2
32− ghc-options: -Wall -Werror -fno-warn-unused-do-bind -fwarn-tabs -funbox-strict-fields -O2 -fprof-auto-calls
34+ -fno-warn-unused-do-bind -funbox-strict-fields -fprof-auto-calls
lib/backend/obelisk-backend.cabal+1−1
@@ -27,4 +27,4 @@ library
27 text,
27 text,
28 universe
28 universe
29 exposed-modules: Obelisk.Backend
29 exposed-modules: Obelisk.Backend
30− ghc-options: -Wall
30+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
lib/cliapp/obelisk-cliapp.cabal+1−1
@@ -34,4 +34,4 @@ library
34 Obelisk.CliApp.TerminalString
34 Obelisk.CliApp.TerminalString
35 Obelisk.CliApp.Theme
35 Obelisk.CliApp.Theme
36 Obelisk.CliApp.Types
36 Obelisk.CliApp.Types
37− ghc-options: -Wall -fobject-code
37+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
lib/cliapp/src/Obelisk/CliApp/Logging.hs+2−2
@@ -160,7 +160,7 @@ failWith :: (CliThrow e m, AsUnstructuredError e) => Text -> m a
160failWith = throwError . review asUnstructuredError
160failWith = throwError . review asUnstructuredError
161
161
162errorToWarning
162errorToWarning
163− :: (HasCliConfig e m, CliThrow e m, CliLog m)
163+ :: (HasCliConfig e m, CliLog m)
164 => e -> m ()
164 => e -> m ()
165errorToWarning e = do
165errorToWarning e = do
166 c <- getCliConfig
166 c <- getCliConfig
@@ -177,7 +177,7 @@ withExitFailMessage msg f = f `catch` \(e :: ExitCode) -> do
177 throwM e
177 throwM e
178
178
179-- | Write log to stdout, with colors (unless `noColor`)
179-- | Write log to stdout, with colors (unless `noColor`)
180−writeLog :: (MonadIO m, MonadMask m) => Bool -> Bool -> WithSeverity Text -> m ()
180+writeLog :: (MonadIO m) => Bool -> Bool -> WithSeverity Text -> m ()
181writeLog withNewLine noColor (WithSeverity severity s) = if T.null s then pure () else write
181writeLog withNewLine noColor (WithSeverity severity s) = if T.null s then pure () else write
182 where
182 where
183 write
183 write
lib/cliapp/src/Obelisk/CliApp/Process.hs+6−7
@@ -1,7 +1,6 @@
1{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE LambdaCase #-}
2{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4−{-# LANGUAGE MultiWayIf #-}
5{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE OverloadedStrings #-}
6{-# LANGUAGE ScopedTypeVariables #-}
5{-# LANGUAGE ScopedTypeVariables #-}
7{-# LANGUAGE TupleSections #-}
6{-# LANGUAGE TupleSections #-}
@@ -102,7 +101,7 @@ instance AsProcessFailure ProcessFailure where
102 asProcessFailure = id
101 asProcessFailure = id
103
102
104readProcessAndLogStderr
103readProcessAndLogStderr
105− :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m)
104+ :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m)
106 => Severity -> ProcessSpec -> m Text
105 => Severity -> ProcessSpec -> m Text
107readProcessAndLogStderr sev process = do
106readProcessAndLogStderr sev process = do
108 (out, _err) <- withProcess process $ \_out err -> do
107 (out, _err) <- withProcess process $ \_out err -> do
@@ -110,7 +109,7 @@ readProcessAndLogStderr sev process = do
110 liftIO $ T.decodeUtf8With lenientDecode <$> BS.hGetContents out
109 liftIO $ T.decodeUtf8With lenientDecode <$> BS.hGetContents out
111
110
112readProcessJSONAndLogStderr
111readProcessJSONAndLogStderr
113− :: (Aeson.FromJSON a, MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m)
112+ :: (Aeson.FromJSON a, MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m)
114 => Severity -> ProcessSpec -> m a
113 => Severity -> ProcessSpec -> m a
115readProcessJSONAndLogStderr sev process = do
114readProcessJSONAndLogStderr sev process = do
116 (out, _err) <- withProcess process $ \_out err -> do
115 (out, _err) <- withProcess process $ \_out err -> do
@@ -123,7 +122,7 @@ readProcessJSONAndLogStderr sev process = do
123 throwError $ review asProcessFailure $ ProcessFailure (Process.cmdspec $ _processSpec_createProcess process) 0
122 throwError $ review asProcessFailure $ ProcessFailure (Process.cmdspec $ _processSpec_createProcess process) 0
124
123
125readCreateProcessWithExitCode
124readCreateProcessWithExitCode
126− :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e)
125+ :: (MonadIO m, CliLog m)
127 => ProcessSpec -> m (ExitCode, String, String)
126 => ProcessSpec -> m (ExitCode, String, String)
128readCreateProcessWithExitCode procSpec = do
127readCreateProcessWithExitCode procSpec = do
129 process <- mkCreateProcess procSpec
128 process <- mkCreateProcess procSpec
@@ -159,7 +158,7 @@ readProcessAndLogOutput (sev_out, sev_err) process = do
159-- which case it is advisable to call it with a non-Error severity for stderr, like
158-- which case it is advisable to call it with a non-Error severity for stderr, like
160-- `callProcessAndLogOutput (Debug, Debug)`.
159-- `callProcessAndLogOutput (Debug, Debug)`.
161callProcessAndLogOutput
160callProcessAndLogOutput
162− :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m)
161+ :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m)
163 => (Severity, Severity) -> ProcessSpec -> m ()
162 => (Severity, Severity) -> ProcessSpec -> m ()
164callProcessAndLogOutput (sev_out, sev_err) process =
163callProcessAndLogOutput (sev_out, sev_err) process =
165 void $ withProcess process $ \out err -> do
164 void $ withProcess process $ \out err -> do
@@ -212,7 +211,7 @@ callCommand cmd = do
212 liftIO $ Process.callCommand cmd
211 liftIO $ Process.callCommand cmd
213
212
214withProcess
213withProcess
215− :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadFail m, MonadMask m)
214+ :: (MonadIO m, CliLog m, CliThrow e m, AsProcessFailure e, MonadMask m)
216 => ProcessSpec -> (Handle -> Handle -> m ()) -> m (Handle, Handle)
215 => ProcessSpec -> (Handle -> Handle -> m ()) -> m (Handle, Handle)
217withProcess process f =
216withProcess process f =
218 bracketOnError
217 bracketOnError
@@ -229,7 +228,7 @@ withProcess process f =
229
228
230-- | Runs a process to completion failing if it does not exit cleanly.
229-- | Runs a process to completion failing if it does not exit cleanly.
231runProcess_
230runProcess_
232− :: (MonadIO m, CliLog m, CliThrow e m, MonadMask m, AsProcessFailure e, MonadFail m)
231+ :: (MonadIO m, CliLog m, CliThrow e m, MonadMask m, AsProcessFailure e)
233 => ProcessSpec -> m ()
232 => ProcessSpec -> m ()
234runProcess_ process =
233runProcess_ process =
235 bracketOnError
234 bracketOnError
lib/command/obelisk-command.cabal+1−1
@@ -66,4 +66,4 @@ library
66executable ob
66executable ob
67 main-is: src-bin/ob.hs
67 main-is: src-bin/ob.hs
68 build-depends: base, obelisk-command
68 build-depends: base, obelisk-command
69− ghc-options: -Wall -O2 -threaded
69+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O -threaded
lib/executable-config/inject/obelisk-executable-config-inject.cabal+1−1
@@ -15,4 +15,4 @@ library
15 text
15 text
16
16
17 exposed-modules: Obelisk.ExecutableConfig.Inject
17 exposed-modules: Obelisk.ExecutableConfig.Inject
18− ghc-options: -Wall
18+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
lib/frontend/obelisk-frontend.cabal+1−1
@@ -26,4 +26,4 @@ library
26 exposed-modules:
26 exposed-modules:
27 Obelisk.Frontend
27 Obelisk.Frontend
28 Obelisk.Frontend.Cookie
28 Obelisk.Frontend.Cookie
29− ghc-options: -Wall
29+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
lib/route/obelisk-route.cabal+1−1
@@ -38,4 +38,4 @@ library
38 exposed-modules: Obelisk.Route
38 exposed-modules: Obelisk.Route
39 Obelisk.Route.TH
39 Obelisk.Route.TH
40 Obelisk.Route.Frontend
40 Obelisk.Route.Frontend
41− ghc-options: -Wall -fwarn-redundant-constraints
41+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
lib/run/obelisk-run.cabal+1−1
@@ -47,7 +47,7 @@ library
47 , websockets
47 , websockets
48 exposed-modules:
48 exposed-modules:
49 Obelisk.Run
49 Obelisk.Run
50− ghc-options: -Wall -fwarn-redundant-constraints
50+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
51 if os(linux)
51 if os(linux)
52 cpp-options: -DIPROUTE_SUPPORTED
52 cpp-options: -DIPROUTE_SUPPORTED
53 build-depends: which
53 build-depends: which
lib/snap-extras/obelisk-snap-extras.cabal+1−1
@@ -17,4 +17,4 @@ library
17 , text
17 , text
18 exposed-modules:
18 exposed-modules:
19 Obelisk.Snap.Extras
19 Obelisk.Snap.Extras
20− ghc-options: -Wall
20+ ghc-options: -Wall -Werror -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
skeleton/backend/backend.cabal+2−1
@@ -14,11 +14,12 @@ library
14 , obelisk-route
14 , obelisk-route
15 exposed-modules:
15 exposed-modules:
16 Backend
16 Backend
17− ghc-options: -Wall
17+ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
18
18
19executable backend
19executable backend
20 main-is: main.hs
20 main-is: main.hs
21 hs-source-dirs: src-bin
21 hs-source-dirs: src-bin
22+ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
22 if impl(ghcjs)
23 if impl(ghcjs)
23 buildable: False
24 buildable: False
24 build-depends: base
25 build-depends: base
skeleton/common/common.cabal+1−1
@@ -12,4 +12,4 @@ library
12 exposed-modules:
12 exposed-modules:
13 Common.Api
13 Common.Api
14 Common.Route
14 Common.Route
15− ghc-options: -Wall
15+ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
skeleton/frontend/frontend.cabal+2−2
@@ -16,7 +16,7 @@ library
16 , text
16 , text
17 exposed-modules:
17 exposed-modules:
18 Frontend
18 Frontend
19− ghc-options: -Wall
19+ ghc-options: -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates -O
20
20
21executable frontend
21executable frontend
22 main-is: main.hs
22 main-is: main.hs
@@ -28,7 +28,7 @@ executable frontend
28 , reflex-dom
28 , reflex-dom
29 , obelisk-generated-static
29 , obelisk-generated-static
30 , frontend
30 , frontend
31− ghc-options: -threaded
31+ ghc-options: -threaded -O -Wall -Wredundant-constraints -Wincomplete-uni-patterns -Wincomplete-record-updates
32 if impl(ghcjs)
32 if impl(ghcjs)
33 ghc-options: -dedupe
33 ghc-options: -dedupe
34 cpp-options: -DGHCJS_BROWSER
34 cpp-options: -DGHCJS_BROWSER