This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.hlint.yaml
69 lines (57 loc) · 2.35 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
###########################################################################
# Settings
###########################################################################
- arguments: [-XTypeApplications, -XRecursiveDo]
# These are just too annoying
- ignore: { name: Redundant do }
- ignore: { name: Redundant bracket }
- ignore: { name: Redundant lambda }
- ignore: { name: Redundant $ }
- ignore: { name: Redundant flip }
- ignore: { name: Move brackets to avoid $ }
# Losing variable names can be not-nice
- ignore: { name: Eta reduce }
- ignore: { name: Avoid lambda }
# Humans know better
- ignore: { name: Use camelCase }
- ignore: { name: Use const }
- ignore: { name: Use section }
- ignore: { name: Use if }
- ignore: { name: Use notElem }
- ignore: { name: Use fromMaybe }
- ignore: { name: Use maybe }
- ignore: { name: Use fmap }
- ignore: { name: Use foldl }
- ignore: { name: "Use :" }
- ignore: { name: Use ++ }
- ignore: { name: Use || }
- ignore: { name: Use && }
- ignore: { name: 'Use ?~' }
- ignore: { name: Use <$> }
# Sometimes [Char] is okay (if it means "a set of characters")
- ignore: { name: Use String }
# Sometimes TemplateHaskell is needed to please stylish-haskell
- ignore: { name: Unused LANGUAGE pragma }
# Some 'data' records will be extended with more fields later,
# so they shouldn't be replaced with 'newtype' blindly
- ignore: { name: Use newtype instead of data }
###########################################################################
# Various stuff
###########################################################################
- warn:
name: "Avoid 'both'"
lhs: both
rhs: Control.Lens.each
note: |
If you use 'both' on a 2-tuple and later it's accidentally
replaced with a longer tuple, 'both' will be silently applied to only
the *last two elements* instead of failing with a type error.
* If you want to traverse all elements of the tuple, use 'each'.
* If 'both' is used on 'Either' here, replace it with 'chosen'.
- warn: { lhs: either (const True) (const False), rhs: isLeft }
- warn: { lhs: either (const False) (const True), rhs: isRight }
- warn: { lhs: Data.Map.toAscList (Data.Map.fromList x), rhs:
Universum.sortWith fst x }
- warn: { lhs: Data.Map.toDescList (Data.Map.fromList x), rhs:
Universum.sortWith (Down . fst) x }
- warn: { lhs: map fst &&& map snd, rhs: unzip }