Cabal File Pretty Printer

Daniel Trstenjak daniel.trstenjak at gmail.com
Wed Feb 26 13:15:51 UTC 2014


Hi all,

the current cabal file pretty printer creates output in the form:

   ...
   extra-source-files: README.md tests/inputFiles/original.cabal
                       tests/inputFiles/setup-config tests/goldenFiles/*.cabal
                       tests/outputFiles/.gitignore
    
   library
       build-depends: base >=3 && <5, cmdargs >=0.10.5 && <0.11,
                      lens >=4.0.1 && <4.1, strict >=0.3.2 && <0.4, Cabal >=1.18.0 && <1.19
       exposed-modules: CabalBounds.Args CabalBounds.Main
       ...
       other-modules: Paths_cabal_bounds CabalBounds.Bound
                      CabalBounds.Targets CabalBounds.Dependencies CabalBounds.Drop
                      CabalBounds.Update CabalBounds.Lenses
       ...


Would a patch be accepted that creates output that is more diff friendly?

Something like:

   extra-source-files: README.md 
                       tests/inputFiles/original.cabal
                       tests/inputFiles/setup-config
    
   library
       build-depends: base >=3 && <5,
                      cmdargs >=0.10.5 && <0.11,
                      lens >=4.0.1 && <4.1,
       exposed-modules: CabalBounds.Args
                        CabalBounds.Main
       ...
       other-modules: Paths_cabal_bounds
                      CabalBounds.Bound
                      CabalBounds.Targets
       ...


Or perhaps:

   extra-source-files: 
       README.md 
       tests/inputFiles/original.cabal
       tests/inputFiles/setup-config
    
   library
       build-depends:
           base >=3 && <5,
           cmdargs >=0.10.5 && <0.11,
           lens >=4.0.1 && <4.1,
       exposed-modules:
           CabalBounds.Args
           CabalBounds.Main
       ...
       other-modules:
           Paths_cabal_bounds
           CabalBounds.Bound
           CabalBounds.Targets
       ...


I think that I might prefer the second one.


Greetings,
Daniel


More information about the cabal-devel mailing list