Skip to content

Commit ed3579a

Browse files
committed
Satisfy build and lint
1 parent 6c19b98 commit ed3579a

File tree

10 files changed

+17
-20
lines changed

10 files changed

+17
-20
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module UnitTests.Distribution.PackageDescription.Check (tests) where
22

3-
import Distribution.Compat.Prelude.Internal
3+
import Distribution.Compat.Prelude
44
import Prelude ()
55

66
import Distribution.PackageDescription.Check

Cabal/src/Distribution/Simple/Configure.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,9 @@ computeLocalBuildConfig cfg comp programDb = do
696696

697697
data PackageInfo = PackageInfo
698698
{ internalPackageSet :: Set LibraryName
699-
, promisedDepsSet :: Map (PackageName, ComponentName) ComponentId
699+
, promisedDepsSet :: Map (PackageName, ComponentName, Maybe PrivateAlias) ComponentId
700700
, installedPackageSet :: InstalledPackageIndex
701-
, requiredDepsMap :: Map (PackageName, ComponentName) InstalledPackageInfo
701+
, requiredDepsMap :: Map (PackageName, ComponentName, Maybe PrivateAlias) InstalledPackageInfo
702702
}
703703

704704
configurePackage

Cabal/src/Distribution/Types/LocalBuildInfo.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pattern LocalBuildInfo
151151
-> Maybe FilePath
152152
-> Graph ComponentLocalBuildInfo
153153
-> Map ComponentName [ComponentLocalBuildInfo]
154-
-> Map (PackageName, ComponentName) ComponentId
154+
-> Map (PackageName, ComponentName, Maybe PrivateAlias) ComponentId
155155
-> InstalledPackageIndex
156156
-> PackageDescription
157157
-> ProgramDb

cabal-install-solver/src/Distribution/Solver/Modular/IndexConversion.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,6 @@ convLibDepsAs :: DependencyReason PN -> PrivateDependency -> [LDep PN]
561561
convLibDepsAs dr (PrivateDependency alias deps) =
562562
[ LDep dr $ Dep (PkgComponent pn (ExposedLib lib)) (Private alias) (Constrained vr)
563563
| Dependency pn vr libs <- deps, lib <- NonEmptySet.toList libs ]
564-
where
565-
566564

567565
-- | Convert a Cabal dependency on an executable (build-tools) to a solver-specific dependency.
568566
convExeDep :: DependencyReason PN -> ExeDependency -> LDep PN

cabal-install/src/Distribution/Client/ProjectPlanning/SetupPolicy.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ instance IsNode NonSetupLibDepSolverPlanPackage where
176176
nodeKey spkg
177177

178178
nodeNeighbors (NonSetupLibDepSolverPlanPackage spkg) =
179-
ordNub $ (map fst $ CD.nonSetupDeps (resolverPackageLibDeps spkg))
179+
ordNub $ map fst (CD.nonSetupDeps (resolverPackageLibDeps spkg))
180180

181181
-- | Work out which version of the Cabal we will be using to talk to the
182182
-- Setup.hs interface for this package.

cabal-install/tests/UnitTests/Distribution/Client/ScriptUtils.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ testScriptPath (ShortPath p) = withMaxSuccess 10000 $ ioProperty $ do
2929
hashed_path <- getScriptCacheDirectory p
3030
script_build_dir <- defaultScriptBuildsDir
3131
return $
32-
and
33-
-- 1. Is it a valid path at all
34-
[ isValid hashed_path
35-
, -- 2. Is the computed hashed path in the expected directory?
36-
(script_build_dir </> takeFileName hashed_path) `equalFilePath` hashed_path
37-
]
32+
-- 1. Is it a valid path at all
33+
isValid hashed_path
34+
&&
35+
-- 2. Is the computed hashed path in the expected directory?
36+
(script_build_dir </> takeFileName hashed_path) `equalFilePath` hashed_path

cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ import Distribution.Solver.Types.Settings
9797
import Distribution.Solver.Types.SolverPackage
9898
import Distribution.Solver.Types.SourcePackage
9999
import Distribution.Solver.Types.Variable
100-
import Distribution.Types.Dependency (PrivateAlias)
101100

102101
{-------------------------------------------------------------------------------
103102
Example package database DSL
@@ -680,6 +679,7 @@ exAvSrcPkg ex =
680679

681680
mkDirectD :: (ExamplePkgName, C.LibraryName, C.VersionRange, Maybe ExamplePrivateAlias) -> C.PrivateDependency
682681
mkDirectD (dep, name, vr, Just alias) = C.PrivateDependency (C.PrivateAlias (fromString alias)) [C.Dependency (C.mkPackageName dep) vr (NonEmptySet.singleton name)]
682+
mkDirectD (_, _, _, Nothing) = error "mkDirectD: private deps are never Nothing since we partition them by 'isJust' above"
683683

684684
mkFlagged
685685
:: (C.LibraryVisibility -> C.BuildInfo -> a)

cabal-testsuite/PackageTests/PrivateDeps/cabal-hooks-demo/hooks-exe/app/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ main = do
2525
"show" -> do
2626
s <- getContents
2727
let a1 :: A = decode s
28-
res <- return $ show a1
28+
res = show a1
2929
putStr (encode res)
3030
"inc" -> do
3131
s <- getContents
3232
let a1 :: A = decode s
33-
res <- return $ inc a1
33+
res = inc a1
3434
putStr (encode res)
3535
_ -> error "Hook not yet implemented"

cabal-testsuite/PackageTests/PrivateDeps/cabal-hooks-demo/hooks-lib/src/HooksLib.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ revertA2 L2.B = L.B
6868

6969
hooks_show :: L.A -> HooksM String
7070
hooks_show a = do
71-
ver <- hooksVersion <$> ask
71+
ver <- asks hooksVersion
7272
case ver of
7373
V01 -> readHooksExe "show" (convertA1 a)
7474
V02 -> readHooksExe "show" (convertA2 a)
7575

7676
hooks_inc :: L.A -> HooksM L.A
7777
hooks_inc a = do
78-
ver <- hooksVersion <$> ask
78+
ver <- asks hooksVersion
7979
case ver of
8080
V01 -> revertA1 <$> (readHooksExe "inc" (convertA1 a))
8181
V02 -> revertA2 <$> (readHooksExe "inc" (convertA2 a))
@@ -88,7 +88,7 @@ hooks_inc a = do
8888

8989
readHooksExe :: (Binary a, Binary b) => String -> a -> HooksM b
9090
readHooksExe hook args = do
91-
exe <- hooksExe <$> ask
91+
exe <- asks hooksExe
9292
liftIO $ readHooksExe_ exe hook args
9393

9494
withForkWait :: IO () -> (IO () -> IO a) -> IO a

cabal-testsuite/src/Test/Cabal/Prelude.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ findDependencyInStore :: String -- ^package name prefix
11741174
findDependencyInStore pkgName = do
11751175
storeDir <- testStoreDir <$> getTestEnv
11761176
liftIO $ do
1177-
storeDirForGhcVersion <- head <$> listDirectory storeDir
1177+
(storeDirForGhcVersion:_) <- listDirectory storeDir
11781178
packageDirs <- listDirectory (storeDir </> storeDirForGhcVersion)
11791179
-- Ideally, we should call 'hashedInstalledPackageId' from 'Distribution.Client.PackageHash'.
11801180
-- But 'PackageHashInputs', especially 'PackageHashConfigInputs', is too hard to construct.

0 commit comments

Comments
 (0)