Skip to content

Commit 2d5f877

Browse files
committed
Adopt coding style and edit comments
1 parent 718c831 commit 2d5f877

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

Cabal/Distribution/Simple/Setup.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2218,7 +2218,7 @@ optionNumJobs get set =
22182218

22192219

22202220
-- ------------------------------------------------------------
2221-
-- * ghc-mod support flags
2221+
-- * show-build-info command flags
22222222
-- ------------------------------------------------------------
22232223

22242224
showBuildInfoCommand :: ProgramDb -> CommandUI BuildFlags

cabal-install/Distribution/Client/CmdShowBuildInfo.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- | cabal-install CLI command: build
22
--
33
module Distribution.Client.CmdShowBuildInfo (
4-
-- * The @build@ CLI and action
4+
-- * The @show-build-info@ CLI and action
55
showBuildInfoCommand,
66
showBuildInfoAction
77
) where
@@ -74,7 +74,7 @@ showBuildInfoCommand = Client.installCommand {
7474
}
7575

7676

77-
-- | The @build@ command does a lot. It brings the install plan up to date,
77+
-- | The @show-build-info@ command does a lot. It brings the install plan up to date,
7878
-- selects that part of the plan needed by the given or implicit targets and
7979
-- then executes the plan.
8080
--
@@ -219,7 +219,7 @@ selectPackageTargets targetSelector targets
219219
-- | For a 'TargetComponent' 'TargetSelector', check if the component can be
220220
-- selected.
221221
--
222-
-- For the @build@ command we just need the basic checks on being buildable etc.
222+
-- For the @show-build-info@ command we just need the basic checks on being buildable etc.
223223
--
224224
selectComponentTarget :: SubComponentTarget
225225
-> AvailableTarget k -> Either TargetProblem k
@@ -229,7 +229,7 @@ selectComponentTarget subtarget =
229229

230230

231231
-- | The various error conditions that can occur when matching a
232-
-- 'TargetSelector' against 'AvailableTarget's for the @build@ command.
232+
-- 'TargetSelector' against 'AvailableTarget's for the @show-build-info@ command.
233233
--
234234
data TargetProblem =
235235
TargetProblemCommon TargetProblemCommon

cabal-install/Distribution/Client/Setup.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ module Distribution.Client.Setup
5555
, doctestCommand
5656
, copyCommand
5757
, registerCommand
58-
59-
--ghc-mod support commands
6058
, showBuildInfoCommand
6159
, writeAutogenFilesCommand, WriteAutogenFilesFlags(..)
6260
, parsePackageArgs
@@ -2960,7 +2958,7 @@ relevantConfigValuesText vs =
29602958

29612959

29622960
-- ------------------------------------------------------------
2963-
-- * Commands to support ghc-mod
2961+
-- * Commands to support show-build-info
29642962
-- ------------------------------------------------------------
29652963

29662964
showBuildInfoCommand :: CommandUI (BuildFlags, BuildExFlags)

cabal-install/main/Main.hs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ mainWorker args = do
305305
, hiddenCmd win32SelfUpgradeCommand win32SelfUpgradeAction
306306
, hiddenCmd actAsSetupCommand actAsSetupAction
307307
, hiddenCmd manpageCommand (manpageAction commandSpecs)
308-
-- ghc-mod supporting commands
309308
, hiddenCmd CmdShowBuildInfo.showBuildInfoCommand
310309
CmdShowBuildInfo.showBuildInfoAction
311310
, hiddenCmd CmdWriteAutogenFiles.writeAutogenFilesCommand
@@ -480,30 +479,21 @@ buildActionForCommand commandUI verbosity (buildFlags, buildExFlags) extraArgs g
480479
distPref <- findSavedDistPref config (buildDistPref buildFlags)
481480
-- Calls 'configureAction' to do the real work, so nothing special has to be
482481
-- done to support sandboxes.
483-
config' <- reconfigure configureAction
484-
verbosity
485-
distPref
486-
useSandbox
487-
noAddSource
488-
(buildNumJobs buildFlags)
489-
mempty
490-
[]
491-
globalFlags
492-
config
482+
config' <- reconfigure
483+
configureAction verbosity distPref useSandbox noAddSource
484+
(buildNumJobs buildFlags) mempty [] globalFlags config
485+
493486
nixShell verbosity distPref globalFlags config $ do
494-
maybeWithSandboxDirOnSearchPath useSandbox $ buildForCommand commandUI
495-
verbosity
496-
config'
497-
distPref
498-
buildFlags
499-
extraArgs
487+
maybeWithSandboxDirOnSearchPath useSandbox $ buildForCommand
488+
commandUI verbosity config' distPref buildFlags extraArgs
500489

501490
-- | Actually do the work of building the package. This is separate from
502491
-- 'buildAction' so that 'testAction' and 'benchmarkAction' do not invoke
503492
-- 'reconfigure' twice.
504493
build :: Verbosity -> SavedConfig -> FilePath -> BuildFlags -> [String] -> IO ()
505494
build = buildForCommand (Cabal.buildCommand defaultProgramDb)
506495

496+
-- | Helper function
507497
buildForCommand :: CommandUI BuildFlags
508498
-> Verbosity
509499
-> SavedConfig
@@ -1293,7 +1283,7 @@ manpageAction commands flagVerbosity extraArgs _ = do
12931283
else pname
12941284
putStrLn $ manpage cabalCmd commands
12951285

1296-
--Further commands to support ghc-mod usage
1286+
--Further commands to support show-build-info usage
12971287
writeAutogenFilesAction :: WriteAutogenFilesFlags -> [String] -> Action
12981288
writeAutogenFilesAction flags _ globalFlags = do
12991289
let verbosity = fromFlag (wafVerbosity flags)

0 commit comments

Comments
 (0)