[commit: ghc] master: Rename -Wmissing-monadfail-instance to plural-form (132c208)

git at git.haskell.org git at git.haskell.org
Mon Jan 25 15:03:52 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/132c20894d102558cc8f3aee5bc289425d0ddb24/ghc

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

commit 132c20894d102558cc8f3aee5bc289425d0ddb24
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Mon Jan 25 14:51:50 2016 +0100

    Rename -Wmissing-monadfail-instance to plural-form
    
    This warning flag was recently introduced as part of #10751. However,
    it was missed during code-review that almost all existing warning
    flags use a plural-form, so for consistency this commit renames
    that warning flag to `-Wmissing-monadfail-instances`.
    
    Test Plan: local validate (still running)
    
    Reviewers: quchen, goldfire, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1842
    
    GHC Trac Issues: #10751


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

132c20894d102558cc8f3aee5bc289425d0ddb24
 compiler/main/DynFlags.hs                                           | 6 +++---
 compiler/typecheck/TcMatches.hs                                     | 4 ++--
 docs/users_guide/using-warnings.rst                                 | 6 +++---
 testsuite/tests/monadfail/MonadFailWarnings.hs                      | 2 +-
 testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs  | 2 +-
 .../tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr    | 2 +-
 testsuite/tests/rebindable/rebindable1.hs                           | 2 +-
 utils/mkUserGuidePart/Options/Warnings.hs                           | 4 ++--
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 5189e23..0a7b6d2 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -566,7 +566,7 @@ data WarningFlag =
    | Opt_WarnWarningsDeprecations
    | Opt_WarnDeprecatedFlags
    | Opt_WarnAMP -- Introduced in GHC 7.8, obsolete since 7.10
-   | Opt_WarnMissingMonadFailInstance -- since 8.0
+   | Opt_WarnMissingMonadFailInstances -- since 8.0
    | Opt_WarnSemigroup -- since 8.0
    | Opt_WarnDodgyExports
    | Opt_WarnDodgyImports
