@@ -407,14 +407,8 @@ 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
417
-
410
+ informAboutConfigFiles projectConfig
411
+
418
412
return (projectConfig <> cliConfig, localPackages)
419
413
where
420
414
ProjectConfigShared {projectConfigHcFlavor, projectConfigHcPath, projectConfigHcPkg, projectConfigIgnoreProject, projectConfigConfigFile} =
@@ -460,6 +454,37 @@ rebuildProjectConfig
460
454
projectConfigBuildOnly
461
455
pkgLocations
462
456
457
+ informAboutConfigFiles projectConfig =
458
+ unless (null configFiles) $
459
+ log (verboseStderr verbosity) . render $ message
460
+ where
461
+
462
+ log | allProjectFilesInCWD = info
463
+ | otherwise = notice
464
+ where
465
+ allProjectFilesInCWD = False -- TODO
466
+
467
+ message | length configFilesDoc > 2 = vcat $
468
+ text " Configuration is affected by the following files:" : configFilesDoc
469
+
470
+ | [path1, path2] <- configFilesDoc =
471
+ text " Configuration is affected by the files '" <+> path1 <+> text " ' and '" <+> path2 <+> text " '"
472
+
473
+ | [path] <- configFilesDoc = mempty
474
+
475
+ configFilesDoc =
476
+ map (\ path ->
477
+ text " -" <+> docProjectConfigPath path)
478
+ configFiles
479
+
480
+ configFiles =
481
+ [ path
482
+ | Explicit path
483
+ <- Set. toList
484
+ . (if verbosity >= verbose then id else onlyTopLevelProvenance) $ projectConfigProvenance projectConfig
485
+ ]
486
+
487
+
463
488
configureCompiler
464
489
:: Verbosity
465
490
-> DistDirLayout
0 commit comments