2017-10-29 21:01:20 +01:00
|
|
|
# HLint configuration file
|
|
|
|
# https://github.com/ndmitchell/hlint
|
|
|
|
##########################
|
|
|
|
|
|
|
|
# Specify additional command line arguments
|
|
|
|
#
|
2020-10-04 14:53:26 +02:00
|
|
|
- arguments: [--color=auto, --cpp-ansi]
|
2017-10-29 21:01:20 +01:00
|
|
|
|
|
|
|
# Ignore some builtin hints
|
2020-11-07 19:38:03 +01:00
|
|
|
#
|
2017-10-29 21:01:20 +01:00
|
|
|
- ignore: {name: "Avoid lambda"}
|
Change reader types, allowing better tracking of source positions.
Previously, when multiple file arguments were provided, pandoc
simply concatenated them and passed the contents to the readers,
which took a Text argument.
As a result, the readers had no way of knowing which file
was the source of any particular bit of text. This meant that
we couldn't report accurate source positions on errors or
include accurate source positions as attributes in the AST.
More seriously, it meant that we couldn't resolve resource
paths relative to the files containing them
(see e.g. #5501, #6632, #6384, #3752).
Add Text.Pandoc.Sources (exported module), with a `Sources` type
and a `ToSources` class. A `Sources` wraps a list of `(SourcePos,
Text)` pairs. [API change] A parsec `Stream` instance is provided for
`Sources`. The module also exports versions of parsec's `satisfy` and
other Char parsers that track source positions accurately from a
`Sources` stream (or any instance of the new `UpdateSourcePos` class).
Text.Pandoc.Parsing now exports these modified Char parsers instead of
the ones parsec provides. Modified parsers to use a `Sources` as stream
[API change].
The readers that previously took a `Text` argument have been
modified to take any instance of `ToSources`. So, they may still
be used with a `Text`, but they can also be used with a `Sources`
object.
In Text.Pandoc.Error, modified the constructor PandocParsecError
to take a `Sources` rather than a `Text` as first argument,
so parse error locations can be accurately reported.
T.P.Error: showPos, do not print "-" as source name.
2021-05-01 22:17:45 +02:00
|
|
|
- ignore: {name: "Use bimap"}
|
2021-08-30 18:38:13 +02:00
|
|
|
- ignore: {name: "Use void"}
|
2017-10-29 21:01:20 +01:00
|
|
|
- ignore: {name: "Eta reduce"}
|
|
|
|
- ignore: {name: "Evaluate"}
|
2020-11-07 19:38:03 +01:00
|
|
|
- ignore: {name: "Reduce duplication"} # TODO: could be more fine-grained
|
2017-10-29 21:01:20 +01:00
|
|
|
- ignore: {name: "Use &&&"}
|
2020-02-07 10:15:57 +01:00
|
|
|
- ignore: {name: "Use String"}
|
2021-02-15 07:29:21 +01:00
|
|
|
- ignore: {name: "Use camelCase"}
|
2020-02-07 10:15:57 +01:00
|
|
|
- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
|
|
|
|
- ignore: {name: "Use isDigit"}
|
2020-11-07 19:38:03 +01:00
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Monad law, left identity"
|
|
|
|
within: Text.Pandoc.App.OutputSettings
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Move brackets to avoid $"
|
|
|
|
within: Text.Pandoc.Writers.CslJson
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Redundant <$>"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Readers.Docx.Parse
|
|
|
|
- Text.Pandoc.Writers.MediaWiki
|
|
|
|
- Text.Pandoc.Writers.OpenDocument
|
|
|
|
- Text.Pandoc.Writers.Powerpoint.Output
|
|
|
|
- Text.Pandoc.Writers.Powerpoint.Presentation
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Redundant return"
|
|
|
|
within: Text.Pandoc.Citeproc.BibTeX
|
|
|
|
|
2021-03-17 00:01:30 +01:00
|
|
|
# With recent hlint this rule has given false positives on TH
|
2020-11-07 19:38:03 +01:00
|
|
|
- ignore:
|
|
|
|
name: "Redundant bracket"
|
2021-03-17 00:01:30 +01:00
|
|
|
|
2020-11-07 19:38:03 +01:00
|
|
|
|
2020-02-07 10:15:57 +01:00
|
|
|
- ignore:
|
|
|
|
name: "Use <$>"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Readers.LaTeX
|
|
|
|
- Text.Pandoc.Readers.Markdown
|
2020-11-07 19:38:03 +01:00
|
|
|
|
2020-02-07 10:15:57 +01:00
|
|
|
- ignore:
|
|
|
|
name: "Use camelCase"
|
|
|
|
within:
|
2020-09-13 16:48:14 +02:00
|
|
|
- Tests.Writers.Docbook
|
|
|
|
- Tests.Writers.Native
|
2020-11-07 19:38:03 +01:00
|
|
|
- Text.Pandoc.Citeproc
|
2020-02-07 10:15:57 +01:00
|
|
|
- Text.Pandoc.Extensions
|
2020-09-13 16:48:14 +02:00
|
|
|
- Text.Pandoc.Lua.Marshaling.Version
|
2021-02-04 19:07:59 +01:00
|
|
|
- Text.Pandoc.Lua.Module.Pandoc
|
2020-09-21 00:48:31 +02:00
|
|
|
- Text.Pandoc.Lua.Module.Utils
|
2020-02-07 10:15:57 +01:00
|
|
|
- Text.Pandoc.Readers.Odt.ContentReader
|
|
|
|
- Text.Pandoc.Readers.Odt.Namespaces
|
2017-10-29 21:01:20 +01:00
|
|
|
|
2020-11-07 19:38:03 +01:00
|
|
|
- ignore:
|
|
|
|
name: "Use forM_"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Readers.DocBook
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Use Just"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Citeproc.MetaValue
|
|
|
|
- Text.Pandoc.Readers.Odt.ContentReader
|
|
|
|
- Text.Pandoc.Writers.Roff
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Use list comprehension"
|
|
|
|
within: Text.Pandoc.Citeproc.BibTeX
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Use list literal pattern"
|
|
|
|
within: Text.Pandoc.Citeproc.MetaValue
|
|
|
|
|
|
|
|
# TODO: check
|
|
|
|
- ignore:
|
|
|
|
name: "Use second"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Citeproc.BibTeX
|
|
|
|
- Text.Pandoc.Citeproc.Locator
|
|
|
|
|
|
|
|
# TODO: check
|
|
|
|
- ignore:
|
|
|
|
name: "Use sortOn"
|
|
|
|
within: Text.Pandoc.Writers.OpenDocument
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
name: "Use tuple-section"
|
|
|
|
within:
|
|
|
|
- Text.Pandoc.Readers.EPUB
|
|
|
|
- Text.Pandoc.ImageSize
|
|
|
|
- Text.Pandoc.Readers.Markdown
|
|
|
|
- Text.Pandoc.Readers.RST
|
|
|
|
|
2020-12-31 01:04:09 +01:00
|
|
|
# fromRight is only in base >= 4.10
|
|
|
|
- ignore:
|
|
|
|
name: "Use fromRight"
|
|
|
|
|
2017-10-29 21:01:20 +01:00
|
|
|
# Define some custom infix operators
|
|
|
|
# - fixity: infixr 3 ~^#^~
|