-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.hlint.yaml
191 lines (161 loc) · 7.14 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
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
# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################
# This file contains a template configuration file, which is typically
# placed as .hlint.yaml in the root of your project
# Specify additional command line arguments
#
# - arguments: [--color, --cpp-simple, -XQuasiQuotes]
# Control which extensions/flags/modules/functions can be used
#
# - extensions:
# - default: false # all extension are banned by default
# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
#
# - flags:
# - {name: -w, within: []} # -w is allowed nowhere
#
# - modules:
# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
#
# - functions:
# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
# Add custom hints for this project
#
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
# Turn on hints that are off by default
#
# Ban "module X(module X) where", to require a real export list
# - warn: {name: Use explicit module export list}
#
# Replace a $ b $ c with a . b $ c
# - group: {name: dollar, enabled: true}
#
# Generalise map to fmap, ++ to <>
# - group: {name: generalise, enabled: true}
# Ignore some builtin hints
# - ignore: {name: Use let}
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
# Define some custom fixity operators
# - fixity: infixr 3 ~^#^~
# To generate a suitable file for HLint do:
# $ hlint --default > .hlint.yaml
- ignore: {name: "Use list comprehension"}
- arguments:
- -XAllowAmbiguousTypes
- -XConstraintKinds
- -XDataKinds
- -XDefaultSignatures
- -XDeriveGeneric
- -XFlexibleContexts
- -XFlexibleInstances
- -XFunctionalDependencies
- -XGADTs
- -XGeneralizedNewtypeDeriving
- -XLambdaCase
- -XMultiParamTypeClasses
- -XOverloadedStrings
- -XPatternSynonyms
- -XPolyKinds
- -XScopedTypeVariables
- -XStandaloneDeriving
- -XTupleSections
- -XTypeApplications
- -XTypeFamilies
- -XTypeOperators
- -XUndecidableInstances
- -XRankNTypes
# hints found in src/Control/SemiIso.hs
- warn: {lhs: "SI (pure . a) (pure . b)", rhs: "siPure a b"}
- warn: {lhs: "SemiIso (pure . a) (pure . b)", rhs: "siPure a b"}
- warn: {lhs: "SemiIso (const empty) (const empty)", rhs: "zeroArrow"}
# hints found in src/Control/Arrow/Extra.hs
- fixity: "infixl 5 <+^"
- fixity: "infixl 5 ^+>"
- fixity: "infixl 5 ^+^"
- warn: {lhs: "a <+> arr b", rhs: "a <+^ b"}
- warn: {lhs: "arr a <+> b", rhs: "a ^+> b"}
- warn: {lhs: "arr a <+> arr b", rhs: "a ^+^ b"}
# hints found in src/Control/Arrow/Extra/ArrowChoice.hs
- fixity: "infixl 2 +++"
- fixity: "infixl 2 |||"
# hints found in src/Control/Arrow/Extra/ArrowPlus.hs
- fixity: "infixl 5 <+>"
# hints found in src/Control/Arrow/Extra/ArrowZero.hs
# no hints found
# hints found in src/Control/Arrow/Extra/BaseArrow.hs
- fixity: "infixl 3 ***"
- fixity: "infixl 3 &&&"
- fixity: "infixl 1 >>>"
- fixity: "infixl 1 <<<"
# hints found in src/Control/Arrow/Extra/Orphans.hs
# no hints found
# hints found in src/Control/Arrow/Extra/PolyArrow.hs
- fixity: "infixl 1 ^>>"
- fixity: "infixl 1 >>^"
- fixity: "infixl 1 ^<<"
- fixity: "infixl 1 <<^"
- fixity: "infixl 1 ^>^"
- fixity: "infixl 1 ^<^"
- warn: {lhs: "arr a >>> arr b", rhs: "a ^>^ b"}
- warn: {lhs: "arr a <<< arr b", rhs: "a ^<^ b"}
- warn: {lhs: "arr a >>> b", rhs: "a ^>> b"}
- warn: {lhs: "a >>> arr b", rhs: "a >>^ b"}
- warn: {lhs: "a <<< arr b", rhs: "a <<^ b"}
- warn: {lhs: "arr a <<< b", rhs: "a ^<< b"}
# hints found in src/Data/Isoparsec.hs
- warn: {lhs: "a <+^ konst ()", rhs: "opt a"}
- warn: {lhs: "opt (b >>^ turn (konst a))", rhs: "opt' a b"}
- warn: {lhs: "(a &&& (repeating a <+^ konst [])) >>^ siCons", rhs: "repeating a"}
- warn: {lhs: "sepBy1 a b <+^ konst []", rhs: "sepBy a b"}
- warn: {lhs: "(b &&& repeating (a *>> b) <+^ konst []) >>^ siCons", rhs: "sepBy1 a b"}
- fixity: "infixl 0 <.>"
- warn: {lhs: "(b >>^ morphed) >>^ siPrism a", rhs: "a <.> b"}
- warn: {lhs: "withPrism a\n (\\ x y -> SemiIso (pure . x) (either (const empty) pure . y))", rhs: "siPrism a"}
- fixity: "infixl 8 ~>"
- fixity: "infixl 8 ~>^"
- fixity: "infixl 8 ^~>"
- fixity: "infixl 8 ^~>^"
- warn: {lhs: "turn siHFst ^>> (enlist a *** enlist b) >>^ siHFst", rhs: "a ~> b"}
- warn: {lhs: "siPure fst (, HNil)", rhs: "siHFst"}
- fixity: "infixl 5 ~|"
- warn: {lhs: "enlist a <+> enlist b", rhs: "a ~| b"}
- fixity: "infixl 7 ~&"
- warn: {lhs: "(enlist a &&& enlist b) >>^ consHList", rhs: "a ~& b"}
- fixity: "infixl 9 ~*"
- warn: {lhs: "turn consHList ^>> (enlist a *** enlist b) >>^ consHList", rhs: "a ~* b"}
- fixity: "infixl 6 ~$>"
- warn: {lhs: "enlist a >>> enlist (arr (siPrism b))", rhs: "a ~$> b"}
- warn: {lhs: "turn fMorphed ^>>\n (a (fMorphed ^>> b >>^ turn fMorphed)) >>^ fMorphed", rhs: "hmap a b"}
- warn: {lhs: "siPure coerce coerce", rhs: "coercing"}
- warn: {lhs: "siPure morphTuples morphTuples", rhs: "morphed"}
- warn: {lhs: "siPure flatUnmorph flatMorph", rhs: "fMorphed"}
- warn: {lhs: "turn fMorphed ^>> a >>^ fMorphed", rhs: "enlist a"}
- warn: {lhs: "fMorphed ^>> a >>^ turn fMorphed", rhs: "delist a"}
- warn: {lhs: "siPure (uncurry (++:))\n (\\ c -> (hTake @(Length a) Proxy c, hDrop @(Length a) Proxy c))", rhs: "consHList"}
- warn: {lhs: "auto @x >>^ turn (konst a)", rhs: "specific a"}
- warn: {lhs: "siPure fromIntegral fromIntegral", rhs: "throughIntegral"}
# hints found in src/Data/Isoparsec/ByteString.hs
- warn: {lhs: "arr (siPure C.unpack C.pack)", rhs: "utf8"}
- warn: {lhs: "bytesToIsoparsec (Proxy @e) >>^ coercing @(Byte16 e) @Word16", rhs: "toIsoparsec"}
- warn: {lhs: "bytesToIsoparsec (Proxy @e) >>^ coercing @(Byte32 e) @Word32", rhs: "toIsoparsec"}
- warn: {lhs: "bytesToIsoparsec (Proxy @e) >>^ coercing @(Byte64 e) @Word64", rhs: "toIsoparsec"}
- warn: {lhs: "anyToken >>> mapIso [(0, False), (1, True)]", rhs: "toIsoparsec"}
# hints found in src/Data/Isoparsec/Char.hs
- warn: {lhs: "token ' '", rhs: "space"}
- warn: {lhs: "tokensWhile isSpace >>^ ((maskr . turn . konst) mempty)", rhs: "unsafeWhiteSpace"}
- warn: {lhs: "tokensWhile1 isSpace >>^ ((maskr . turn . konst) (singleton ' '))", rhs: "unsafeWhiteSpace1"}
# hints found in src/Data/Isoparsec/Cokleisli.hs
- warn: {lhs: "Cokleisli\n (\\ t ->\n case project a t of\n Just x -> return x\n Nothing -> mzero)", rhs: "arr a"}
- warn: {lhs: "Cokleisli (const mzero)", rhs: "zeroArrow"}
# hints found in src/Data/Isoparsec/Internal.hs
- warn: {lhs: "((a &&& arrowsWhile a) >>^ siCons) <+^ isoConst () []", rhs: "arrowsWhile a"}
- warn: {lhs: "siMaybe (pure . uncurry cons) uncons", rhs: "siCons"}
- warn: {lhs: "SI (\\ c -> guard (a c) >> b c)\n (c >=> (\\ c -> guard (a c) >> pure c))", rhs: "siCheck a b c"}
- warn: {lhs: "siCheck a (pure . b) (pure . c)", rhs: "isoCheck a b c"}
- warn: {lhs: "SI (const (pure b)) (const (pure a))", rhs: "isoConst a b"}
- warn: {lhs: "isoCheck a id id", rhs: "check a"}
- warn: {lhs: "SI (const (pure a)) (const (pure ())) >>> check (== a)", rhs: "konst a"}