-
-
Notifications
You must be signed in to change notification settings - Fork 431
Expand file tree
/
Copy path.hlint.yaml
More file actions
273 lines (244 loc) · 8.51 KB
/
.hlint.yaml
File metadata and controls
273 lines (244 loc) · 8.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################
# To run HLint do:
# $ hlint --git -j4
# Warnings currently triggered by our code
- ignore: {name: "Avoid NonEmpty.unzip"} # 2 hints
- ignore: {name: "Avoid lambda"} # 14 hints
- ignore: {name: "Avoid lambda using `infix`"} # 6 hints
- ignore: {name: "Eta reduce"} # 63 hints
- ignore: {name: "Evaluate"} # 1 hint
- ignore: {name: "Functor law"} # 1 hint
- ignore: {name: "Hoist not"} # 2 hints
- ignore: {name: "Move brackets to avoid $"} # 30 hints
- ignore: {name: "Parse error: on input `)'"} # 1 hint
- ignore: {name: "Redundant $"} # 8 hints
- ignore: {name: "Redundant <$>"} # 2 hints
- ignore: {name: "Redundant bracket"} # 12 hints
- ignore: {name: "Redundant guard"} # 1 hint
- ignore: {name: "Redundant lambda"} # 2 hints
- ignore: {name: "Redundant seq"} # 1 hint
- ignore: {name: "Replace case with fromMaybe"} # 1 hint
- ignore: {name: "Replace case with maybe"} # 5 hints
- ignore: {name: "Unused LANGUAGE pragma"} # 14 hints
- ignore: {name: "Use :"} # 9 hints
- ignore: {name: "Use <$>"} # 29 hints
- ignore: {name: "Use ?~"} # 3 hints
- ignore: {name: "Use atomicModifyIORef'_"} # 3 hints
- ignore: {name: "Use camelCase"} # 35 hints
- ignore: {name: "Use concatForM"} # 2 hints
- ignore: {name: "Use concatMap"} # 1 hint
- ignore: {name: "Use const"} # 2 hints
- ignore: {name: "Use curry"} # 1 hint
- ignore: {name: "Use drop1"} # 4 hints
- ignore: {name: "Use dropPrefix"} # 1 hint
- ignore: {name: "Use enumerate"} # 1 hint
- ignore: {name: "Use fewer imports"} # 15 hints
- ignore: {name: "Use fmap"} # 1 hint
- ignore: {name: "Use for_"} # 1 hint
- ignore: {name: "Use guards"} # 1 hint
- ignore: {name: "Use head"} # 1 hint
- ignore: {name: "Use lambda-case"} # 1 hint
- ignore: {name: "Use lower"} # 1 hint
- ignore: {name: "Use newtype instead of data"} # 13 hints
- ignore: {name: "Use record patterns"} # 3 hints
- ignore: {name: "Use section"} # 7 hints
- ignore: {name: "Use traverse_"} # 3 hints
- ignore: {name: "Use uncurry"} # 1 hint
- ignore: {name: "Use unless"} # 4 hints
- ignore: {name: "Use whenJust"} # 1 hint
- ignore: {name: "Use whenMaybe"} # 1 hint
# Gives at least one suggestion we don't like.
- ignore: {name: "Use <=<"} # 2 hints
- ignore: {name: "Use zipFrom"} # 4 hints
- ignore: {name: "Use zipWithFrom"} # 2 hints
# We are using the "redundant" return/pure to assign a name. We do not want to
# delete it. In particular, this is not an improvement:
# Found:
# do options <- somethingComplicated
# pure options
# Perhaps:
# do somethingComplicated
- ignore: {name: "Redundant pure"} # 10 hints
- ignore: {name: "Redundant return"} # 3 hints
# Off by default hints we like
- warn: {name: "Use module export list"} # 86 hints
# Condemn nub and friends
- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x}
- warn: {lhs: nub, rhs: Data.List.Extra.nubOrd}
- warn: {lhs: nubBy, rhs: Data.List.Extra.nubOrdBy}
- warn: {lhs: Data.List.Extra.nubOn, rhs: Data.List.Extra.nubOrdOn}
- functions:
# Things that are unsafe in Haskell base library
- name: unsafePerformIO
within:
- Development.IDE.Core.Shake
- Development.IDE.GHC.Util
- Development.IDE.Core.FileStore
- Development.IDE.Plugin.CodeAction.Util
- Development.IDE.Graph.Internal.Database
- Development.IDE.Graph.Internal.Paths
- Development.IDE.Graph.Internal.Profile
- Development.IDE.Graph.Internal.Key
- Ide.Types
- Test.Hls
- Test.Hls.Command
- AutoTupleSpec
- name: unsafeInterleaveIO
within:
- Development.IDE.LSP.LanguageServer
- {name: unsafeDupablePerformIO, within: []}
- name: unsafeCoerce
within:
- Ide.Plugin.Eval.Code
- Development.IDE.Core.Compile
- Development.IDE.Types.Shake
- Ide.Plugin.Properties
# Things that are a bit dangerous in the GHC API
- name: nameModule
within:
- Development.IDE.GHC.CoreFile
- Ide.Plugin.CallHierarchy.Internal
- Ide.Plugin.Rename
- Compat.HieBin
# Partial functions
# We need to check fucntions which
# are typically exported multiple ways under both names,
# see https://github.com/ndmitchell/hlint/issues/1389
- name: [Prelude.head, Data.List.head]
within:
- Main
- Experiments
- Development.Benchmark.Rules
- Development.IDE.Plugin.Completions
- Development.IDE.Plugin.CodeAction.ExactPrint
- Development.IDE.Spans.Documentation
- Development.IDE.Session
- Ide.Plugin.CallHierarchy.Internal
- Ide.Plugin.Eval.Code
- Ide.Plugin.Eval.Util
- Ide.Plugin.Class.ExactPrint
- TExpectedActual
- TRigidType
- TRigidType2
- RightToLeftFixities
- Typeclass
- CompletionTests #Previously part of GHCIDE Main tests
- DiagnosticTests #Previously part of GHCIDE Main tests
- FindDefinitionAndHoverTests #Previously part of GHCIDE Main tests
- FindImplementationAndHoverTests #Previously part of GHCIDE Main tests
- TestUtils #Previously part of GHCIDE Main tests
- CodeLensTests #Previously part of GHCIDE Main tests
- name: [Prelude.tail, Data.List.tail]
within:
- Main
- Development.Benchmark.Rules
- Development.IDE.Plugin.CodeAction
- Development.IDE.Plugin.CodeAction.ExactPrint
- Development.IDE.Session
- UnificationSpec
- WatchedFileTests #Previously part of GHCIDE Main tests
- name: [Prelude.last, Data.List.last]
within:
- Main
- Development.IDE.Plugin.CodeAction
- Development.IDE.Plugin.CodeAction.ExactPrint
- Development.IDE.Spans.Common
- Development.IDE.Graph.Internal.Types
- Ide.PluginUtils
- Ide.Plugin.Eval.Parse.Comments
- Ide.Plugin.Eval.CodeLens
- FindDefinitionAndHoverTests #Previously part of GHCIDE Main tests
- FindImplementationAndHoverTests #Previously part of GHCIDE Main tests
- name: [Prelude.init, Data.List.init]
within:
- Main
- Development.IDE.Spans.Common
- Ide.PluginUtils
- Development.Benchmark.Rules
- TErrorGivenPartialSignature
- IfaceTests #Previously part of GHCIDE Main tests
- THTests #Previously part of GHCIDE Main tests
- WatchedFileTests #Previously part of GHCIDE Main tests
- name: Data.List.foldl1'
within: []
- name: Data.List.foldr1'
within: []
- name: ["Prelude.!!", "Data.List.!!"]
within:
- Main
- Experiments
- FunctionalCodeAction
- Development.IDE.Plugin.CodeAction
- Development.IDE.Plugin.Completions.Logic
- Development.IDE.Spans.Documentation
- TErrorGivenPartialSignature
- InitializeResponseTests #Previously part of GHCIDE Main tests
- PositionMappingTests #Previously part of GHCIDE Main tests
- name: Data.Text.head
within:
- Development.IDE.Plugin.CodeAction
- Development.IDE.Plugin.Completions.Logic
- name: Data.Foldable.foldl1
within: []
- name: Data.Foldable.foldr1
within: []
- name: Data.Maybe.fromJust
within:
- Experiments
- Main
- Progress
- Development.IDE.Core.Compile
- Development.IDE.Core.Rules
- Development.IDE.Core.Shake
- Development.IDE.Test
- Development.IDE.Graph.Internal.Profile
- Development.IDE.Graph.Internal.Rules
- CodeLensTests #Previously part of GHCIDE Main tests
- name: "Data.Map.!"
within: []
- name: "Data.IntMap.!"
within: []
- name: "Data.Vector.!"
within: []
- name: "GHC.Arr.!"
within: []
# We do not want to use functions from the
# GHC driver. Instead use hls rules to construct
# an appropriate GHC session
- name: "load"
within: []
- name: "load'"
within: []
- name: "loadWithCache"
within: []
# Tracing functions
# We ban an explicit list rather than the
# Debug.Trace, because that module also
# includes the eventlog tracing functions,
# which are legitimate to use.
- name:
- Debug.Trace.trace
- Debug.Trace.traceId
- Debug.Trace.traceShow
- Debug.Trace.traceShowId
- Debug.Trace.traceStack
- Debug.Trace.traceIO
- Debug.Trace.traceM
- Debug.Trace.traceShowM
- Debug.Trace.putTraceMsg
within:
- Development.IDE.Core.Compile
- Development.IDE.Graph.Internal.Database
- Development.IDE.GHC.Util
- Development.IDE.Plugin.CodeAction.Util
# We really do not want novel usages of restricted functions, and mere
# Warning is not enough to prevent those consistently; you need a build failure.
- error: {name: Avoid restricted function}
- group: {name: extra, enabled: true}
- arguments:
- --ignore-glob=**/test/data/**
- --ignore-glob=**/testdata/**
- --ignore-glob=dist-*
- --ignore-glob=docs/contributing/plugin-tutorial.lhs