Default package name and all targets for REPL#11452
Default package name and all targets for REPL#11452philderbeast wants to merge 8 commits intohaskell:masterfrom
Conversation
|
Relevant unresolved review comment from #10684.
|
03507f5 to
ca9dc9b
Compare
5667d09 to
047b4e3
Compare
| -- ^ Global flags. | ||
| -> CurrentCommand | ||
| -- ^ Current Command (usually for error reporting). | ||
| -> (TargetContext -> ProjectBaseContext -> [TargetSelector] -> IO b) |
There was a problem hiding this comment.
If we can flip the argument order here in withContextAndSelectors, a refactor, then I'd like to change TargetsAction too dropping its ProjectBaseContext argument.
diff --git a/cabal-install/src/Distribution/Client/ScriptUtils.hs b/cabal-install/src/Distribution/Client/ScriptUtils.hs
index 1c78d537c..08921b1e3 100644
--- a/cabal-install/src/Distribution/Client/ScriptUtils.hs
+++ b/cabal-install/src/Distribution/Client/ScriptUtils.hs
@@ -289,7 +289,7 @@ withContextAndSelectors
-- ^ Global flags.
-> CurrentCommand
-- ^ Current Command (usually for error reporting).
- -> (TargetContext -> ProjectBaseContext -> [TargetSelector] -> IO b)
+ -> (ProjectBaseContext -> TargetContext -> [TargetSelector] -> IO b)
-- ^ The body of your command action.
-> IO b
withContextAndSelectors verbosity noTargets kind flags@NixStyleFlags{..} targetStrings globalFlags cmd act =There was a problem hiding this comment.
Perhaps that should be a subsequent PR?
| ctx | ||
| ((baseCtx, multiReplEnabled), targetSelectors) = do |
There was a problem hiding this comment.
It looks to me like ctx and baseCtx are the same.
@mpickering, can these be constructed as |
| -- ^ Global flags. | ||
| -> CurrentCommand | ||
| -- ^ Current Command (usually for error reporting). | ||
| -> (TargetContext -> ProjectBaseContext -> [TargetSelector] -> IO b) |
There was a problem hiding this comment.
Perhaps that should be a subsequent PR?
047b4e3 to
c472188
Compare
- Show packages when no --project-file is given - Handle the case with no packages in the project - Add a changelog - Add tests - Satisfy hlint - Satisfy fourmolu - Don't need a target when there is one package - Adjust target strings for sole package - Add alt.project tests for ReplOptions - Silence the 1st withCtx call's verbosity - Don't repeat configuration is affected by - Satisfy whitespace - Fixups after rebase - Remove punct variable - Review comment changes - Comma with but joining indep' clauses - Use single package - Update tests, adding more assertions - Improve test descriptions - Mention [package:][ctype:]component - Don't repeat [package:][ctype:]component - Lift validatedTargets, rename r as replFlags - Don't use -XRecordWildCards for configFlags - Add a one.project one pkg test - Remove target string manipulation - Make reportProjectNoTarget a function - Redo ReplProjectTarget tests - Redo ReplProjectNoneTarget tests - Satisfy fix-whitespace - Error whether or not project has packages - Guard against triggering an assertion if targets are null - Skip if Windows - Repl commands mentioning the fake-package - Don't yet automatically pick only choice - Autopick the one package - Split ReplProjectTarget test - Add tests for repl all target - Default target to all with multireplh - Add a retargetting message - Add test for default "all" target when multirepl - Add type synonym TargetPick - Add targetedRepl - RejectNoTargets if target strings not null - Guard against infinite retargeting & null pkgs - Redo the changelog. - Remove TargetPick type synonym Co-Authored-By: brandon s allbery kf8nh <allbery.b@gmail.com>
- Update expected fake-package-0 message
- Move only deps check - Add type synonym, Repl t a
c472188 to
7226592
Compare
Fixes #11451. A follow on from #10684 that I closed because its changelog entry was already committed with #11237. This is the behaviour change of #10684 that was not included with #11237.
Uses existing tests. Some of these no longer fail if no target is supplied.
significance: significantin the changelog file.