Fix all warnings in internal libraries and enable -WError everywhere

### Description

This PR:
- fixes the package names in dev-sh.project.local (the config was using the names of the folders, not the names of the packages)
- adds similar options to CI: we also want to build with CI and in parallel there
- fixes all warnings

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7761
GitOrigin-RevId: ef1d78db8c94f5e74c18443aa517544f6a6f5a10
This commit is contained in:
Antoine Leblanc 2023-02-01 23:30:49 +00:00 committed by hasura-bot
parent 30e772d3fa
commit 1fe7fe43b8
6 changed files with 49 additions and 13 deletions

View File

@ -28,6 +28,40 @@ package graphql-engine
tests: true
benchmarks: true
-- Set common options to internal libraries
package aeson-ordered
ghc-options: -j -Werror
package api-tests
ghc-options: -j -Werror
package dc-api
ghc-options: -j -Werror
package graphql-parser
ghc-options: -j -Werror
package hasura-error-message
ghc-options: -j -Werror
package hasura-incremental
ghc-options: -j -Werror
package hasura-prelude
ghc-options: -j -Werror
package hasura-schema-parsers
ghc-options: -j -Werror
package pg-client
ghc-options: -j -Werror
package resource-pool
ghc-options: -j -Werror
package test-harness
ghc-options: -j -Werror
-- %%%-BEGIN-PRO-ONLY-CONTENT-%%%
-- NOTE:

View File

@ -56,6 +56,7 @@ package Spock
package hasql-pool
library-vanilla: False
-- Set common options to internal libraries
package aeson-ordered
ghc-options: -j -Werror
@ -65,28 +66,30 @@ package api-tests
package dc-api
ghc-options: -j -Werror
package error-message
package graphql-parser
ghc-options: -j -Werror
package graphql-parser-hs
package hasura-error-message
ghc-options: -j -Werror
package hasura-incremental
ghc-options: -j -Werror
package hasura-prelude
ghc-options: -j -Werror
package pg-client-hs
package hasura-schema-parsers
ghc-options: -j -Werror
package pool
package pg-client
ghc-options: -j -Werror
package schema-parsers
package resource-pool
ghc-options: -j -Werror
package test-harness
ghc-options: -j -Werror
package mysql
extra-include-dirs:
/opt/homebrew/opt/openssl/include

View File

@ -44,7 +44,7 @@ import Data.Attoparsec.ByteString.Char8 qualified as A8
import Data.Bifunctor (bimap, second)
import Data.ByteString (ByteString)
import Data.ByteString.Lazy qualified as L
import Data.Data (Data, Typeable)
import Data.Data (Data)
import Data.Functor (($>))
import Data.HashMap.Strict.InsOrd (InsOrdHashMap)
import Data.HashMap.Strict.InsOrd qualified as OMap
@ -83,7 +83,7 @@ import GHC.Generics (Generic)
-- | A JSON \"object\" (key\/value map). This is where this type
-- differs to the aeson package.
newtype Object = Object_ {unObject_ :: InsOrdHashMap Text Value}
deriving stock (Data, Eq, Generic, Read, Show, Typeable)
deriving stock (Data, Eq, Generic, Read, Show)
deriving newtype (Hashable)
-- | Union the keys, ordered, in two maps, erroring on duplicates.
@ -152,7 +152,7 @@ data Value
| Number !Scientific
| Bool !Bool
| Null
deriving stock (Data, Eq, Generic, Read, Show, Typeable)
deriving stock (Data, Eq, Generic, Read, Show)
instance Hashable Value where
-- Lifted from Aeson's implementation for 'Value'.

View File

@ -95,3 +95,4 @@ test-suite hasura-incremental-tests
default-extensions:
BlockArguments
NoImplicitPrelude

View File

@ -17,7 +17,6 @@ module Hasura.Incremental.Internal.Dependency
where
import Data.Dependent.Map qualified as DM
import "dependent-sum" Data.GADT.Compare
import Data.Reflection
import Hasura.Incremental.Select
import Hasura.Prelude

View File

@ -102,7 +102,6 @@ import Data.HashMap.Strict qualified as Map
import Data.HashMap.Strict.InsOrd as M (InsOrdHashMap)
import Data.HashMap.Strict.InsOrd qualified as OMap
import Data.HashSet as M (HashSet)
import Data.HashSet qualified as HSet
import Data.Hashable as M (Hashable)
import Data.List as M
( find,
@ -239,10 +238,10 @@ findWithIndex p l = do
pure (v, i)
-- TODO (from main): Move to Data.HashMap.Strict.Extended; rename to fromListWith?
mapFromL :: (Eq k, Hashable k) => (a -> k) -> [a] -> Map.HashMap k a
mapFromL :: (Hashable k) => (a -> k) -> [a] -> Map.HashMap k a
mapFromL f = Map.fromList . map (\v -> (f v, v))
oMapFromL :: (Eq k, Hashable k) => (a -> k) -> [a] -> InsOrdHashMap k a
oMapFromL :: (Hashable k) => (a -> k) -> [a] -> InsOrdHashMap k a
oMapFromL f = OMap.fromList . map (\v -> (f v, v))
-- | Time an IO action, returning the time with microsecond precision. The