cabal check
: Warn about "bad" bounds
#9806
Labels
cabal-install: cmd/check
newcomer: 4-small-feature
re: user experience
User experience (UX) issue
re: warnings
Concerning warnings printed by cabal
type: enhancement
A few insights into bounds that
cabal check
could teach the users via some new warnings:>= version
, and not exclusive, i.e.> version
. Common blunders could bebase > 4.11
when you actually wantbase >= 4.12
. Note that versions make a dense space, so there are infinitely many versions that are> 4.11
and< 4.12
.< version
, and not inclusive, i.e.<= version
. A blunder I observed in the wild is folks setting e.g.base <= 4.19.1.0
when the last published version ofbase
is4.19.1.0
. This way, one blocks patch releases that should always be fine according to the PVP. The correct minor bound isbase < 4.19.2
.base < 4.20.0.0
could be mistaken to mean thatbase-4.19.*
is the latest versions that should be accepted. But reallybase-4.20
andbase-4.20.0
are not excluded by the bound. The correct bound is< 4.20
.I propose that
cabal check
warn on subexpressions of the version range that are of the form> version
or<= version
. It should further warn on upper bounds with trailing zeros, i.e.<= version.0...0
.The text was updated successfully, but these errors were encountered: