Skip to content

Commit

Permalink
Build all local packages with -Werror
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
philderbeast committed Mar 26, 2024
1 parent 0876e18 commit 8453ee0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Test.QuickCheck.Instances.Cabal () where

#if !MIN_VERSION_base(4,18,0)
import Control.Applicative (liftA2)
#endif
import Data.Bits (shiftR)
import Data.Char (isAlphaNum, isDigit, toLower)
import Data.List (intercalate, (\\))
Expand Down
1 change: 0 additions & 1 deletion Cabal-tests/tests/CheckTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Main
) where

import Test.Tasty
import Test.Tasty.ExpectedFailure
import Test.Tasty.Golden.Advanced (goldenTest)

import Data.Algorithm.Diff (PolyDiff (..), getGroupedDiff)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- For the deprecated import of Distribution.Compat.Prelude.Internal
{-# OPTIONS_GHC -Wwarn=deprecations #-}

module UnitTests.Distribution.PackageDescription.Check (tests) where

import Distribution.Compat.Prelude.Internal
Expand Down
1 change: 1 addition & 0 deletions cabal-testsuite/static/Main.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module Main where

main :: IO ()
main = return ()
7 changes: 3 additions & 4 deletions solver-benchmarks/HackageBenchmark.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE ScopedTypeVariables #-}
Expand All @@ -19,7 +18,6 @@ import Control.Monad (forM, replicateM, unless, when)
import qualified Data.ByteString as BS
import Data.List (nub, unzip4)
import Data.Maybe (isJust, catMaybes)
import Data.Monoid ((<>))
import Data.String (fromString)
import Data.Function ((&))
import Data.Time (NominalDiffTime, diffUTCTime, getCurrentTime)
Expand Down Expand Up @@ -187,7 +185,7 @@ hackageBenchmarkMain = do
then do
putStrLn $ "Obtaining the package list (using " ++ argCabal1 ++ ") ..."
list <- readProcess argCabal1 ["list", "--simple-output"] ""
return $ nub [mkPackageName $ head (words line) | line <- lines list]
return $ nub [mkPackageName n | n : _ <- words <$> lines list]
else do
putStrLn "Using given package list ..."
return argPackages
Expand Down Expand Up @@ -345,7 +343,8 @@ isExpectedResult Unknown = False
-- should be the same. If they aren't the same, we returns Unknown.
combineTrialResults :: [CabalResult] -> CabalResult
combineTrialResults rs
| allEqual rs = head rs
| r:_ <- rs
, allEqual rs = r
| allEqual [r | r <- rs, r /= Timeout] = Timeout
| otherwise = Unknown
where
Expand Down

0 comments on commit 8453ee0

Please sign in to comment.