-
Notifications
You must be signed in to change notification settings - Fork 453
/
.hlint.yaml
100 lines (78 loc) · 3.32 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
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
# HLint configuration file
# https://github.com/ndmitchell/hlint
- arguments: [--color=auto, -XStrictData]
# Blacklist some functions by default.
- functions:
- {name: unsafePerformIO, within: [Data.Scientific.Exts.attemptUnsafeArithmetic]}
- {name: unsafeCoerce, within: []}
- {name: head, within: []}
- {name: tail, within: []}
- {name: init, within: []}
- {name: last, within: []}
- {name: fromJust, within: []}
- {name: decodeUtf8, within: [], message: "Use decodeUtf8' or decodeUtf8With lenientDecode"}
# Replace a $ b $ c with a . b $ c
- group: {name: dollar, enabled: true}
# Generalise map to fmap, ++ to <>
- group: {name: generalise, enabled: true}
# Change the severity of the default group to warning
- warn: {group: {name: default}}
# Ignore the highly noisy module export list hint
- ignore: {name: Use explicit module export list}
# Ignore some builtin hints
- ignore: {name: Use mappend}
- ignore: {name: Redundant do}
- ignore: {name: Use lambda-case} # TODO: investigate whether cost-center analysis is better with lambda-case than it was
- ignore: {name: Use fmap} # Ignored because map has better type inference.
# Change the severity of hints we don’t want to fail CI for
- suggest: {name: Eta reduce}
# While I think DerivingStrategies is good, it's too noisy to suggest by default
- ignore:
name: Use DerivingStrategies
# Ignore eta reduce in the assignment modules
- ignore:
name: Eta reduce
within:
- Language.Go.Assignment
- Language.Python.Assignment
- Language.Ruby.Assignment
- ignore: {name: Use ., within: [Analysis.Abstract.Graph.graphingModules, Semantic.Distribute]}
- ignore:
within:
- Proto.Semantic
- Proto.Semantic_Fields
- Proto.Semantic_JSON
- ignore:
name: Reduce duplication
within:
- Semantic.Util
- Language.Ruby.Tags
# hlint has issues with QuantifiedConstraints (see https://github.com/ndmitchell/hlint/issues/759)
# Once the above is fixed, we can drop this error.
- ignore: { name: Parse error }
# hlint is too paranoid about NonEmpty functions (https://github.com/ndmitchell/hlint/issues/787)
- ignore:
name: Avoid restricted function
within:
- Language.Python.Syntax
- Data.Syntax.Expression
# Our customized warnings
# AMP fallout
- warning: {lhs: mapM, rhs: traverse, name: Generalize mapM}
- warning: {lhs: mapM_, rhs: traverse_, name: Generalize mapM_}
- warning: {lhs: forM, rhs: for, name: Generalize forM}
- warning: {lhs: forM_, rhs: for_, name: Generalize forM_}
- warning: {lhs: sequence, rhs: sequenceA, name: Generalize sequence}
- warning: {lhs: sequence_, rhs: sequenceA_, name: Generalize sequence_}
- warning: {lhs: return, rhs: pure, name: Avoid return}
# Terms
- warning: {lhs: termFAnnotation . unTerm, rhs: termAnnotation, name: Use termAnnotation}
- warning: {lhs: termFOut . unTerm, rhs: termOut, name: Use termOut}
- warning: {lhs: project . termOut, rhs: projectTerm, name: Use projectTerm}
# Conveniences
- warning: {lhs: maybe a pure, rhs: maybeM a, name: Use maybeM}
- warning: {lhs: either (const a) id, rhs: fromRight a, name: use fromRight}
- warning: {lhs: either id (const a), rhs: fromLeft a, name: use fromLeft}
# Applicative style
- warning: {lhs: f <$> pure a <*> b, rhs: f a <$> b, name: Avoid redundant pure}
- warning: {lhs: f <$> pure a <* b, rhs: f a <$ b, name: Avoid redundant pure}