forked from fossas/fossa-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.hlint.yaml
64 lines (58 loc) · 3.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
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
- arguments: [-XTypeApplications, -XNumericUnderscores]
# Often, code is more readable with extra parens, or less readable with list comprehensions
- ignore: {name: "Redundant bracket"}
- ignore: {name: "Use list comprehension"}
# Import Preferences
- modules:
- {name: Data.Set, as: Set, message: "Use complete name for qualified import of Set"}
- {name: Data.Map, as: Map, message: "Use complete name for qualified import of Map"}
- {name: Data.Map.Strict, as: Map, message: "Use complete name for qualified import of Strict Map"}
- {name: Data.Text, as: Text, message: "Use complete name for qualified import of Text"}
# Don't allow unsafe IO
- {name: System.IO.Unsafe, within: []}
# Arrows are more complicated than the problem they solve
- {name: Control.Arrow, within: []}
# Styling Preferences
- suggest: {lhs: "asum [x, y]", rhs: x <|> y}
- suggest: {lhs: return, rhs: pure}
- suggest: {lhs: () <$ x, rhs: Control.Monad.void x}
- suggest: {lhs: x <&> f, rhs: f <$> x}
- suggest: {lhs: mapM, rhs: traverse}
- suggest: {lhs: forM, rhs: for}
- suggest: {lhs: forM_, rhs: for_}
- suggest: {lhs: Data.Text.pack, rhs: Data.String.Conversion.toText}
- ignore: {name: "Use toText", within: ["Data.String.Conversion"]}
- suggest: {lhs: Data.Text.unpack, rhs: Data.String.Conversion.toString}
- ignore: {name: "Use toString", within: ["Data.String.Conversion"]}
- suggest: {lhs: Data.List.foldl, rhs: Data.List.foldl'}
- suggest: {lhs: Prelude.foldl, rhs: Data.List.foldl'}
- suggest: {lhs: "(Data.Set.size x) == 0" , rhs: "Data.Set.null x"}
- suggest: {lhs: "(Data.Set.size x) /= 0" , rhs: "not $ Data.Set.null x"}
# Forbidden items, only allowed in compile-time code, or test code (however, it should be avoided in tests as much as possible).
- functions:
- {name: error, within: [Data.String.Conversion, Control.Effect.Replay]}
- {name: undefined, within: []}
- {name: Prelude.head, within: [Control.Effect.*.TH, "**.*Spec"], message: "Use Data.List.Extra.head' instead."}
- {name: Prelude.tail, within: [Data.FileEmbed.Extra]}
- {name: Prelude.init, within: []}
- {name: Prelude.last, within: ["**.*Spec"]}
- {name: Data.ByteString.head, within: []}
- {name: Data.Bytestring.tail, within: []}
- {name: Data.Bytestring.init, within: []}
- {name: Data.Bytestring.last, within: []}
- {name: Data.Text.head, within: []}
- {name: Data.Text.tail, within: []}
- {name: Data.Text.init, within: []}
- {name: Data.Text.last, within: []}
# TODO: remove special-case
- {name: Data.List.NonEmpty.fromList, within: ["App.Fossa.Analyze.Filter", "Test.Fixtures", "**.*Spec"], message: "Pattern-match on nonEmpty instead of forcing the list."}
- {name: "Prelude.!!", within: ["**.*Spec"]}
- {name: "Data.Map.!", within: []}
# TODO: remove the need to special-case this test module.
- {name: fromJust, within: [App.DocsSpec]}
- {name: Test.Hspec.fdescribe, within: [], message: "May prevent tests from running"}
# We define fit' in terms of fit,so this is necessary
- {name: Test.Hspec.fit, within: [Test.Effect], message: "May prevent tests from running"}
- {name: Test.Hspec.focus, within: [], message: "May prevent tests from running"}
- {name: Test.Hspec.fspecify, within: [], message: "May prevent tests from running"}
- {name: Test.Hspec.fcontext, within: [], message: "May prevent tests from running"}