Skip to content

Commit 3acf6d4

Browse files
phadej23Skidoo
authored andcommitted
Warn for cabal-version <2.0
1 parent e72dd85 commit 3acf6d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cabal/Distribution/Types/Version.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ instance Parsec Version where
102102
mkVersion <$> P.sepBy1 digit (P.char '.') <* tags
103103
where
104104
digitParser v
105-
| v >= CabalSpecV1_24 = P.integral
106-
| otherwise = (some d >>= toNumber) P.<?> "non-leading-zero integral"
105+
| v >= CabalSpecV2_0 = P.integral
106+
| otherwise = (some d >>= toNumber) P.<?> "non-leading-zero integral"
107107
where
108108
toNumber :: CabalParsing m => [Int] -> m Int
109109
toNumber [0] = return 0
110110
toNumber xs@(0:_) = do
111-
parsecWarning PWTVersionLeadingZeros "Version digit with leading zero. Use cabal-version: 1.24 or later to write such versions. For more information see https://github.com/haskell/cabal/issues/5092"
111+
parsecWarning PWTVersionLeadingZeros "Version digit with leading zero. Use cabal-version: 2.0 or later to write such versions. For more information see https://github.com/haskell/cabal/issues/5092"
112112
return $ foldl' (\a b -> a * 10 + b) 0 xs
113113
toNumber xs = return $ foldl' (\a b -> a * 10 + b) 0 xs
114114

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
MiniAgda.cabal:0:0: Version digit with leading zero. Use cabal-version: 1.24 or later to write such versions. For more information see https://github.com/haskell/cabal/issues/5092
1+
MiniAgda.cabal:0:0: Version digit with leading zero. Use cabal-version: 2.0 or later to write such versions. For more information see https://github.com/haskell/cabal/issues/5092

0 commit comments

Comments
 (0)