Skip to content

Commit 8453ee0

Browse files
committed
Build all local packages with -Werror
- Satisfy -Wmissing-signatures in test-runtime-deps - Satisfy -Wx-partial in HackageBenchmark - Satisfy -Wunused-imports in QuickCheck.Instances.Cabal - Use partial pattern for filtering in list comprehension - Don't error on deprecated import
1 parent 0876e18 commit 8453ee0

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
{-# OPTIONS_GHC -fno-warn-orphans #-}
44
module Test.QuickCheck.Instances.Cabal () where
55

6+
#if !MIN_VERSION_base(4,18,0)
67
import Control.Applicative (liftA2)
8+
#endif
79
import Data.Bits (shiftR)
810
import Data.Char (isAlphaNum, isDigit, toLower)
911
import Data.List (intercalate, (\\))

Cabal-tests/tests/CheckTests.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Main
33
) where
44

55
import Test.Tasty
6-
import Test.Tasty.ExpectedFailure
76
import Test.Tasty.Golden.Advanced (goldenTest)
87

98
import Data.Algorithm.Diff (PolyDiff (..), getGroupedDiff)

Cabal-tests/tests/UnitTests/Distribution/PackageDescription/Check.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
-- For the deprecated import of Distribution.Compat.Prelude.Internal
2+
{-# OPTIONS_GHC -Wwarn=deprecations #-}
3+
14
module UnitTests.Distribution.PackageDescription.Check (tests) where
25

36
import Distribution.Compat.Prelude.Internal

cabal-testsuite/static/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module Main where
22

3+
main :: IO ()
34
main = return ()

solver-benchmarks/HackageBenchmark.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# OPTIONS_GHC -fno-warn-orphans #-}
21
{-# LANGUAGE RecordWildCards #-}
32
{-# LANGUAGE TupleSections #-}
43
{-# LANGUAGE ScopedTypeVariables #-}
@@ -19,7 +18,6 @@ import Control.Monad (forM, replicateM, unless, when)
1918
import qualified Data.ByteString as BS
2019
import Data.List (nub, unzip4)
2120
import Data.Maybe (isJust, catMaybes)
22-
import Data.Monoid ((<>))
2321
import Data.String (fromString)
2422
import Data.Function ((&))
2523
import Data.Time (NominalDiffTime, diffUTCTime, getCurrentTime)
@@ -187,7 +185,7 @@ hackageBenchmarkMain = do
187185
then do
188186
putStrLn $ "Obtaining the package list (using " ++ argCabal1 ++ ") ..."
189187
list <- readProcess argCabal1 ["list", "--simple-output"] ""
190-
return $ nub [mkPackageName $ head (words line) | line <- lines list]
188+
return $ nub [mkPackageName n | n : _ <- words <$> lines list]
191189
else do
192190
putStrLn "Using given package list ..."
193191
return argPackages
@@ -345,7 +343,8 @@ isExpectedResult Unknown = False
345343
-- should be the same. If they aren't the same, we returns Unknown.
346344
combineTrialResults :: [CabalResult] -> CabalResult
347345
combineTrialResults rs
348-
| allEqual rs = head rs
346+
| r:_ <- rs
347+
, allEqual rs = r
349348
| allEqual [r | r <- rs, r /= Timeout] = Timeout
350349
| otherwise = Unknown
351350
where

0 commit comments

Comments
 (0)