git.iko.soy/typeable/servant
on master help sign in
Janitoring
commit965063171b9b6ecde45361f4a2d4d74a60ee6ec2 authorJulian K. Arni <jkarni@gmail.com> dateWed 23 Sep 2015, 18:26 (11 years ago) parentb50e912
12 files changed+38−10
servant-docs/servant-docs.cabal+1 servant-docs/src/Servant/Docs/Internal.hs+10−8 servant-examples/auth-combinator/auth-combinator.hs+1 servant-examples/hackage/hackage.hs+2 servant-examples/servant-examples.cabal+4 servant-examples/tutorial/T3.hs+1 servant-js/servant-js.cabal+3 servant-js/src/Servant/JS/Internal.hs+2−1 servant-mock/src/Servant/Mock.hs+2−1 servant-server/servant-server.cabal+5 servant/servant.cabal+5 stack.yaml+2
servant-docs/servant-docs.cabal+1
@@ -65,6 +65,7 @@ executable greet-docs
6565test-suite spec
6666 type: exitcode-stdio-1.0
6767 main-is: Spec.hs
68+ other-modules: Servant.DocsSpec
6869 hs-source-dirs: test
6970 ghc-options: -Wall
7071 build-depends:
servant-docs/src/Servant/Docs/Internal.hs+10−8
@@ -23,19 +23,21 @@ module Servant.Docs.Internal where
2323
2424import Control.Applicative
2525import Control.Arrow (second)
26−import Control.Lens hiding (List, to, from)
26+import Control.Lens (makeLenses, over, traversed, (%~),
27+ (&), (.~), (<>~), (^.), _1, _2,
28+ _last, (|>))
2729import qualified Control.Monad.Omega as Omega
2830import Data.ByteString.Conversion (ToByteString, toByteString)
2931import Data.ByteString.Lazy.Char8 (ByteString)
3032import qualified Data.CaseInsensitive as CI
31−import Data.Hashable
33+import Data.Hashable (Hashable)
3234import Data.HashMap.Strict (HashMap)
3335import Data.List
3436import Data.Maybe
3537import Data.Monoid
3638import Data.Ord (comparing)
37−import Data.Proxy
38−import Data.String.Conversions
39+import Data.Proxy (Proxy(Proxy))
40+import Data.String.Conversions (cs)
3941import Data.Text (Text, pack, unpack)
4042import GHC.Exts (Constraint)
4143import GHC.Generics
@@ -494,9 +496,9 @@ sampleByteStrings
494496 -> Proxy a
495497 -> [(Text, M.MediaType, ByteString)]
496498sampleByteStrings ctypes@Proxy Proxy =
497− let samples = toSamples (Proxy :: Proxy a)
499+ let samples' = toSamples (Proxy :: Proxy a)
498500 enc (t, s) = uncurry (t,,) <$> allMimeRender ctypes s
499− in concatMap enc samples
501+ in concatMap enc samples'
500502
501503-- | Generate a list of 'MediaType' values describing the content types
502504-- accepted by an API component.
@@ -640,10 +642,10 @@ markdown api = unlines $
640642
641643 rqbodyStr :: [M.MediaType] -> [(M.MediaType, ByteString)]-> [String]
642644 rqbodyStr [] [] = []
643− rqbodyStr types samples =
645+ rqbodyStr types s =
644646 ["#### Request:", ""]
645647 <> formatTypes types
646− <> concatMap formatBody samples
648+ <> concatMap formatBody s
647649
648650 formatTypes [] = []
649651 formatTypes ts = ["- Supported content types are:", ""]
servant-examples/auth-combinator/auth-combinator.hs+1
@@ -5,6 +5,7 @@
55{-# LANGUAGE ScopedTypeVariables #-}
66{-# LANGUAGE TypeFamilies #-}
77{-# LANGUAGE TypeOperators #-}
8+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
89import Data.Aeson
910import Data.ByteString (ByteString)
1011import Data.Text (Text)
servant-examples/hackage/hackage.hs+2
@@ -2,6 +2,8 @@
22{-# LANGUAGE DeriveGeneric #-}
33{-# LANGUAGE OverloadedStrings #-}
44{-# LANGUAGE TypeOperators #-}
5+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
6+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
57import Control.Applicative
68import Control.Monad
79import Control.Monad.IO.Class
servant-examples/servant-examples.cabal+4
@@ -20,6 +20,7 @@ source-repository head
2020executable tutorial
2121 main-is: tutorial.hs
2222 other-modules: T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
23+ ghc-options: -Wall -fno-warn-unused-binds -fno-warn-name-shadowing
2324 build-depends:
2425 aeson >= 0.8
2526 , base >= 4.7 && < 5
@@ -45,8 +46,10 @@ executable tutorial
4546
4647executable t8-main
4748 main-is: t8-main.hs
49+ other-modules: T3, T8
4850 hs-source-dirs: tutorial
4951 default-language: Haskell2010
52+ ghc-options: -Wall -fno-warn-unused-binds -fno-warn-name-shadowing
5053 build-depends:
5154 aeson
5255 , base >= 4.7 && < 5
@@ -101,6 +104,7 @@ executable auth-combinator
101104
102105executable socket-io-chat
103106 main-is: socket-io-chat.hs
107+ other-modules: Chat
104108 build-depends:
105109 aeson >= 0.8
106110 , base >= 4.7 && < 5
servant-examples/tutorial/T3.hs+1
@@ -2,6 +2,7 @@
22{-# LANGUAGE DeriveGeneric #-}
33{-# LANGUAGE TypeFamilies #-}
44{-# LANGUAGE TypeOperators #-}
5+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
56module T3 where
67
78import Control.Monad.Trans.Except
servant-js/servant-js.cabal+3
@@ -77,6 +77,9 @@ test-suite spec
7777 hs-source-dirs: test
7878 ghc-options: -Wall
7979 main-is: Spec.hs
80+ other-modules:
81+ Servant.JSSpec
82+ Servant.JSSpec.CustomHeaders
8083 build-depends: base
8184 , hspec >= 2.1.8
8285 , hspec-expectations
servant-js/src/Servant/JS/Internal.hs+2−1
@@ -1,3 +1,4 @@
1+<<<<<<< HEAD
12module Servant.JS.Internal
23 ( JavaScriptGenerator
34 , CommonGeneratorOptions(..)
@@ -29,7 +30,7 @@ module Servant.JS.Internal
2930 , Get
3031 , Raw
3132 , Header
32− ) where
33+ ) where
3334
3435import Control.Lens hiding (List)
3536import qualified Data.CharSet as Set
servant-mock/src/Servant/Mock.hs+2−1
@@ -5,6 +5,7 @@
55{-# LANGUAGE ScopedTypeVariables #-}
66{-# LANGUAGE TypeFamilies #-}
77{-# LANGUAGE TypeOperators #-}
8+{-# OPTIONS_GHC -fno-warn-orphans #-}
89-- |
910-- Module : Servant.Mock
1011-- Copyright : 2015 Alp Mestanogullari
@@ -165,7 +166,7 @@ instance (Arbitrary a, AllCTRender ctypes a) => HasMock (Put ctypes a) where
165166 mock _ = mockArbitrary
166167
167168instance HasMock Raw where
168− mock _ = \req respond -> do
169+ mock _ = \_req respond -> do
169170 bdy <- genBody
170171 respond $ responseLBS status200 [] bdy
171172
servant-server/servant-server.cabal+5
@@ -91,6 +91,11 @@ test-suite spec
9191 default-language: Haskell2010
9292 hs-source-dirs: test
9393 main-is: Spec.hs
94+ other-modules:
95+ Servant.Server.ErrorSpec
96+ Servant.Server.Internal.EnterSpec
97+ Servant.ServerSpec
98+ Servant.Utils.StaticFilesSpec
9499 build-depends:
95100 base == 4.*
96101 , aeson
servant/servant.cabal+5
@@ -90,6 +90,11 @@ test-suite spec
9090 default-language: Haskell2010
9191 hs-source-dirs: test
9292 main-is: Spec.hs
93+ other-modules:
94+ Servant.API.ContentTypesSpec
95+ Servant.API.ResponseHeadersSpec
96+ Servant.Common.TextSpec
97+ Servant.Utils.LinksSpec
9398 build-depends:
9499 base == 4.*
95100 , aeson
stack.yaml+2
@@ -1,6 +1,8 @@
11flags:
22 servant-js:
33 example: false
4+ghc-options:
5+ "*": -Wall
46packages:
57- servant/
68- servant-blaze/