Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ detekt {
}

tasks {
test {
val detektTask = named("detekt") {
dependsOn(detektMain, detektTest)
}

test {
dependsOn(detektTask)
}
}
235 changes: 26 additions & 209 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,219 +2,36 @@ performance:
SpreadOperator:
active: false

formatting:
active: true
android: false
AnnotationOnSeparateLine:
active: false
ChainWrapping:
active: true
CommentSpacing:
active: true
Filename:
active: true
FinalNewline:
active: true
ImportOrdering:
libraries:
LibraryEntitiesShouldNotBePublic:
active: false
Indentation:
active: true
indentSize: 4
# continuationIndentSize: 4

formatting:
MaximumLineLength:
active: true
maxLineLength: 240
ModifierOrdering:
active: true
MultiLineIfElse:
active: true
NoBlankLineBeforeRbrace:
active: true
NoConsecutiveBlankLines:
active: true
NoEmptyClassBody:
active: true
NoLineBreakAfterElse:
active: true
NoLineBreakBeforeAssignment:
active: true
NoMultipleSpaces:
active: true
NoSemicolons:
active: true
NoTrailingSpaces:
active: true
NoUnitReturn:
active: true
NoUnusedImports:
active: true
NoWildcardImports:
active: true
PackageName:
active: true
ParameterListWrapping:
active: true
# indentSize: 4
SpacingAroundColon:
active: true
SpacingAroundComma:
active: true
SpacingAroundCurly:
active: true
SpacingAroundDot:
active: true
SpacingAroundKeyword:
active: true
SpacingAroundOperators:
active: true
SpacingAroundParens:
active: true
SpacingAroundRangeOperator:
active: true
StringTemplate:
active: true
maxLineLength: 200

style:
active: true
CollapsibleIfStatements:
active: false
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: ['to']
DataClassShouldBeImmutable:
active: false
EqualsNullCall:
active: true
EqualsOnSignatureLine:
active: false
ExplicitItLambdaParameter:
active: false
ExpressionBodySyntax:
active: false
includeLineWrapping: false
ForbiddenComment:
active: false
comments: [ 'TODO:','FIXME:','STOPSHIP:' ]
allowedPatterns: ""
ForbiddenImport:
active: false
imports: [ ]
forbiddenPatterns: ""
ForbiddenVoid:
active: false
ignoreOverridden: false
ignoreUsageInGenerics: false
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: [ 'describeContents' ]
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
MagicNumber:
active: true
excludes: [ "**/test/**","**/*.Test.kt","**/*.Spec.kt","**/*.Spek.kt","**/*Properties.kt","**/*Configuration.kt" ]
ignoreNumbers: [ '-1','0','1','2' ]
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreLocalVariableDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
ignoreNamedArgument: true
ignoreEnums: false
ignoreRanges: false
MaxLineLength:
active: true
maxLineLength: 240
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
MayBeConst:
active: true
ModifierOrder:
active: true
NestedClassesVisibility:
active: false
NewLineAtEndOfFile:
active: true
NoTabs:
active: true
OptionalAbstractKeyword:
active: true
OptionalUnit:
active: false
PreferToOverPairSyntax:
active: true
ProtectedMemberInFinalClass:
active: true
RedundantExplicitType:
active: false
RedundantVisibilityModifierRule:
active: true
ReturnCount:
active: true
max: 2
excludedFunctions: [ "equals" ]
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
SafeCast:
active: true
SerialVersionUIDInSerializableClass:
active: false
SpacingBetweenPackageAndImports:
active: false
ThrowsCount:
active: true
max: 2
TrailingWhitespace:
active: false
UnderscoresInNumericLiterals:
active: false
acceptableLength: 5
UnnecessaryAbstractClass:
active: false
UnnecessaryApply:
active: false
UnnecessaryInheritance:
active: true
UnnecessaryLet:
active: false
UnnecessaryParentheses:
active: false
UntilInsteadOfRangeTo:
active: false
UnusedImports:
active: true
UnusedPrivateClass:
active: true
UnusedPrivateMember:
active: true
allowedNames: "(_|ignored|expected|serialVersionUID)"
UseArrayLiteralsInAnnotations:
active: false
UseCheckOrError:
active: false
UseDataClass:
active: false
ignoreAnnotated: [ ]
allowVars: false
UseIfInsteadOfWhen:
active: false
UseRequire:
active: false
UselessCallOnNotNull:
active: true
UtilityClassWithPublicConstructor:
active: true
maxLineLength: 200
VarCouldBeVal:
active: false
WildcardImport:
ignoreLateinitVar: true
ForbiddenImport:
active: true

libraries:
LibraryEntitiesShouldNotBePublic:
active: false
ForbiddenPublicDataClass:
active: false
imports: []
forbiddenPatterns: 'org\.junit\.jupiter\.api\.Assertions|org\.hamcrest'
ForbiddenMethodCall:
active: true
methods:
- 'kotlin.assert'
- 'org.junit.jupiter.api.Assertions.assertEquals'
- 'org.junit.jupiter.api.Assertions.assertTrue'
- 'org.junit.jupiter.api.Assertions.assertFalse'
- 'org.junit.jupiter.api.Assertions.assertNull'
- 'org.junit.jupiter.api.Assertions.assertNotNull'
- 'org.junit.jupiter.api.Assertions.assertArrayEquals'
- 'org.junit.jupiter.api.Assertions.assertIterableEquals'
- 'org.junit.jupiter.api.Assertions.assertNotEquals'
- 'org.junit.jupiter.api.Assertions.assertSame'
- 'org.junit.jupiter.api.Assertions.assertNotSame'
- 'org.junit.jupiter.api.Assertions.assertAll'
- 'org.junit.jupiter.api.Assertions.assertThrowsExactly'
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

package io.github.mfvanek.spring.boot3.kotlin.test.service.dto

@Suppress("ForbiddenPublicDataClass")
data class CurrentTime(
val datetime: ParsedDateTime
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package io.github.mfvanek.spring.boot3.kotlin.test.service.dto

import java.time.LocalDateTime

@Suppress("ForbiddenPublicDataClass")
data class ParsedDateTime(
val year: Int,
val monthValue: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import io.github.mfvanek.spring.boot3.kotlin.test.support.TestBase
import io.micrometer.observation.Observation
import io.micrometer.observation.ObservationRegistry
import io.micrometer.tracing.Tracer
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
import java.util.Locale
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.system.CapturedOutput
import org.springframework.boot.test.system.OutputCaptureExtension
import java.time.LocalDateTime
import java.time.temporal.ChronoUnit
import java.util.Locale

@ExtendWith(OutputCaptureExtension::class)
class PublicApiServiceTest : TestBase() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.springframework.test.web.reactive.server.WebTestClient
import java.time.Clock
import java.util.*

@Suppress("UnnecessaryAbstractClass")
@ActiveProfiles("test")
@AutoConfigureObservability
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
Expand Down