haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.6k stars 690 forks source link

mainline `cabal-edit` #7337

Open alok opened 3 years ago

alok commented 3 years ago

the idea is to grow cabal to add some subcommands with sensible defaults. i'd be happy to implement if someone points me the right way and there's interest.

emilypi commented 3 years ago

I think this is a wonderful idea, and would dovetail nicely with the cabal gen-bounds work, for which we wanted to add a write-in-place option that required a slightly better parser. If it's already done in this package, I see no reason to not include this. CC @fgaz @mightybyte. I'm happy to help get you started.

fgaz commented 3 years ago

Is cabal-edit this project https://github.com/sdiehl/cabal-edit?

Sounds like an useful addition, but it'd have to overcome the limitations stated in the readme first, otherwise editing would not work on a good chunk of packages. Another point to think about is how projects could affect the commands: eg. maybe add should check for compatibility with the rest of the project first.

cartazio commented 3 years ago

a related idea i had (which maybe already exists?) would be a cabal-explain : eg explain / list what the current named compoents are (eg libraries/test/executables), i dont know if theres actually a way to list those now? @fgaz ?

gbaz commented 3 years ago

Here's the main stuff that needs to be resolved for a proper roundtrip one way or another as I understand it: https://github.com/haskell/cabal/issues/5306

alok commented 3 years ago

@gbaz looks like comment preserving exactprint is the blocker in #5306? where should i look to find that in the codebase?

Mikolaj commented 3 years ago

@alok: exact-print is not done yet, though we'd love to have it and there's a related project: https://github.com/haskell/cabal/projects/9

gbaz commented 3 years ago

cabal edit should subsume this old ticket (--save is sort of like --add here). https://github.com/haskell/cabal/issues/1961