[commit: ghc] master: Improve missing-home-modules warning formatting (6a7e159)

git at git.haskell.org git at git.haskell.org
Fri Mar 2 21:54:04 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6a7e159ce25b432824f8757e0c768f2b2e2754df/ghc

>---------------------------------------------------------------

commit 6a7e159ce25b432824f8757e0c768f2b2e2754df
Author: Matthew Pickering <matthewtpickering at gmail.com>
Date:   Fri Mar 2 16:12:22 2018 -0500

    Improve missing-home-modules warning formatting
    
    Previously the modules were smashed together at the end of the line. As
    the header is quite long, this meant for quite long lines which wrapped
    on smaller terminals.
    
    err msg: A
             B
    
    Now they are nested underneath the long first line of the error message.
    
    err msg:
      A
      B
    
    Reviewers: bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4454


>---------------------------------------------------------------

6a7e159ce25b432824f8757e0c768f2b2e2754df
 compiler/main/GhcMake.hs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs
index 73a7157..d399d03 100644
--- a/compiler/main/GhcMake.hs
+++ b/compiler/main/GhcMake.hs
@@ -201,11 +201,16 @@ warnMissingHomeModules hsc_env mod_graph =
 
     msg
       | gopt Opt_BuildingCabalPackage dflags
-      = text "These modules are needed for compilation but not listed in your .cabal file's other-modules: "
-        <> sep (map ppr missing)
+      = hang
+          (text "These modules are needed for compilation but not listed in your .cabal file's other-modules: ")
+          4
+          (sep (map ppr missing))
       | otherwise
-      = text "Modules are not listed in command line but needed for compilation: "
-        <> sep (map ppr missing)
+      =
+        hang
+          (text "Modules are not listed in command line but needed for compilation: ")
+          4
+          (sep (map ppr missing))
     warn = makeIntoWarning
       (Reason Opt_WarnMissingHomeModules)
       (mkPlainErrMsg dflags noSrcSpan msg)



More information about the ghc-commits mailing list