-
Notifications
You must be signed in to change notification settings - Fork 0
/
.scalafix.conf
122 lines (110 loc) · 2.88 KB
/
.scalafix.conf
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
# Inspired by https://github.com/scalaz/scalazzi/blob/master/scalafix.conf
rules = [
Disable
DisableSyntax
ExplicitResultTypes
LeakingImplicitClassVal
MissingFinal
NoAutoTupling
NoValInForComprehension
ProcedureSyntax
RemoveUnused
]
Disable.symbols = [
{
regex = "^\\Qscala/collection/mutable\\E.*$"
message = "Java collections have better performance, which is what I assume you were trying to do"
}
{
regex = "^\\Qscala/collection/parallel\\E.*$"
message = "parallel collections are low performance and block the thread, prefer scalaz.ApplyN"
}
{
regex = "^\\Qscala/math/Big\\E.*$"
message = "scala arbitrary precision numbers are broken: https://github.com/scala/bug/issues/9670"
}
{
regex = {
includes = [
"^\\Qjava/io\\E.*$"
"^\\Qscala/io/Source\\E.*$"
]
}
message = "legacy blocking API, prefer java.nio"
}
{
regex = "^\\Qjava/net/URL#\\E.*$"
message = "URL talks to the network for equality, prefer URI"
}
{
symbol = "scala/Enumeration"
message = "prefer a sealed abstract class"
}
{
regex = {
includes = [
"^\\Qscala/util/Either.LeftProjection#get().\\E$"
"^\\Qscala/util/Either.RightProjection#get().\\E$"
"^\\Qscala/util/Try#get().\\E$"
"^\\Qscala/Option#get().\\E$"
"^\\Qscala/collection/IterableLike#head().\\E$"
]
}
message = "not a total function"
}
]
Disable.ifSynthetic = [
"java/io/Serializable"
"scala/Product"
# local type inference + covariant types fires this
# "scala/Nothing"
# when upstream broke noImplicitConversion and we don't agree that their
# implicits are worth the mental burden.
"scala/Option.option2Iterable"
"scala/Predef.any2stringadd"
# I don't understand why these are synthetic
# https://github.com/scalacenter/scalafix/issues/703
{
regex = {
includes = [
"^\\Qscala/collection/MapLike#apply().\\E$"
"^\\Qscala/collection/LinearSeqOptimized#apply().\\E$"
]
}
message = "not a total function"
}
]
DisableSyntax {
noAsInstanceOf = true
noContravariantTypes = true
noCovariantTypes = true
noDefaultArgs = true
noFinalVal = true
noFinalize = true
noImplicitConversion = true
noImplicitObject = true
noIsInstanceOf = true
noNulls = true
noReturns = true
noSemicolons = true
noTabs = true
# TODO: reactivate when errors are handled correctly
noThrows = false
# TODO: reactivate when we find a way to reactivate it
noUniversalEquality = false
noValInAbstract = true
noValPatterns = true
noVars = true
noWhileLoops = true
noXml = true
}
ExplicitResultTypes {
unsafeShortenNames = true
fatalWarnings = true
# these apply to non-implicits
memberKind = [Def, Val]
memberVisibility = [Public, Protected]
# turn to the max...
skipSimpleDefinitions = false
skipLocalImplicits = false
}