From df30f9def5555858c046946dcff3111b50468086 Mon Sep 17 00:00:00 2001 From: ALeX Kazik Date: Thu, 27 Dec 2018 17:15:09 +0100 Subject: [PATCH] Add pedantic option to ghci (#4463) --- ChangeLog.md | 2 ++ src/Stack/Options/GhciParser.hs | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index d9bd16a3c2..0943509888 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -77,6 +77,8 @@ Other enhancements: [#4095](https://github.com/commercialhaskell/stack/issues/4095) * Add `--tree` to `ls dependencies` to list dependencies as tree. [#4101](https://github.com/commercialhaskell/stack/issues/4101) +* Add `--pedantic` to `ghci` to run with `-Wall` and `-Werror` + [#4463](https://github.com/commercialhaskell/stack/issues/4463) Bug fixes: diff --git a/src/Stack/Options/GhciParser.hs b/src/Stack/Options/GhciParser.hs index e28249ae66..e482b5d320 100644 --- a/src/Stack/Options/GhciParser.hs +++ b/src/Stack/Options/GhciParser.hs @@ -1,4 +1,5 @@ {-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} module Stack.Options.GhciParser where import Options.Applicative @@ -27,12 +28,20 @@ ghciOptsParser = GhciOpts metavar "OPTIONS" <> completer ghcOptsCompleter <> help "Additional options passed to GHCi"))) - <*> many + + <*> ( + (\x y -> x ++ y) + <$> flag + [] + ["-Wall", "-Werror"] + (long "pedantic" <> help "Turn on -Wall and -Werror") + <*> many (textOption (long "ghc-options" <> metavar "OPTIONS" <> completer ghcOptsCompleter <> help "Additional options passed to both GHC and GHCi")) + ) <*> flagsParser <*> optional (strOption (long "with-ghc" <>