-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional version bound checks #10554
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
e090e69
to
b451782
Compare
-- | Is the version range without an upper bound? | ||
withoutUpperBound :: Dependency -> Bool | ||
withoutUpperBound (Dependency _ ver _) = not . hasUpperBound $ ver | ||
|
||
-- | Is the upper bound version range LEQ (less or equal, <=)? | ||
leqUpperBound :: Dependency -> Bool | ||
leqUpperBound (Dependency _ ver _) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered moving this to Distribution.Types.Dependency
?
Not a request, just want to know what your thoughts about it are.
isTrailingZeroUpperBound :: C.PackageCheck -> Bool | ||
isTrailingZeroUpperBound pc = case C.explanation pc of | ||
C.TrailingZeroUpperBounds{} -> True | ||
_ -> False | ||
isLeqUpperBound :: C.PackageCheck -> Bool | ||
isLeqUpperBound pc = case C.explanation pc of | ||
C.LEQUpperBounds{} -> True | ||
_ -> False | ||
isgtLowerBound :: C.PackageCheck -> Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to hav multiple functions instead of one? (isBoundCheck
or similar)
Please avoid trailing zeros for upper bounds. There is more information at https://pvp.haskell.org/ | ||
Warning: [greater-than-lower-bounds] On library, these packages have greater than (>) lower bounds: | ||
- base | ||
Please use greater than or equals (>=) for lower bounds. There is more information at https://pvp.haskell.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message is very good, but does PVP actually explains clearly why we would need such and such bounds? Maybe it is/was/will be in the FVP FAQ?
@@ -1,3 +1,5 @@ | |||
{-# LANGUAGE ViewPatterns #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this needed? How verbose would this PR become without it?
@@ -116,34 +122,58 @@ partitionDeps ads ns ds = do | |||
-- for important dependencies like base). | |||
checkPVP | |||
:: Monad m | |||
=> (String -> PackageCheck) -- Warn message dependend on name | |||
=> (Dependency -> Bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we passing a new function?
And of course, if something is not clear in the checks scaffold, ask! |
Converted to draft as I think there's more work to do:
|
Fixes #9806. Checks that lower bounds are inclusive, upper bounds are exclusive and don't have trailing zeros.
significance: significant
in the changelog file.