Repository navigation
Cabal Init Omnibus - #7344
Cabal Init Omnibus#7344
Conversation
|
Why bundle coverage changes and cabal init changes? Are they related? I don't see how. |
|
I don't like how this contains at least three separate changes in one PR. I hope this is just a draft. |
|
@phadej it's clearly marked a draft. I'll split it out into several PRs if that makes you less uneasy.
Because i can't test the init script reasonably well if i can't generate coverage. It turns out that in order to make any effective change towards fixing things for |
|
At the commit level, ideally the smallest chunks that make sense (and build) on their own. At the pr level, strongly related changes can be on the same pr. Or not. So something like this, following OP:
|
|
@fgaz i agree with that timeline. The HPC + coverage stuff is covered by Ocharles' PR that just went in, and the init stuff can't be split (or at least, shouldn't) |
* Restructures the `cabal init` command to fix historical
issues. All flags are preserved.
* Codebases for interactive and non-interactive flags
are disentangled.
* Data structures now exploit relevant stanza structure
and formatters only care about stanza data
* Heuristics and prompts have a pure and impure implementation.
* Sets default behavior to be `--interactive` as opposed to
`--non-interactive`.
* Rewrites tests to achieve 98% coverage
* Golden files now test every stanza individually
* Every flag is covered by a unit test
* Interactive, simple, and non-interactive workflows are
covered.
17e31e9 to
1068755
Compare
972ceb3 to
5892f42
Compare
| -> InitFlags | ||
| -> m ProjectSettings | ||
| createProject v pkgIx srcDb initFlags = do | ||
| createProject v _comp pkgIx srcDb initFlags = do |
There was a problem hiding this comment.
@ptkato This is unused in a bunch of cases (interactive + simple, including thier tests). I'd just configure NonInteractive.createProject to take the compiler arg first and then return NonInteractive.createProject comp as the function returned in the where clause. Otherwise it just introduces cruft into more places than we want.
582d4c3 to
0d20866
Compare
Mikolaj
left a comment
There was a problem hiding this comment.
Awesome mega-PR. I can't do it justice, not taking part in the epic struggle from the beginning, but I'm duly impressed by its breadth and the law and order it imposes. I would feel uncomfortable with such a large PR, but I understand it provides an excellent test coverage for what it changes. Great job.
|
🎉 |
Please include the following checklist in your PR:
New additions
This PR does the following:
cabal initcommand to have a saner structure that can be tested easily.This comes with bugfixes:
cabal init --libandexeshould add thelibraryto thebuild-dependsof theexecutable#7256cabal init --libputs build-tools(happy, alex) generated modules twice into exposed-modules #7251extra-source-files: CHANGELOG.md#6864