Commit 132c2089 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺 Committed by Ben Gamari

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
parent bc1e085c
......@@ -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
]
......
......@@ -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]
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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.
{-# OPTIONS_GHC -fno-warn-missing-monadfail-instance #-}
{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-}
{-# LANGUAGE RebindableSyntax, NPlusKPatterns #-}
module RebindableCase1 where
......
......@@ -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 =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment