-
Notifications
You must be signed in to change notification settings - Fork 0
/
diktat-analysis.yml
319 lines (319 loc) · 8.67 KB
/
diktat-analysis.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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
- name: DIKTAT_COMMON
configuration:
# put your package name here - it will be autofixed and checked
domainName: com.well
- name: CLASS_NAME_INCORRECT
enabled: true
configuration: {}
- name: CONSTANT_UPPERCASE
enabled: true
configuration: {}
- name: ENUM_VALUE
enabled: false #remove after 0.1.3
configuration:
enumStyle: pascalCase
- name: EXCEPTION_SUFFIX
enabled: true
configuration: {}
- name: FILE_NAME_INCORRECT
enabled: true
configuration: {}
- name: FILE_NAME_MATCH_CLASS
enabled: true
configuration: {}
- name: FUNCTION_BOOLEAN_PREFIX
enabled: true
configuration: {}
- name: FUNCTION_NAME_INCORRECT_CASE
enabled: true
configuration: {}
- name: GENERIC_NAME
enabled: true
configuration: {}
- name: IDENTIFIER_LENGTH
enabled: true
configuration: {}
- name: OBJECT_NAME_INCORRECT
enabled: true
configuration: {}
- name: PACKAGE_NAME_INCORRECT_CASE
enabled: false
configuration: {}
- name: PACKAGE_NAME_INCORRECT_PREFIX
enabled: true
configuration: {}
- name: PACKAGE_NAME_INCORRECT_SYMBOLS
enabled: true
configuration: {}
- name: PACKAGE_NAME_INCORRECT_PATH
enabled: true
configuration: {}
- name: PACKAGE_NAME_MISSING
enabled: false
configuration: {}
- name: VARIABLE_HAS_PREFIX
enabled: true
configuration: {}
- name: VARIABLE_NAME_INCORRECT
enabled: true
configuration: {}
- name: VARIABLE_NAME_INCORRECT_FORMAT
enabled: true
configuration: {}
- name: MISSING_KDOC_ON_FUNCTION
enabled: false
configuration: {}
- name: MISSING_KDOC_TOP_LEVEL
enabled: false
configuration: {}
- name: MISSING_KDOC_CLASS_ELEMENTS
enabled: false
configuration: {}
- name: KDOC_WITHOUT_PARAM_TAG
enabled: false
configuration: {}
- name: KDOC_WITHOUT_RETURN_TAG
enabled: true
configuration: {}
- name: KDOC_WITHOUT_THROWS_TAG
enabled: true
configuration: {}
- name: KDOC_EMPTY_KDOC
enabled: true
configuration: {}
- name: INCORRECT_PACKAGE_SEPARATOR
enabled: true
configuration: {}
- name: KDOC_NO_DEPRECATED_TAG
enabled: true
configuration: {}
- name: KDOC_NO_EMPTY_TAGS
enabled: true
configuration: {}
- name: KDOC_WRONG_SPACES_AFTER_TAG
enabled: true
configuration: {}
- name: KDOC_WRONG_TAGS_ORDER
enabled: true
configuration: {}
- name: KDOC_NO_NEWLINES_BETWEEN_BASIC_TAGS
enabled: true
configuration: {}
- name: KDOC_NEWLINES_BEFORE_BASIC_TAGS
enabled: true
configuration: {}
- name: KDOC_NO_NEWLINE_AFTER_SPECIAL_TAGS
enabled: true
configuration: {}
- name: KDOC_TRIVIAL_KDOC_ON_FUNCTION
enabled: 'true'
configuration: {}
- name: HEADER_WRONG_FORMAT
enabled: true
configuration: {}
- name: HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE
enabled: true
configuration: {}
- name: HEADER_MISSING_OR_WRONG_COPYRIGHT
enabled: false
configuration:
isCopyrightMandatory: true
copyrightText: 'Copyright (c) Your Company Name Here. 2010-2020'
- name: HEADER_NOT_BEFORE_PACKAGE
enabled: true
configuration: {}
- name: HEADER_CONTAINS_DATE_OR_AUTHOR
enabled: true
configuration: {}
- name: FILE_IS_TOO_LONG
enabled: true
configuration:
maxSize: '2000'
ignoreFolders: ''
- name: COMMENTED_OUT_CODE
enabled: true
configuration: {}
- name: FILE_CONTAINS_ONLY_COMMENTS
enabled: true
configuration: {}
- name: FILE_UNORDERED_IMPORTS
enabled: false
configuration: {}
- name: FILE_INCORRECT_BLOCKS_ORDER
enabled: true
configuration: {}
- name: FILE_NO_BLANK_LINE_BETWEEN_BLOCKS
enabled: true
configuration: {}
# Check: warns if wildcard imports are used except allows. (e.g. import org.cqfn.diktat.*)
- name: FILE_WILDCARD_IMPORTS
enabled: true
configuration:
allowedWildcards: "" # Allowed wildcards for imports (e.g. "import org.cqfn.diktat.*, import org.jetbrains.kotlin.*")
- name: NO_BRACES_IN_CONDITIONALS_AND_LOOPS
enabled: true
configuration: {}
- name: WRONG_ORDER_IN_CLASS_LIKE_STRUCTURES
enabled: false
configuration: {}
- name: BLANK_LINE_BETWEEN_PROPERTIES
enabled: true
configuration: {}
- name: BRACES_BLOCK_STRUCTURE_ERROR
enabled: true
configuration:
openBraceNewline: 'True'
closeBraceNewline: 'True'
- name: WRONG_INDENTATION
enabled: false
configuration: {}
- name: EMPTY_BLOCK_STRUCTURE_ERROR
enabled: true
configuration:
styleEmptyBlockWithNewline: 'True'
allowEmptyBlocks: 'False'
- name: MORE_THAN_ONE_STATEMENT_PER_LINE
enabled: true
configuration: {}
- name: LONG_LINE
enabled: true
configuration:
lineLength: '120'
- name: REDUNDANT_SEMICOLON
enabled: true
configuration: {}
- name: WRONG_NEWLINES
enabled: true
configuration: {}
- name: TOO_MANY_CONSECUTIVE_SPACES
enabled: true
configuration:
max_spaces: '1'
saveInitialFormattingForEnums: false
- name: TOO_MANY_BLANK_LINES
enabled: true
configuration: {}
- name: WRONG_WHITESPACE
enabled: true
configuration: {}
- name: BACKTICKS_PROHIBITED
enabled: true
configuration: {}
- name: STRING_CONCATENATION
enabled: true
configuration: {}
- name: WHEN_WITHOUT_ELSE
enabled: true
configuration: {}
- name: ANNOTATION_NEW_LINE
enabled: true
configuration: {}
- name: ENUMS_SEPARATED
enabled: false
configuration: {}
- name: LONG_NUMERICAL_VALUES_SEPARATED
enabled: true
configuration:
maxNumberLength: '5'
maxBlockLength: '3'
- name: WRONG_DECLARATIONS_ORDER
enabled: true
configuration:
sortEnum: true
sortProperty: true
- name: WRONG_MULTIPLE_MODIFIERS_ORDER
enabled: true
configuration: {}
- name: CONFUSING_IDENTIFIER_NAMING
enabled: true
configuration: {}
# Inspection that checks if there is a blank line before kDoc and none after
- name: WRONG_NEWLINES_AROUND_KDOC
enabled: true
configuration: {}
# Inspection that checks if there is no blank lines before first comment
- name: FIRST_COMMENT_NO_SPACES
enabled: true
configuration: {}
# Inspection that checks if there are blank lines between code and comment and between code start token and comment's text
- name: COMMENT_WHITE_SPACE
enabled: true
configuration:
maxSpacesBeforeComment: 2
maxSpacesInComment: 1
# Inspection that checks if all comment's are inside if-else code blocks. Exception is general if comment
- name: IF_ELSE_COMMENTS
enabled: true
configuration: {}
- name: WRONG_COPYRIGHT_YEAR
enabled: true
configuration: {}
# Inspection that checks if local variables are declared close to the first usage site
- name: LOCAL_VARIABLE_EARLY_DECLARATION
enabled: true
configuration: {}
# Try to avoid initialize val by null (e.g. val a: Int? = null -> val a: Int = 0)
- name: NULLABLE_PROPERTY_TYPE
enabled: true
configuration: {}
# Type aliases provide alternative names for existing types when type's reference text is longer 25 chars
- name: TYPE_ALIAS
enabled: true
configuration:
typeReferenceLength: '25' # max length of type reference
- name: GENERIC_VARIABLE_WRONG_DECLARATION
enabled: true
configuration: {}
# Inspection that checks if string template has redundant curly braces
- name: STRING_TEMPLATE_CURLY_BRACES
enabled: true
configuration: {}
# Variables with `val` modifier - are immutable (read-only). Usage of such variables instead of `var` variables increases
# robustness and readability of code, because `var` variables can be reassigned several times in the business logic.
# This rule prohibits usage of `var`s as local variables - the only exception is accumulators and counters
- name: SAY_NO_TO_VAR
enabled: true
configuration: {}
# Inspection that checks if string template has redundant quotes
- name: STRING_TEMPLATE_QUOTES
enabled: true
configuration: {}
# Checks that floating-point values are not used in arithmetic expressions
- name: FLOAT_IN_ACCURATE_CALCULATIONS
enabled: true
configuration: {}
# Checks that function length isn't too long
- name: TOO_LONG_FUNCTION
enabled: true
configuration:
maxFunctionLength: '30' # max length of function
isIncludeHeader: 'false' # count function's header
# Warns if there are nested functions
- name: AVOID_NESTED_FUNCTIONS
enabled: true
configuration: {}
# Checks that lambda inside function parameters is in the end
- name: LAMBDA_IS_NOT_LAST_PARAMETER
enabled: true
configuration: {}
# Checks that function doesn't contains too many parameters
- name: TOO_MANY_PARAMETERS
enabled: true
configuration:
maxParameterListSize: '5' # max parameters size
# Checks that function doesn't have too many nested blocks
- name: NESTED_BLOCK
enabled: true
configuration:
maxNestedBlockQuantity: '4'
# Checks that function use default values, instead overloading
- name: WRONG_OVERLOADING_FUNCTION_ARGUMENTS
enabled: true
configuration: {}
# Checks that property in constructor doesn't contains comment
- name: KDOC_NO_CONSTRUCTOR_PROPERTY
enabled: false
configuration: {}
- name: CUSTOM_GETTERS_SETTERS
enabled: false
configuration: {}