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
This commit is contained in:
Albert Krewinkel
2020-02-07 10:15:57 +01:00
parent 60a3158bf9
commit 6cd77d4c63
43 changed files with 178 additions and 186 deletions
+22 -9
View File
@@ -55,18 +55,31 @@
# - ignore: {name: "Use list comprehension"}
# - ignore: {name: "Redundant if"}
- ignore: {name: "Avoid lambda"}
- ignore: {name: "Use String"}
- ignore: {name: "Use isDigit"}
- ignore: {name: "Eta reduce"}
- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
- ignore: {name: "Parse error"} # we trust the compiler over HLint
- ignore: {name: "Use =="} # Creates infinite loops in `EQ` using expressions
- ignore: {name: "Evaluate"}
- ignore: {name: "Monad law, left identity", module: "Text.Pandoc.App.OutputSettings"}
- ignore: {name: "Parse error"} # we trust the compiler over HLint
- ignore: {name: "Reduce duplication", module: "Text.Pandoc.Readers.Markdown"}
- ignore: {name: "Use &&&"}
# - ignore: {name: "Redundant compare"}
- ignore: {name: "Use =="} # Creates infinite loops in `EQ` using expressions
- ignore: {name: "Use String"}
- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
- ignore: {name: "Use forM_", module: "Text.Pandoc.Readers.DocBook"}
- ignore: {name: "Use isDigit"}
- ignore: {name: "Use tuple-section", module: "Text.Pandoc.Readers.EPUB"}
- ignore: {name: "Use uncurry", module: "Text.Pandoc.Readers.Docx.Combine"}
- ignore:
name: "Use <$>"
within:
- Text.Pandoc.Readers.LaTeX
- Text.Pandoc.Readers.Markdown
- ignore:
name: "Use camelCase"
within:
- Text.Pandoc.Extensions
- Text.Pandoc.Lua.Marshalling.Version
- Text.Pandoc.Readers.Odt.ContentReader
- Text.Pandoc.Readers.Odt.Namespaces
# Define some custom infix operators
# - fixity: infixr 3 ~^#^~