Skip to content

Commit

Permalink
Satisfy fourmolu
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Nov 18, 2024
1 parent 56622c1 commit b451782
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
16 changes: 8 additions & 8 deletions Cabal/src/Distribution/PackageDescription/Check/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,24 @@ withoutUpperBound (Dependency _ ver _) = not . hasUpperBound $ ver
-- | Is the upper bound version range LEQ (less or equal, <=)?
leqUpperBound :: Dependency -> Bool
leqUpperBound (Dependency _ ver _)
| OrEarlierVersionF _ <- projectVersionRange ver = True
| otherwise = False
| OrEarlierVersionF _ <- projectVersionRange ver = True
| otherwise = False

-- | Does the upper bound version range have a trailing zero?
trailingZeroUpperBound :: Dependency -> Bool
trailingZeroUpperBound (Dependency _ ver _)
| OrEarlierVersionF v <- projectVersionRange ver = trailingZero v
| EarlierVersionF v <- projectVersionRange ver = trailingZero v
| otherwise = False
| OrEarlierVersionF v <- projectVersionRange ver = trailingZero v
| EarlierVersionF v <- projectVersionRange ver = trailingZero v
| otherwise = False
where
trailingZero :: Version -> Bool
trailingZero (versionNumbers -> vs)
| [0] <- vs = False
| 0:_ <- reverse vs = True
| 0 : _ <- reverse vs = True
| otherwise = False

-- | Is the lower bound version range GT (greater than, >)?
gtLowerBound :: Dependency -> Bool
gtLowerBound (Dependency _ ver _)
| LaterVersionF _ <- projectVersionRange ver = True
| otherwise = False
| LaterVersionF _ <- projectVersionRange ver = True
| otherwise = False
17 changes: 9 additions & 8 deletions cabal-install/tests/UnitTests/Distribution/Solver/Modular/DSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,15 @@ exAvSrcPkg ex =
-- they are not related to this test suite, and are tested
-- with golden tests.
let checks = C.checkPackage (srcpkgDescription package)
in
filter (\x ->
not (isgtLowerBound x)
&& not (isLeqUpperBound x)
&& not (isTrailingZeroUpperBound x)
&& not (isMissingUpperBound x)
&& not (isUnknownLangExt x))
checks
in filter
( \x ->
not (isgtLowerBound x)
&& not (isLeqUpperBound x)
&& not (isTrailingZeroUpperBound x)
&& not (isMissingUpperBound x)
&& not (isUnknownLangExt x)
)
checks
in if null pkgCheckErrors
then package
else
Expand Down

0 comments on commit b451782

Please sign in to comment.