@@ -407,13 +407,7 @@ rebuildProjectConfig
407
407
localPackages <- phaseReadLocalPackages compiler (projectConfig <> cliConfig)
408
408
return (projectConfig, localPackages)
409
409
410
- let configfiles =
411
- [ text " -" <+> docProjectConfigPath path
412
- | Explicit path <- Set. toList . (if verbosity >= verbose then id else onlyTopLevelProvenance) $ projectConfigProvenance projectConfig
413
- ]
414
- unless (null configfiles) $
415
- notice (verboseStderr verbosity) . render . vcat $
416
- text " Configuration is affected by the following files:" : configfiles
410
+ informAboutConfigFiles projectConfig
417
411
418
412
return (projectConfig <> cliConfig, localPackages)
419
413
where
@@ -460,6 +454,40 @@ rebuildProjectConfig
460
454
projectConfigBuildOnly
461
455
pkgLocations
462
456
457
+ informAboutConfigFiles projectConfig =
458
+ unless (null configFiles) .
459
+ out (verboseStderr verbosity) . render $
460
+ message
461
+ where
462
+ -- output mode is either 'notice' or 'info' depending on how trivial the information
463
+ out
464
+ | allProjectFilesInCWD = info
465
+ | otherwise = notice
466
+ where
467
+ allProjectFilesInCWD = False -- TODO
468
+ message = case configFilesDoc of -- formatting depends on |config files| (the number of config files)
469
+ (_ : _ : _ : _) ->
470
+ -- \|config files| > 2 => vertical list
471
+ text " Configuration is affected by the following files:" <+> configFilesVertList
472
+ [path1, path2] ->
473
+ text " Configuration is affected by '" <+> path1 <+> text " ' and '" <+> path2 <+> text " '"
474
+ [path] ->
475
+ text
476
+ " Configuration is affected by '"
477
+ <+> path
478
+ <+> text " '"
479
+ where
480
+ configFilesDoc = map docProjectConfigPath configFiles
481
+ configFilesVertList = docProjectConfigFiles configFiles
482
+
483
+ configFiles =
484
+ [ path
485
+ | Explicit path <-
486
+ Set. toList
487
+ . (if verbosity >= verbose then id else onlyTopLevelProvenance)
488
+ $ projectConfigProvenance projectConfig
489
+ ]
490
+
463
491
configureCompiler
464
492
:: Verbosity
465
493
-> DistDirLayout
0 commit comments