44 validation : true
55 warningsAsErrors : true
66
7+ import :
8+ EnforceStaticImport :
9+ active : true
10+ methods :
11+ - ' com.google.common.truth.Truth.assertThat'
12+ - ' org.junit.jupiter.params.provider.Arguments.arguments'
13+ - ' org.apache.logging.log4j.spi.AbstractLogger.CATCHING_MARKER'
14+
715comments :
816 active : true
917 EndOfSentenceFormat :
@@ -18,11 +26,11 @@ comments:
1826 searchInInnerObject : true
1927 searchInInnerInterface : true
2028 UndocumentedPublicFunction :
21- excludes : ['**/test/**']
2229 active : true
23- UndocumentedPublicProperty :
2430 excludes : ['**/test/**']
31+ UndocumentedPublicProperty :
2532 active : true
33+ excludes : ['**/test/**']
2634
2735complexity :
2836 active : false
@@ -38,14 +46,14 @@ exceptions:
3846 TooGenericExceptionCaught :
3947 active : true
4048 exceptionNames :
41- - ArrayIndexOutOfBoundsException
42- - Error
43- - Exception
44- - IllegalMonitorStateException
45- - NullPointerException
46- - IndexOutOfBoundsException
47- - RuntimeException
48- - Throwable
49+ - ArrayIndexOutOfBoundsException
50+ - Error
51+ - Exception
52+ - IllegalMonitorStateException
53+ - NullPointerException
54+ - IndexOutOfBoundsException
55+ - RuntimeException
56+ - Throwable
4957 allowedExceptionNameRegex : ' _|(ignore|expected|cause).*'
5058
5159# The naming rules exclude test classes by default. Since we want naming rules to apply
@@ -76,25 +84,33 @@ potential-bugs:
7684 active : true
7785 DontDowncastCollectionTypes :
7886 active : true
79- ExitOutsideMain :
87+ DoubleMutabilityForCollection :
8088 active : true
81- HasPlatformType :
89+ # Test directories might want to reassign variables for result collections
90+ excludes : [ '**/test/**' ]
91+ ElseCaseInsteadOfExhaustiveWhen :
92+ active : true
93+ ExitOutsideMain :
8294 active : true
8395 IgnoredReturnValue :
8496 active : true
85- restrictToAnnotatedMethods : true
97+ restrictToConfig : true
8698 returnValueAnnotations : ['*.CheckReturnValue', '*.CheckResult']
8799 MapGetWithNotNullAssertionOperator :
88100 active : true
101+ # test directories will want to throw NPE's with maps
102+ excludes : [ '**/test/**' ]
89103 NullableToStringCall :
90104 active : true
91- UnconditionalJumpStatementInLoop :
105+ ignoreFunction :
106+ - ' toString()'
107+ NullCheckOnMutableProperty :
92108 active : true
93- UnreachableCatchBlock :
109+ PropertyUsedBeforeDeclaration :
94110 active : true
95- UnusedUnaryOperator :
111+ UnconditionalJumpStatementInLoop :
96112 active : true
97- UselessPostfixExpression :
113+ UnnecessaryNotNullCheck :
98114 active : true
99115
100116style :
@@ -105,14 +121,20 @@ style:
105121 active : true
106122 DataClassShouldBeImmutable :
107123 active : true
124+ DestructuringDeclarationWithTooManyEntries :
125+ active : true
126+ maxDestructuringEntries : 4
127+ DoubleNegativeLambda :
128+ active : true
108129 EqualsOnSignatureLine :
109130 active : true
110131 ExplicitCollectionElementAccessMethod :
111132 active : true
112133 ExpressionBodySyntax :
113134 active : true
114135 includeLineWrapping : true
115- excludes : ['**/test/**']
136+ ForbiddenAnnotation :
137+ active : true
116138 ForbiddenImport :
117139 active : true
118140 imports :
@@ -122,32 +144,49 @@ style:
122144 - ' org.junit.BeforeClass'
123145 - ' org.junit.After'
124146 - ' org.junit.AfterClass'
125- forbiddenPatterns : ' junit.framework.*'
147+ - ' org.junit.jupiter.api.Assertions'
148+ forbiddenPatterns : ' (?:junit\.framework|org\.junit\.jupiter\.api\.Assertions)\.(?!assertThrows).+'
126149 ForbiddenComment :
127- active : true
128- values : ['FIXME', 'STOPSHIP']
150+ comments :
151+ - reason : ' Forbidden FIXME todo marker in comment, please fix the problem.'
152+ value : ' FIXME'
153+ - reason : ' Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
154+ value : ' STOPSHIP'
155+ - reason : ' Authors are not recorded in KDoc.'
156+ value : ' @author'
129157 ForbiddenMethodCall :
130158 active : true
131- excludes : ['**/test/**']
159+ excludes : [ '**/test/**' ]
132160 methods :
133161 - ' kotlin.io.println'
134162 - ' kotlin.io.print'
135- ForbiddenPublicDataClass :
136- active : true
137- excludes : ['**']
138- ignorePackages : ['*.internal', '*.internal.*']
163+ - ' java.nio.file.Path.toFile'
164+ - ' org.apache.logging.log4j.Logger.trace'
165+ - ' org.apache.logging.log4j.Logger.debug'
166+ - ' org.apache.logging.log4j.Logger.info'
167+ - ' org.apache.logging.log4j.Logger.warn'
168+ - ' org.apache.logging.log4j.Logger.error'
169+ - ' org.apache.logging.log4j.Logger.fatal'
170+ - ' org.apache.logging.log4j.Logger.log'
171+ - ' org.apache.logging.log4j.Logger.printf'
172+ - ' org.apache.logging.log4j.Logger.isTraceEnabled'
173+ - ' org.apache.logging.log4j.Logger.isDebugEnabled'
174+ - ' org.apache.logging.log4j.Logger.isInfoEnabled'
175+ - ' org.apache.logging.log4j.Logger.isWarnEnabled'
176+ - ' org.apache.logging.log4j.Logger.isErrorEnabled'
177+ - ' org.apache.logging.log4j.Logger.isFatalEnabled'
178+ - ' org.apache.logging.log4j.Logger.isEnabled'
139179 ForbiddenVoid :
140180 active : true
141181 ignoreOverridden : false
142182 ignoreUsageInGenerics : false
143- LibraryCodeMustSpecifyReturnType :
144- # Enforced by the compiler
145- active : false
146- LibraryEntitiesShouldNotBePublic :
147- # Enforced by the compiler
148- active : false
149- MandatoryBracesIfStatements :
183+ LoopWithTooManyJumpStatements :
184+ maxJumpCount : 3
185+ BracesOnIfStatements :
150186 active : true
187+ BracesOnWhenStatements :
188+ active : true
189+ multiLine : ' necessary'
151190 MandatoryBracesLoops :
152191 active : true
153192 MaxLineLength :
@@ -156,14 +195,11 @@ style:
156195 NewLineAtEndOfFile :
157196 # Specified by editorconfig & enforced by ktlint
158197 active : false
159- OptionalWhenBraces :
198+ NullableBooleanCheck :
160199 active : true
161200 RedundantExplicitType :
162201 active : true
163- RedundantHigherOrderMapUsage :
164- active : true
165202 RedundantVisibilityModifierRule :
166- # activate to true once https://github.com/detekt/detekt/issues/3874 is resolved
167203 active : false
168204 ReturnCount :
169205 active : false
@@ -172,38 +208,37 @@ style:
172208 UnderscoresInNumericLiterals :
173209 active : true
174210 acceptableLength : 5
175- UnnecessaryFilter :
211+ UnnecessaryBackticks :
176212 active : true
213+ # Disabled because it produces false positive when using JUnit's @Nested classes
214+ UnnecessaryInnerClass :
215+ active : false
177216 UnnecessaryLet :
178217 active : true
179218 UntilInsteadOfRangeTo :
180219 active : true
181- UnusedPrivateMember :
182- active : true
183- excludes : ['**/test/**']
184- UseArrayLiteralsInAnnotations :
185- active : true
186- UseCheckNotNull :
187- active : true
188- UseCheckOrError :
189- active : true
190220 UseEmptyCounterpart :
191221 active : true
192222 UseIfEmptyOrIfBlank :
193223 active : true
194224 UseIfInsteadOfWhen :
195225 active : true
196- UseIsNullOrEmpty :
226+ ignoreWhenContainingVariableDeclaration : true
227+ UseLet :
197228 active : true
198- UseOrEmpty :
229+ UseRequireNotNull :
199230 active : true
200- UseRequire :
231+ UseSumOfInsteadOfFlatMapSize :
201232 active : true
202- UseRequireNotNull :
233+ UnnecessaryBracesAroundTrailingLambda :
203234 active : true
204235 WildcardImport :
205236 # Specified by editorconfig and enforced by ktlint
206237 active : false
207238 MagicNumber :
208239 # We usually catch these in code review, and more often than not, the constants aren't very magical
209240 active : false
241+
242+ performance :
243+ UnnecessaryPartOfBinaryExpression :
244+ active : true
0 commit comments