diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-02-07 10:15:57 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2020-02-07 10:17:24 +0100 |
commit | 6cd77d4c638012be63d66882403804aa28feb6ed (patch) | |
tree | ea1841989db394ae931780fbbca3305fe0f021c8 /src/Text/Pandoc/App | |
parent | 60a3158bf9b6f4d16bb5fc6cac61b5c305ad40e3 (diff) | |
download | pandoc-6cd77d4c638012be63d66882403804aa28feb6ed.tar.gz |
Resolve HLint warnings
All warnings are either fixed or, if more appropriate, HLint is
configured to ignore them. HLint suggestions remain.
* Ignore "Use camelCase" warnings in Lua and legacy code
* Fix or ignore remaining HLint warnings
* Remove redundant brackets
* Remove redundant `return`s
* Remove redundant as-pattern
* Fuse mapM_/map
* Use `.` to shorten code
* Remove redundant `fmap`
* Remove unused LANGUAGE pragmas
* Hoist `not` in Text.Pandoc.App
* Use fewer imports for `Text.DocTemplates`
* Remove redundant `do`s
* Remove redundant `$`s
* Jira reader: remove unnecessary parentheses
Diffstat (limited to 'src/Text/Pandoc/App')
-rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs index e407d8854..18d15843e 100644 --- a/src/Text/Pandoc/App/CommandLineOptions.hs +++ b/src/Text/Pandoc/App/CommandLineOptions.hs @@ -37,6 +37,7 @@ import Data.List (isPrefixOf) #endif #endif import Data.Maybe (fromMaybe, isJust) +import Data.Text (Text) import Safe (tailDef) import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme) import System.Console.GetOpt @@ -44,7 +45,7 @@ import System.Environment (getArgs, getProgName) import System.Exit (exitSuccess) import System.FilePath import System.IO (stdout) -import Text.DocTemplates (Val(..)) +import Text.DocTemplates (Context (..), ToContext (toVal), Val (..)) import Text.Pandoc import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), IpynbOutput (..), addMeta) import Text.Pandoc.Filter (Filter (..)) @@ -64,10 +65,8 @@ import qualified Data.ByteString as BS import qualified Data.ByteString.Lazy as B import qualified Data.Map as M import qualified Data.Text as T -import Data.Text (Text) -import Text.DocTemplates (ToContext(toVal), Context(..)) -import qualified Text.Pandoc.UTF8 as UTF8 import qualified Data.YAML as Y +import qualified Text.Pandoc.UTF8 as UTF8 parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt parseOptions options' defaults = do @@ -648,7 +647,7 @@ options = "all" -> return opt{ optIpynbOutput = IpynbOutputAll } "best" -> return opt{ optIpynbOutput = IpynbOutputBest } "none" -> return opt{ optIpynbOutput = IpynbOutputNone } - _ -> E.throwIO $ PandocOptionError $ + _ -> E.throwIO $ PandocOptionError "ipynb-output must be all, none, or best") "all|none|best") "" -- "Starting number for sections, subsections, etc." |