-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.hlint.yaml
39 lines (32 loc) · 1.29 KB
/
.hlint.yaml
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
# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################
- functions: # Disabled functions
- {name: unsafePerformIO, within: []}
- {name: unsafeCoerce, within: []}
- {name: GHC.List.head, within: []}
- {name: GHC.List.tail, within: []}
- {name: GHC.List.init, within: []}
- {name: GHC.List.last, within: []}
# Generalise map to fmap, ++ to <>
- group: {name: generalise, enabled: true}
# Custom hints:
- error: {lhs: mapM, rhs: traverse, name: Generalize mapM}
- error: {lhs: forM, rhs: for, name: Generalize forM}
- error: {lhs: sequence, rhs: sequenceA, name: Generalize sequence}
- error: {lhs: mapM_, rhs: traverse_, name: Generalize mapM_}
- error: {lhs: forM_, rhs: for_, name: Generalize forM_}
- error: {lhs: sequence_, rhs: sequenceA_, name: Generalize sequence_}
- warning: {lhs: return, rhs: pure, name: Avoid return}
- warning: {lhs: "mappend x y", rhs: x <> y}
- warning: {lhs: "fmap f ask", rhs: asks f}
- warning: {lhs: "f <$> ask", rhs: asks f}
- warning: {lhs: "maybe mempty f x", rhs: foldMap f x}
# Ignore some builtin hints
- ignore: {name: Use tuple-section}
- ignore: {name: Use const}
- ignore: {name: Use fmap}
- ignore: {name: Use <$>}
# Lower the severity of eta reduce
- suggest: {name: Eta reduce}
# Define some custom infix operators