-
Notifications
You must be signed in to change notification settings - Fork 9
/
detekt-config.yml
224 lines (217 loc) · 5.43 KB
/
detekt-config.yml
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
build:
maxIssues: 0
weights:
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1
complexity:
active: true
ComplexCondition:
active: true
excludes: "**/buildSrc/**"
threshold: 4
ComplexMethod:
active: true
excludes: "**/buildSrc/**"
threshold: 10
ignoreSingleWhenExpression: true
LargeClass:
active: true
excludes: "**/test/**,**/integration-test/**,**/*Test.kt,**/*Tests.kt,**/buildSrc/**"
threshold: 600
LongMethod:
active: true
excludes: "**/test/**,**/integration-test/**,**/*Test.kt,**/*Tests.kt,**/buildSrc/**"
threshold: 120
LongParameterList:
active: true
excludes: "**/buildSrc/**"
constructorThreshold: 6
functionThreshold: 6
ignoreDefaultParameters: false
NestedBlockDepth:
active: true
excludes: "**/buildSrc/**"
threshold: 4
TooManyFunctions:
active: true
excludes: "**/test/**,**/integration-test/**,**/*Test.kt,**/*Tests.kt,**/buildSrc/**"
thresholdInFiles: 15
thresholdInClasses: 15
thresholdInInterfaces: 15
thresholdInObjects: 15
thresholdInEnums: 15
empty-blocks:
active: true
EmptyCatchBlock:
active: true
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
excludes: "**/buildSrc/**"
EmptyClassBlock:
active: true
excludes: "**/buildSrc/**"
EmptyDefaultConstructor:
active: true
excludes: "**/buildSrc/**"
EmptyDoWhileBlock:
active: true
excludes: "**/buildSrc/**"
EmptyElseBlock:
active: true
excludes: "**/buildSrc/**"
EmptyFinallyBlock:
active: true
excludes: "**/buildSrc/**"
EmptyForBlock:
active: true
excludes: "**/buildSrc/**"
EmptyIfBlock:
active: true
excludes: "**/buildSrc/**"
EmptyInitBlock:
active: true
excludes: "**/buildSrc/**"
EmptyKtFile:
active: true
excludes: "**/buildSrc/**"
EmptySecondaryConstructor:
active: true
excludes: "**/buildSrc/**"
EmptyWhenBlock:
active: true
excludes: "**/buildSrc/**"
EmptyWhileBlock:
active: true
excludes: "**/buildSrc/**"
exceptions:
active: true
TooGenericExceptionCaught:
active: true
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
- Exception
- IllegalMonitorStateException
- NullPointerException
- IndexOutOfBoundsException
- RuntimeException
- Throwable
excludes: "**/buildSrc/**"
TooGenericExceptionThrown:
active: true
exceptionNames:
- Error
- Exception
- Throwable
- RuntimeException
excludes: "**/buildSrc/**"
naming:
active: true
ClassNaming:
active: true
classPattern: '[A-Z$][a-zA-Z0-9$]*'
excludes: "**/buildSrc/**"
EnumNaming:
active: true
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
excludes: "**/buildSrc/**"
FunctionNaming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
excludes: "**/buildSrc/**"
ignoreOverridden: true
MatchingDeclarationName:
active: true
excludes: "**/buildSrc/**"
ObjectPropertyNaming:
active: true
constantPattern: '[A-Za-z][_A-Za-z0-9]*'
excludes: "**/buildSrc/**"
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
PackageNaming:
active: true
excludes: "**/buildSrc/**"
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
TopLevelPropertyNaming:
active: true
constantPattern: '[A-Z][_A-Z0-9]*'
excludes: "**/buildSrc/**"
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
VariableNaming:
active: true
excludes: "**/buildSrc/**"
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
performance:
active: true
ForEachOnRange:
active: true
excludes: "**/buildSrc/**"
SpreadOperator:
active: true
excludes: "**/buildSrc/**"
UnnecessaryTemporaryInstantiation:
active: true
excludes: "**/buildSrc/**"
potential-bugs:
active: true
DuplicateCaseInWhenExpression:
active: true
excludes: "**/buildSrc/**"
EqualsWithHashCodeExist:
active: true
excludes: "**/buildSrc/**"
ExplicitGarbageCollectionCall:
active: true
excludes: "**/buildSrc/**"
UnreachableCode:
active: true
excludes: "**/buildSrc/**"
style:
active: true
ForbiddenComment:
active: true
excludes: "**/buildSrc/**"
values: ["TODO:","FIXME:","STOPSHIP:"]
MagicNumber:
active: false
excludes: "**/test/**,**/integration-test/**,**/*Test.kt,**/*Tests.kt,**/buildSrc/**"
ignoreNumbers: ["-1","0","1","2"]
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
ignoreNamedArgument: true
ignoreEnums: true
MaxLineLength:
active: false
excludes: "**/buildSrc/**"
maxLineLength: 140
excludePackageStatements: true
excludeImportStatements: true
ModifierOrder:
active: true
excludes: "**/buildSrc/**"
OptionalAbstractKeyword:
active: true
excludes: "**/buildSrc/**"
SafeCast:
active: true
excludes: "**/buildSrc/**"
ThrowsCount:
active: true
excludes: "**/buildSrc/**"
max: 2
WildcardImport:
active: true
excludes: "**/buildSrc/**"
excludeImports: ["java.util.*","kotlinx.android.synthetic.*"]
UnusedImports:
active: true