@@ -2926,7 +2926,7 @@ wWarningFlags = [
   flagSpec "missing-import-lists"        Opt_WarnMissingImportList,
   flagSpec "missing-local-sigs"          Opt_WarnMissingLocalSigs,
   flagSpec "missing-methods"             Opt_WarnMissingMethods,
-  flagSpec "missing-monadfail-instance"  Opt_WarnMissingMonadFailInstance,
+  flagSpec "missing-monadfail-instances" Opt_WarnMissingMonadFailInstances,
   flagSpec "semigroup"                   Opt_WarnSemigroup,
   flagSpec "missing-signatures"          Opt_WarnMissingSigs,
   flagSpec "missing-exported-sigs"       Opt_WarnMissingExportedSigs,
@@ -3526,7 +3526,7 @@ minusWallOpts
 -- code future compatible to fix issues before they even generate warnings.
 minusWcompatOpts :: [WarningFlag]
 minusWcompatOpts
-    = [ Opt_WarnMissingMonadFailInstance
+    = [ Opt_WarnMissingMonadFailInstances
       , Opt_WarnSemigroup
       , Opt_WarnNonCanonicalMonoidInstances
       ]
diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs
index 216f25b..f4d2e12 100644
--- a/compiler/typecheck/TcMatches.hs
+++ b/compiler/typecheck/TcMatches.hs
@@ -926,7 +926,7 @@ tcMonadFailOp orig pat fail_op res_ty
   = do { -- Issue MonadFail warnings
          rebindableSyntax <- xoptM LangExt.RebindableSyntax
        ; desugarFlag      <- xoptM LangExt.MonadFailDesugaring
-       ; missingWarning   <- woptM Opt_WarnMissingMonadFailInstance
+       ; missingWarning   <- woptM Opt_WarnMissingMonadFailInstances
        ; if | rebindableSyntax && (desugarFlag || missingWarning)
               -> warnRebindableClash pat
             | not desugarFlag && missingWarning
@@ -956,7 +956,7 @@ warnRebindableClash pattern = addWarnAt (getLoc pattern)
      nest 2 (text "is used together with -XRebindableSyntax."
              <+> text "If this is intentional,"
              $$
-             text "compile with -fno-warn-missing-monadfail-instance."))
+             text "compile with -Wno-missing-monadfail-instances."))
 
 {-
 Note [typechecking ApplicativeStmt]
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index fb9c913..de8be63 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -78,7 +78,7 @@ The following flags are simple ways to select standard "packages" of warnings:
     .. hlist::
         :columns: 3
 
-        * :ghc-flag:`-Wmissing-monadfail-instance`
+        * :ghc-flag:`-Wmissing-monadfail-instances`
         * :ghc-flag:`-Wsemigroup`
         * :ghc-flag:`-Wnoncanonical-monoid-instances`
 
@@ -242,7 +242,7 @@ of ``-W(no-)*``.
      * Warn if ``fail`` is defined backwards
        (i.e. ``fail = Control.Monad.fail``).
 
-    See also :ghc-flag:`-Wmissing-monadfail-instance`.
+    See also :ghc-flag:`-Wmissing-monadfail-instances`.
 
     This option is off by default.
 
@@ -266,7 +266,7 @@ of ``-W(no-)*``.
     This warning is off by default. However, it is part of the
     :ghc-flag:`-Wcompat` option group.
 
-.. ghc-flag:: -Wmissing-monadfail-instance
+.. ghc-flag:: -Wmissing-monadfail-instances
 
     .. index::
        single: MFP
diff --git a/testsuite/tests/monadfail/MonadFailWarnings.hs b/testsuite/tests/monadfail/MonadFailWarnings.hs
index 3b786cc..a1d3729 100644
--- a/testsuite/tests/monadfail/MonadFailWarnings.hs
+++ b/testsuite/tests/monadfail/MonadFailWarnings.hs
@@ -2,7 +2,7 @@
 -- Ensure that MonadFail warnings are issued correctly if the warning flag
 -- is enabled
 
-{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-}
+{-# OPTIONS_GHC -Wmissing-monadfail-instances #-}
 
 module MonadFailWarnings where
 
diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs
index c9f2502..6126e24 100644
--- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs
+++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs
@@ -2,7 +2,7 @@
 -- RebindableSyntax does not play that well with MonadFail, so here we ensure
 -- that when both settings are enabled we get the proper warning.
 
-{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-}
+{-# OPTIONS_GHC -Wmissing-monadfail-instances #-}
 {-# LANGUAGE RebindableSyntax #-}
 
 module MonadFailWarningsWithRebindableSyntax where
diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr
index 819c878..9610f89 100644
--- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr
+++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr
@@ -2,4 +2,4 @@
 MonadFailWarningsWithRebindableSyntax.hs:13:5: warning:
     The failable pattern ‘Just x’
       is used together with -XRebindableSyntax. If this is intentional,
-      compile with -fno-warn-missing-monadfail-instance.
+      compile with -Wno-missing-monadfail-instances.
diff --git a/testsuite/tests/rebindable/rebindable1.hs b/testsuite/tests/rebindable/rebindable1.hs
index 7bf3e23..4ff8ed2 100644
--- a/testsuite/tests/rebindable/rebindable1.hs
+++ b/testsuite/tests/rebindable/rebindable1.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fno-warn-missing-monadfail-instance #-}
+{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-}
 {-# LANGUAGE RebindableSyntax, NPlusKPatterns #-}
 
 module RebindableCase1 where
diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs
index 0c5260f..3c69de7 100644
--- a/utils/mkUserGuidePart/Options/Warnings.hs
+++ b/utils/mkUserGuidePart/Options/Warnings.hs
@@ -152,12 +152,12 @@ warningsOptions =
          , flagType = DynamicFlag
          , flagReverse = "-Wno-missing-local-sigs"
          }
-  , flag { flagName = "-Wmissing-monadfail-instance"
+  , flag { flagName = "-Wmissing-monadfail-instances"
          , flagDescription =
            "warn when a failable pattern is used in a do-block that does " ++
            "not have a ``MonadFail`` instance."
          , flagType = DynamicFlag
-         , flagReverse = "-Wno-missing-monadfail-instance"
+         , flagReverse = "-Wno-missing-monadfail-instances"
          }
   , flag { flagName = "-Wsemigroup"
          , flagDescription =



More information about the ghc-commits mailing list