@@ -2,85 +2,107 @@
22# https://github.com/ndmitchell/hlint
33##########################
44
5−# This file contains a template configuration file, which is typically
6−# placed as .hlint.yaml in the root of your project
7−
8−
95# Specify additional command line arguments
106#
117- arguments: [--color=auto, --cpp-ansi]
128
13−
14−# Control which extensions/flags/modules/functions can be used
15−#
16−# - extensions:
17−# - default: false # all extension are banned by default
18−# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
19−# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
20−#
21−# - flags:
22−# - {name: -w, within: []} # -w is allowed nowhere
23−#
24−# - modules:
25−# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
26−# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
27−#
28−# - functions:
29−# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
30−
31−
32−# Add custom hints for this project
33−#
34−# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
35−# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
36−
37−
38−# Turn on hints that are off by default
39−#
40−# Ban "module X(module X) where", to require a real export list
41−# - warn: {name: Use explicit module export list}
42−#
43−# Replace a $ b $ c with a . b $ c
44−# - group: {name: dollar, enabled: true}
45−#
46−# Generalise map to fmap, ++ to <>
47−# - group: {name: generalise, enabled: true}
48−
49−
509# Ignore some builtin hints
51−# - ignore: {name: Use let}
52−# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
53−# - ignore: {name: "Use section"}
54−# - ignore: {name: "Use camelCase"}
55−# - ignore: {name: "Use list comprehension"}
56−# - ignore: {name: "Redundant if"}
10+#
5711- ignore: {name: "Avoid lambda"}
5812- ignore: {name: "Eta reduce"}
5913- ignore: {name: "Evaluate"}
60−- ignore: {name: "Monad law, left identity", module: "Text.Pandoc.App.OutputSettings"}
61−- ignore: {name: "Reduce duplication", module: "Text.Pandoc.Readers.Markdown"}
14+- ignore: {name: "Reduce duplication"} # TODO: could be more fine-grained
6215- ignore: {name: "Use &&&"}
6316- ignore: {name: "Use String"}
6417- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
65−- ignore: {name: "Use forM_", module: "Text.Pandoc.Readers.DocBook"}
6618- ignore: {name: "Use isDigit"}
67−- ignore: {name: "Use tuple-section", module: "Text.Pandoc.Readers.EPUB"}
68−- ignore: {name: "Use uncurry", module: "Text.Pandoc.Readers.Docx.Combine"}
19+
20+- ignore:
21+ name: "Monad law, left identity"
22+ within: Text.Pandoc.App.OutputSettings
23+
24+- ignore:
25+ name: "Move brackets to avoid $"
26+ within: Text.Pandoc.Writers.CslJson
27+
28+- ignore:
29+ name: "Redundant <$>"
30+ within:
31+ - Text.Pandoc.Readers.Docx.Parse
32+ - Text.Pandoc.Writers.MediaWiki
33+ - Text.Pandoc.Writers.OpenDocument
34+ - Text.Pandoc.Writers.Powerpoint.Output
35+ - Text.Pandoc.Writers.Powerpoint.Presentation
36+
37+- ignore:
38+ name: "Redundant return"
39+ within: Text.Pandoc.Citeproc.BibTeX
40+
41+# TODO: check
42+- ignore:
43+ name: "Redundant bracket"
44+ within:
45+ - Text.Pandoc.Citeproc
46+ - Text.Pandoc.Citeproc.BibTeX
47+ - Text.Pandoc.Citeproc.MetaValue
48+
6949- ignore:
7050 name: "Use <$>"
7151 within:
7252 - Text.Pandoc.Readers.LaTeX
7353 - Text.Pandoc.Readers.Markdown
54+
7455- ignore:
7556 name: "Use camelCase"
7657 within:
7758 - Tests.Writers.Docbook
7859 - Tests.Writers.Native
60+ - Text.Pandoc.Citeproc
7961 - Text.Pandoc.Extensions
8062 - Text.Pandoc.Lua.Marshaling.Version
8163 - Text.Pandoc.Lua.Module.Utils
8264 - Text.Pandoc.Readers.Odt.ContentReader
8365 - Text.Pandoc.Readers.Odt.Namespaces
8466
67+- ignore:
68+ name: "Use forM_"
69+ within:
70+ - Text.Pandoc.Readers.DocBook
71+
72+- ignore:
73+ name: "Use Just"
74+ within:
75+ - Text.Pandoc.Citeproc.MetaValue
76+ - Text.Pandoc.Readers.Odt.ContentReader
77+ - Text.Pandoc.Writers.Roff
78+
79+- ignore:
80+ name: "Use list comprehension"
81+ within: Text.Pandoc.Citeproc.BibTeX
82+
83+- ignore:
84+ name: "Use list literal pattern"
85+ within: Text.Pandoc.Citeproc.MetaValue
86+
87+# TODO: check
88+- ignore:
89+ name: "Use second"
90+ within:
91+ - Text.Pandoc.Citeproc.BibTeX
92+ - Text.Pandoc.Citeproc.Locator
93+
94+# TODO: check
95+- ignore:
96+ name: "Use sortOn"
97+ within: Text.Pandoc.Writers.OpenDocument
98+
99+- ignore:
100+ name: "Use tuple-section"
101+ within:
102+ - Text.Pandoc.Readers.EPUB
103+ - Text.Pandoc.ImageSize
104+ - Text.Pandoc.Readers.Markdown
105+ - Text.Pandoc.Readers.RST
106+
85107# Define some custom infix operators
86108# - fixity: infixr 3 ~^#^~