Skip to content

Commit

Permalink
travis: enable -Wall -Werror
Browse files Browse the repository at this point in the history
  • Loading branch information
soenkehahn committed Apr 21, 2016
1 parent 555038c commit b26bbfc
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 31 deletions.
8 changes: 2 additions & 6 deletions doc/tutorial/tutorial.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions servant-blaze/servant-blaze.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ library
hs-source-dirs: src
default-language: Haskell2010
include-dirs: include
ghc-options: -Wall
1 change: 1 addition & 0 deletions servant-cassava/servant-cassava.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ library
hs-source-dirs: src
default-language: Haskell2010
include-dirs: include
ghc-options: -Wall
3 changes: 1 addition & 2 deletions servant-client/servant-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion servant-client/test/Servant/ClientSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion servant-docs/servant-docs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ test-suite spec
, servant-docs
, string-conversions
default-language: Haskell2010

3 changes: 2 additions & 1 deletion servant-foreign/src/Servant/Foreign/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion servant-js/servant-js.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion servant-js/src/Servant/JS/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions servant-lucid/servant-lucid.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ library
hs-source-dirs: src
default-language: Haskell2010
include-dirs: include
ghc-options: -Wall
3 changes: 3 additions & 0 deletions servant-mock/example/main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions servant-mock/servant-mock.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions servant-server/servant-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
9 changes: 5 additions & 4 deletions servant-server/test/Servant/Server/Internal/ContextSpec.hs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion servant-server/test/Servant/Server/Internal/EnterSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions servant-server/test/Servant/Server/RouterSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion servant-server/test/Servant/Server/StreamingSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion servant-server/test/Servant/Server/UsingContextSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions servant/servant.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b26bbfc

Please sign in to comment.