-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdetekt.yml
More file actions
204 lines (188 loc) · 7.19 KB
/
detekt.yml
File metadata and controls
204 lines (188 loc) · 7.19 KB
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
# Detekt configuration for JetBrains Toolbox Plugin Auto-Approval Compliance
# Based on clarified requirements from JetBrains team
build:
maxIssues: 1000 # Allow many issues for code quality reporting
excludeCorrectable: false
config:
validation: true
warningsAsErrors: false # Don't treat warnings as errors
checkExhaustiveness: false
# CRITICAL: JetBrains Compliance Rules using detekt built-in rules
style:
active: true
# JetBrains Auto-Approval Compliance: Forbidden experimental annotations
ForbiddenAnnotation:
active: true
annotations:
- reason: 'Forbidden for JetBrains auto-approval: Core Kotlin experimental APIs are not allowed'
value: 'kotlin.ExperimentalStdlibApi'
- reason: 'Forbidden for JetBrains auto-approval: Core Kotlin experimental APIs are not allowed'
value: 'kotlin.ExperimentalUnsignedTypes'
- reason: 'Forbidden for JetBrains auto-approval: Core Kotlin experimental APIs are not allowed'
value: 'kotlin.contracts.ExperimentalContracts'
- reason: 'Forbidden for JetBrains auto-approval: Core Kotlin experimental APIs are not allowed'
value: 'kotlin.experimental.ExperimentalTypeInference'
- reason: 'Forbidden for JetBrains auto-approval: Internal coroutines APIs should be avoided'
value: 'kotlinx.coroutines.InternalCoroutinesApi'
- reason: 'Forbidden for JetBrains auto-approval: Experimental time APIs are not allowed'
value: 'kotlin.time.ExperimentalTime'
# Note: ExperimentalCoroutinesApi, DelicateCoroutinesApi, FlowPreview are acceptable
# based on JetBrains feedback about select/onTimeout being OK
# JetBrains Auto-Approval Compliance: Forbidden method calls
ForbiddenMethodCall:
active: true
methods:
# Java runtime hooks - forbidden
- reason: 'Forbidden for JetBrains auto-approval: Java runtime hooks are not allowed'
value: 'java.lang.Runtime.addShutdownHook'
- reason: 'Forbidden for JetBrains auto-approval: Java runtime hooks are not allowed'
value: 'java.lang.System.setSecurityManager'
- reason: 'Forbidden for JetBrains auto-approval: Java runtime hooks are not allowed'
value: 'java.lang.Thread.setUncaughtExceptionHandler'
- reason: 'Forbidden for JetBrains auto-approval: Java runtime hooks are not allowed'
value: 'java.lang.Thread.setDefaultUncaughtExceptionHandler'
# Manual thread creation - warnings (allowed with proper cleanup)
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.lang.Thread.<init>'
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.util.concurrent.Executors.newFixedThreadPool'
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.util.concurrent.Executors.newCachedThreadPool'
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.util.concurrent.Executors.newSingleThreadExecutor'
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.util.concurrent.CompletableFuture.runAsync'
- reason: 'Warning for JetBrains auto-approval: Manual thread creation detected. Consider using coroutineScope.launch or ensure proper cleanup in CoderRemoteProvider#close()'
value: 'java.util.concurrent.CompletableFuture.supplyAsync'
# JetBrains Auto-Approval Compliance: Forbidden imports
ForbiddenImport:
active: true
imports:
# Potentially bundled libraries - warnings
- reason: 'Warning for JetBrains auto-approval: Ensure slf4j is not bundled - it is provided by Toolbox'
value: 'org.slf4j.*'
- reason: 'Warning for JetBrains auto-approval: Ensure annotations library is not bundled - it is provided by Toolbox'
value: 'org.jetbrains.annotations.*'
# Runtime hook classes - forbidden
- reason: 'Forbidden for JetBrains auto-approval: Runtime hook classes are not allowed'
value: 'java.lang.Runtime'
- reason: 'Forbidden for JetBrains auto-approval: Security manager modifications are not allowed'
value: 'java.security.SecurityManager'
# Other important style rules
MagicNumber:
active: true
ignoreNumbers:
- '-1'
- '0'
- '1'
- '2'
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreLocalVariableDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
ignoreNamedArgument: true
ignoreEnums: false
ignoreRanges: false
ignoreExtensionFunctions: true
MaxLineLength:
active: true
maxLineLength: 120
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
NewLineAtEndOfFile:
active: true
WildcardImport:
active: true
# Essential built-in rules for basic code quality
complexity:
active: true
CyclomaticComplexMethod:
active: true
threshold: 15
LongMethod:
active: true
threshold: 60
LongParameterList:
active: true
functionThreshold: 6
constructorThreshold: 7
NestedBlockDepth:
active: true
threshold: 4
coroutines:
active: true
GlobalCoroutineUsage:
active: true
RedundantSuspendModifier:
active: true
SleepInsteadOfDelay:
active: true
exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
ObjectExtendsThrowable:
active: true
PrintStackTrace:
active: true
ReturnFromFinally:
active: true
SwallowedException:
active: true
ThrowingExceptionFromFinally:
active: true
ThrowingExceptionsWithoutMessageOrCause:
active: true
TooGenericExceptionCaught:
active: true
TooGenericExceptionThrown:
active: true
naming:
active: true
ClassNaming:
active: true
classPattern: '[A-Z][a-zA-Z0-9]*'
FunctionNaming:
active: true
functionPattern: '[a-z][a-zA-Z0-9]*'
PackageNaming:
active: true
packagePattern: '[a-z]+(\.?[a-z][A-Za-z0-9]*)*'
VariableNaming:
active: true
variablePattern: '[a-z][A-Za-z0-9]*'
performance:
active: true
ArrayPrimitive:
active: true
ForEachOnRange:
active: true
SpreadOperator:
active: true
UnnecessaryTemporaryInstantiation:
active: true
potential-bugs:
active: true
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
active: true
ExplicitGarbageCollectionCall:
active: true
HasPlatformType:
active: true
InvalidRange:
active: true
UnreachableCatchBlock:
active: true
UnreachableCode:
active: true
UnsafeCallOnNullableType:
active: true
UnsafeCast:
active: true
WrongEqualsTypeParameter:
active: true