diff --git a/doc/tutorial/tutorial.cabal b/doc/tutorial/tutorial.cabal index 021f1a10..badde620 100644 --- a/doc/tutorial/tutorial.cabal +++ b/doc/tutorial/tutorial.cabal @@ -46,15 +46,11 @@ library , markdown-unlit >= 0.4 , http-client default-language: Haskell2010 - ghc-options: -Wall -Werror -pgmL markdown-unlit - -- to silence aeson-0.10 warnings: - ghc-options: -fno-warn-missing-methods - ghc-options: -fno-warn-name-shadowing + ghc-options: -Wall -pgmL markdown-unlit test-suite spec type: exitcode-stdio-1.0 - ghc-options: - -Wall -fno-warn-name-shadowing -fno-warn-missing-signatures + ghc-options: -Wall default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs diff --git a/servant-blaze/servant-blaze.cabal b/servant-blaze/servant-blaze.cabal index 3ce7faa4..c4203651 100644 --- a/servant-blaze/servant-blaze.cabal +++ b/servant-blaze/servant-blaze.cabal @@ -31,3 +31,4 @@ library hs-source-dirs: src default-language: Haskell2010 include-dirs: include + ghc-options: -Wall diff --git a/servant-cassava/servant-cassava.cabal b/servant-cassava/servant-cassava.cabal index 117ec804..a336c4e8 100644 --- a/servant-cassava/servant-cassava.cabal +++ b/servant-cassava/servant-cassava.cabal @@ -28,3 +28,4 @@ library hs-source-dirs: src default-language: Haskell2010 include-dirs: include + ghc-options: -Wall diff --git a/servant-client/servant-client.cabal b/servant-client/servant-client.cabal index d074c1f8..a1e42925 100644 --- a/servant-client/servant-client.cabal +++ b/servant-client/servant-client.cabal @@ -60,8 +60,7 @@ library test-suite spec type: exitcode-stdio-1.0 - ghc-options: - -Wall -fno-warn-name-shadowing -fno-warn-missing-signatures + ghc-options: -Wall default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index 17048593..c41b4093 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -28,7 +28,7 @@ import Control.Applicative ((<$>)) import Control.Arrow (left) import Control.Concurrent (forkIO, killThread, ThreadId) import Control.Exception (bracket) -import Control.Monad.Trans.Except (ExceptT, throwE, runExceptT) +import Control.Monad.Trans.Except (throwE, runExceptT) import Data.Aeson import qualified Data.ByteString.Lazy as BS import Data.Char (chr, isPrint) diff --git a/servant-docs/servant-docs.cabal b/servant-docs/servant-docs.cabal index 0c877c52..8ae8b810 100644 --- a/servant-docs/servant-docs.cabal +++ b/servant-docs/servant-docs.cabal @@ -82,4 +82,3 @@ test-suite spec , servant-docs , string-conversions default-language: Haskell2010 - diff --git a/servant-foreign/src/Servant/Foreign/Internal.hs b/servant-foreign/src/Servant/Foreign/Internal.hs index 72f24116..4e457897 100644 --- a/servant-foreign/src/Servant/Foreign/Internal.hs +++ b/servant-foreign/src/Servant/Foreign/Internal.hs @@ -7,7 +7,8 @@ -- arbitrary programming languages. module Servant.Foreign.Internal where -import Control.Lens hiding (cons, List) +import Control.Lens (makePrisms, makeLenses, Getter, (&), (<>~), (%~), + (.~)) #if !MIN_VERSION_base(4,8,0) import Data.Monoid #endif diff --git a/servant-js/servant-js.cabal b/servant-js/servant-js.cabal index 52216a1b..13beb73c 100644 --- a/servant-js/servant-js.cabal +++ b/servant-js/servant-js.cabal @@ -55,7 +55,7 @@ library executable counter main-is: counter.hs - ghc-options: -O2 -Wall + ghc-options: -Wall hs-source-dirs: examples if flag(example) diff --git a/servant-js/src/Servant/JS/Internal.hs b/servant-js/src/Servant/JS/Internal.hs index d123ef9a..1eb28199 100644 --- a/servant-js/src/Servant/JS/Internal.hs +++ b/servant-js/src/Servant/JS/Internal.hs @@ -46,7 +46,7 @@ module Servant.JS.Internal , Header ) where -import Control.Lens hiding (List) +import Control.Lens ((^.)) import qualified Data.CharSet as Set import qualified Data.CharSet.Unicode.Category as Set import Data.Monoid diff --git a/servant-lucid/servant-lucid.cabal b/servant-lucid/servant-lucid.cabal index b0e17a96..5b2199aa 100644 --- a/servant-lucid/servant-lucid.cabal +++ b/servant-lucid/servant-lucid.cabal @@ -31,3 +31,4 @@ library hs-source-dirs: src default-language: Haskell2010 include-dirs: include + ghc-options: -Wall diff --git a/servant-mock/example/main.hs b/servant-mock/example/main.hs index 4a457467..a602dc88 100644 --- a/servant-mock/example/main.hs +++ b/servant-mock/example/main.hs @@ -2,6 +2,9 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeOperators #-} + +{-# OPTIONS_GHC -fno-warn-unused-binds #-} + import Data.Aeson import GHC.Generics import Network.Wai.Handler.Warp diff --git a/servant-mock/servant-mock.cabal b/servant-mock/servant-mock.cabal index 871c3fe9..8940e7c2 100644 --- a/servant-mock/servant-mock.cabal +++ b/servant-mock/servant-mock.cabal @@ -35,6 +35,7 @@ library hs-source-dirs: src default-language: Haskell2010 include-dirs: include + ghc-options: -Wall executable mock-app main-is: main.hs @@ -45,11 +46,11 @@ executable mock-app buildable: True else buildable: False + ghc-options: -Wall test-suite spec type: exitcode-stdio-1.0 - ghc-options: - -Wall -fno-warn-name-shadowing + ghc-options: -Wall default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs diff --git a/servant-server/servant-server.cabal b/servant-server/servant-server.cabal index fc577514..321750db 100644 --- a/servant-server/servant-server.cabal +++ b/servant-server/servant-server.cabal @@ -94,8 +94,7 @@ executable greet test-suite spec type: exitcode-stdio-1.0 - ghc-options: - -Wall -fno-warn-name-shadowing -fno-warn-missing-signatures + ghc-options: -Wall default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs @@ -147,5 +146,5 @@ test-suite doctests main-is: test/Doctests.hs buildable: True default-language: Haskell2010 - ghc-options: -threaded + ghc-options: -Wall -threaded include-dirs: include diff --git a/servant-server/test/Servant/Server/Internal/ContextSpec.hs b/servant-server/test/Servant/Server/Internal/ContextSpec.hs index dfac1e2e..887f7269 100644 --- a/servant-server/test/Servant/Server/Internal/ContextSpec.hs +++ b/servant-server/test/Servant/Server/Internal/ContextSpec.hs @@ -1,9 +1,9 @@ {-# LANGUAGE DataKinds #-} -{-# OPTIONS_GHC -fdefer-type-errors #-} +{-# OPTIONS_GHC -fdefer-type-errors -Wwarn #-} module Servant.Server.Internal.ContextSpec (spec) where import Data.Proxy (Proxy (..)) -import Test.Hspec (Spec, describe, it, shouldBe, pending, context) +import Test.Hspec (Spec, describe, it, shouldBe, context) import Test.ShouldNotTypecheck (shouldNotTypecheck) import Servant.API @@ -26,16 +26,17 @@ spec = do shouldNotTypecheck x context "Show instance" $ do - let cxt = 'a' :. True :. EmptyContext it "has a Show instance" $ do + let cxt = 'a' :. True :. EmptyContext show cxt `shouldBe` "'a' :. True :. EmptyContext" context "bracketing" $ do it "works" $ do + let cxt = 'a' :. True :. EmptyContext show (Just cxt) `shouldBe` "Just ('a' :. True :. EmptyContext)" it "works with operators" $ do - let cxt = (1 :. 'a' :. EmptyContext) :<|> ('b' :. True :. EmptyContext) + let cxt = ((1 :: Integer) :. 'a' :. EmptyContext) :<|> ('b' :. True :. EmptyContext) show cxt `shouldBe` "(1 :. 'a' :. EmptyContext) :<|> ('b' :. True :. EmptyContext)" describe "descendIntoNamedContext" $ do diff --git a/servant-server/test/Servant/Server/Internal/EnterSpec.hs b/servant-server/test/Servant/Server/Internal/EnterSpec.hs index 1591e987..821d5640 100644 --- a/servant-server/test/Servant/Server/Internal/EnterSpec.hs +++ b/servant-server/test/Servant/Server/Internal/EnterSpec.hs @@ -5,7 +5,6 @@ module Servant.Server.Internal.EnterSpec where import qualified Control.Category as C import Control.Monad.Reader -import Control.Monad.Trans.Except import Data.Proxy import Servant.API import Servant.Server diff --git a/servant-server/test/Servant/Server/RouterSpec.hs b/servant-server/test/Servant/Server/RouterSpec.hs index 684361b2..e1ec5d7b 100644 --- a/servant-server/test/Servant/Server/RouterSpec.hs +++ b/servant-server/test/Servant/Server/RouterSpec.hs @@ -16,6 +16,7 @@ import Servant.API import Servant.Server import Servant.Server.Internal +spec :: Spec spec = describe "Servant.Server.Internal.Router" $ do routerSpec distributivitySpec diff --git a/servant-server/test/Servant/Server/StreamingSpec.hs b/servant-server/test/Servant/Server/StreamingSpec.hs index ed289257..215664ee 100644 --- a/servant-server/test/Servant/Server/StreamingSpec.hs +++ b/servant-server/test/Servant/Server/StreamingSpec.hs @@ -11,7 +11,6 @@ module Servant.Server.StreamingSpec where import Control.Concurrent import Control.Exception hiding (Handler) import Control.Monad.IO.Class -import Control.Monad.Trans.Except import qualified Data.ByteString as Strict import qualified Data.ByteString.Lazy as Lazy import Network.HTTP.Types diff --git a/servant-server/test/Servant/Server/UsingContextSpec.hs b/servant-server/test/Servant/Server/UsingContextSpec.hs index 1f9c3328..91ab8376 100644 --- a/servant-server/test/Servant/Server/UsingContextSpec.hs +++ b/servant-server/test/Servant/Server/UsingContextSpec.hs @@ -5,7 +5,6 @@ module Servant.Server.UsingContextSpec where -import Control.Monad.Trans.Except import Network.Wai import Test.Hspec (Spec, describe, it) import Test.Hspec.Wai diff --git a/servant-server/test/Servant/Server/UsingContextSpec/TestCombinators.hs b/servant-server/test/Servant/Server/UsingContextSpec/TestCombinators.hs index 21999451..0a718788 100644 --- a/servant-server/test/Servant/Server/UsingContextSpec/TestCombinators.hs +++ b/servant-server/test/Servant/Server/UsingContextSpec/TestCombinators.hs @@ -30,12 +30,12 @@ instance (HasContextEntry context String, HasServer subApi context) => String -> ServerT subApi m route Proxy context delayed = - route subProxy context (fmap (inject context) delayed) + route subProxy context (fmap inject delayed) where subProxy :: Proxy subApi subProxy = Proxy - inject context f = f (getContextEntry context) + inject f = f (getContextEntry context) data InjectIntoContext diff --git a/servant/servant.cabal b/servant/servant.cabal index 1faddaaa..7e0a16f7 100644 --- a/servant/servant.cabal +++ b/servant/servant.cabal @@ -89,8 +89,7 @@ library test-suite spec type: exitcode-stdio-1.0 - ghc-options: - -Wall -fno-warn-name-shadowing -fno-warn-missing-signatures + ghc-options: -Wall default-language: Haskell2010 hs-source-dirs: test main-is: Spec.hs @@ -122,5 +121,5 @@ test-suite doctests main-is: test/Doctests.hs buildable: True default-language: Haskell2010 - ghc-options: -threaded + ghc-options: -Wall -threaded include-dirs: include diff --git a/travis.sh b/travis.sh index 60734911..cd815efb 100755 --- a/travis.sh +++ b/travis.sh @@ -6,7 +6,7 @@ for package in $(cat sources.txt) doc/tutorial ; do echo testing $package pushd $package tinc - cabal configure --enable-tests --disable-optimization + cabal configure --enable-tests --disable-optimization --ghc-options='-Werror' cabal build cabal test popd