cabal-fmt 0.1.6 → 0.1.7
raw patch · 8 files changed
+92/−16 lines, 8 filesdep ~Cabal-syntaxdep ~basedep ~mtlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Cabal-syntax, base, mtl, optparse-applicative
API changes (from Hackage documentation)
Files
- Changelog.md +4/−0
- cabal-fmt.cabal +10/−9
- fixtures/issue69.cabal +18/−0
- fixtures/issue69.format +18/−0
- fixtures/with-sublibs.cabal +26/−2
- fixtures/with-sublibs.format +9/−0
- src/CabalFmt/Fields/BuildDepends.hs +5/−5
- tests/Golden.hs +2/−0
Changelog.md view
@@ -1,3 +1,7 @@+# 0.1.7++- Use Cabal-syntax-3.10.1.0+ # 0.1.6 - Fix filepath issues on Windows
cabal-fmt.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: cabal-fmt-version: 0.1.6+version: 0.1.7 synopsis: Format .cabal files category: Development description:@@ -18,8 +18,9 @@ || ==8.8.4 || ==8.10.7 || ==9.0.2- || ==9.2.4- || ==9.4.1+ || ==9.2.7+ || ==9.4.5+ || ==9.6.1 extra-source-files: Changelog.md@@ -34,8 +35,8 @@ default-language: Haskell2010 hs-source-dirs: src-interval build-depends:- , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0- , Cabal-syntax ^>=3.8.1.0+ , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0+ , Cabal-syntax ^>=3.10.1.0 exposed-modules: VersionInterval @@ -45,13 +46,13 @@ -- GHC boot libraries build-depends:- , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0+ , base ^>=4.11.1.0 || ^>=4.12.0.0 || ^>=4.13.0.0 || ^>=4.14.0.0 || ^>=4.15.0.0 || ^>=4.16.0.0 || ^>=4.17.0.0 || ^>=4.18.0.0 , bytestring ^>=0.10.8.2 || ^>=0.11.3.1- , Cabal-syntax ^>=3.8.1.0+ , Cabal-syntax ^>=3.10.1.0 , containers ^>=0.5.11.0 || ^>=0.6.0.1 , directory ^>=1.3.1.5 , filepath ^>=1.4.2- , mtl ^>=2.2.2+ , mtl ^>=2.2.2 || ^>=2.3.1 , parsec ^>=3.1.13.0 , pretty ^>=1.1.3.6 @@ -107,7 +108,7 @@ , filepath -- extra dependencies- build-depends: optparse-applicative >=0.14.3.0 && <0.18+ build-depends: optparse-applicative >=0.14.3.0 && <0.19 test-suite golden type: exitcode-stdio-1.0
+ fixtures/issue69.cabal view
@@ -0,0 +1,18 @@+cabal-version: 1.12+name: issue69+version: 0++library+ default-language: Haskell2010+ hs-source-dirs: src+ build-depends:+ base >=4.3 && <4.18+ , bifunctors >=5.5.5 && <5.6+ , tagged >=0.8.6 && <0.9+ , inline-r >1.0.0.0++ exposed-modules:+ Data.Bifunctor.Assoc+ Data.Bifunctor.Swap++ other-extensions: TypeFamilies
+ fixtures/issue69.format view
@@ -0,0 +1,18 @@+cabal-version: 1.12+name: issue69+version: 0++library+ default-language: Haskell2010+ hs-source-dirs: src+ build-depends:+ base >=4.3 && <4.18+ , bifunctors >=5.5.5 && <5.6+ , inline-r >=1.0.0.0.0+ , tagged >=0.8.6 && <0.9++ exposed-modules:+ Data.Bifunctor.Assoc+ Data.Bifunctor.Swap++ other-extensions: TypeFamilies
fixtures/with-sublibs.cabal view
@@ -8,5 +8,29 @@ build-depends: test1, test1:sub,- test2 >=1 && <3,- test2:sub >=2 && <4+ test2 >=1 && <3,+ test2:sub >=2 && <3++ build-depends:+ test1++ build-depends:+ test2 >=1++ build-depends:+ test2:sub++ build-depends:+ test2:{sub}++ build-depends:+ test2:{sub1, sub2}++ build-depends:+ test2:sub >=1 && <3++ build-depends:+ test2:{sub} >=2 && <3++ build-depends:+ test2:{sub1, sub2} >=3 && <4
fixtures/with-sublibs.format view
@@ -9,3 +9,12 @@ build-depends: , test1:{test1, sub} , test2:{test2, sub} >=2 && <3++ build-depends: test1+ build-depends: test2 >=1+ build-depends: test2:sub+ build-depends: test2:sub+ build-depends: test2:{sub1, sub2}+ build-depends: test2:sub >=1 && <3+ build-depends: test2:sub >=2 && <3+ build-depends: test2:{sub1, sub2} >=3 && <4
src/CabalFmt/Fields/BuildDepends.hs view
@@ -50,7 +50,7 @@ pretty :: Options -> [C.Dependency] -> PP.Doc pretty opts deps = case deps of [] -> PP.empty- [dep] -> C.pretty (C.depPkgName dep) PP.<+> prettyVR vr'+ [dep] -> PP.text (prettyDepNoVersion dep) PP.<+> prettyVR vr' where vr' = normaliseVersionRange' (C.depVerRange dep) @@ -65,10 +65,10 @@ $ map (prettyDepNoVersion &&& C.depVerRange) $ C.fromDepMap . C.toDepMap -- this combines duplicate packages $ deps-- prettyDepNoVersion :: C.Dependency -> String- prettyDepNoVersion (C.Dependency pkg _ libs) =- C.prettyShow (C.Dependency pkg C.anyVersion libs)+ where+ prettyDepNoVersion :: C.Dependency -> String+ prettyDepNoVersion (C.Dependency pkg _ libs) =+ C.prettyShow (C.Dependency pkg C.anyVersion libs) prettyExe :: Options -> [C.ExeDependency] -> PP.Doc
tests/Golden.hs view
@@ -30,6 +30,8 @@ , goldenTest' "fragment-wrong-type" , goldenTest' "fragment-multiple" , goldenTest' "fragment-section"++ , goldenTest' "issue69" ] goldenTest' :: String -> TestTree