Skip to content
Permalink
Browse files

detekt: Only configure the differences to the default configuration

Remove settings that are part of the default configurations, and
override default settings that would otherwise cause issues to be
reported that were not reported before.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch-si.com>
  • Loading branch information...
sschuberth committed Feb 10, 2019
1 parent eb2b13b commit 97bbecc79791fef44ebaa4df89bbaddb7a71b1ff
@@ -1,21 +1,34 @@
# Configuration of Detekt rule sets, see: https://github.com/arturbosch/detekt#rulesets
# Configuration of detekt rule sets, see https://arturbosch.github.io/detekt/comments.html.
# This file only lists the differences to the default configuration at
# https://github.com/arturbosch/detekt/blob/master/detekt-cli/src/main/resources/default-detekt-config.yml.

build:
maxIssues: 0
weights:
comments: 0

comments:
CommentOverPrivateMethod:
active: false
CommentOverPrivateProperty:
active: false

complexity:
LargeClass:
threshold: 150
ComplexMethod:
threshold: 33
LongMethod:
threshold: 158
LongParameterList:
threshold: 8
NestedBlockDepth:
threshold: 4
threshold: 10
TooManyFunctions:
thresholdInClasses: 19
thresholdInObjects: 14

# Formatting rules are implemented via the ktlint plugin. As ktlint does not allow exceptions, we need to disable
# respective rules completely.
formatting:
ChainWrapping:
active: false
NoItParamInMultilineLambda:
active: false
NoWildcardImports:
active: false
ParameterListWrapping:
active: false

performance:
SpreadOperator:
@@ -24,17 +37,17 @@ performance:
style:
ForbiddenComment:
active: false
MaxLineLength:
active: true
maxLineLength: 120
NewLineAtEndOfFile:
active: true
MagicNumber:
active: false
ReturnCount:
active: false
SpacingBetweenPackageAndImports:
active: true
ThrowsCount:
max: 5
UnusedImports:
active: true
WildcardImport:
active: true
excludeImports: '
ch.frankel.slf4k.*,
com.here.ort.analyzer.managers.*,
@@ -401,6 +401,8 @@ class MavenSupport(workspaceReader: WorkspaceReader) {
val tempFile = File.createTempFile("ort", "checksum-${checksum.algorithm}")

val transporter = transporterProvider.newTransporter(repositorySystemSession, repository)

@Suppress("TooGenericExceptionCaught")
val actualChecksum = try {
transporter.get(GetTask(checksum.location).setDataFile(tempFile))

@@ -145,7 +145,10 @@ subprojects {
// Align the detekt core and plugin versions.
toolVersion = detektPluginVersion

// Only configure differences to the default.
buildUponDefaultConfig = true
config = files("../.detekt.yml")

input = files("src/main/kotlin", "src/test/kotlin", "src/funTest/kotlin")
}

@@ -154,6 +154,7 @@ object ReporterCommand : CommandWithHelp() {
absoluteOutputDir.safeMkdirs()

reports.forEach { (reporter, file) ->
@Suppress("TooGenericExceptionCaught")
try {
reporter.generateReport(
ortResult,
@@ -52,6 +52,7 @@ object RequirementsCommand : CommandWithHelp() {
classes.filterNot {
Modifier.isAbstract(it.modifiers) || it.isAnonymousClass || it.isLocalClass
}.sortedBy { it.simpleName }.forEach {
@Suppress("TooGenericExceptionCaught")
try {
val kotlinObject = it.kotlin.objectInstance

@@ -36,6 +36,7 @@ import java.util.SortedSet
* The common output format for the analyzer and scanner. It contains information about the scanned repository, and the
* analyzer and scanner will add their result to it.
*/
@Suppress("TooManyFunctions")
data class OrtResult(
/**
* Information about the repository that was used as input.
@@ -25,6 +25,7 @@ import java.util.SortedSet

// A custom value filter for [PackageLinkage] to work around
// https://github.com/FasterXML/jackson-module-kotlin/issues/193.
@Suppress("EqualsWithHashCodeExist")
class PackageLinkageValueFilter {
override fun equals(other: Any?) = other == PackageLinkage.DYNAMIC
}
@@ -45,6 +45,7 @@ import javax.xml.parsers.DocumentBuilderFactory
import kotlinx.html.*
import kotlinx.html.dom.*

@Suppress("LargeClass")
class StaticHtmlReporter : Reporter() {
private val css = javaClass.getResource("/static-html-reporter.css").readText()

@@ -35,6 +35,7 @@ import io.kotlintest.specs.WordSpec
import java.io.File
import java.time.Instant

@Suppress("LargeClass")
class ScanCodeTest : WordSpec({
val scanner = ScanCode("ScanCode", ScannerConfiguration())

@@ -153,6 +153,7 @@ fun generateEnumClass(
* An enum containing all SPDX $description IDs. This class is generated by the Gradle task
* '$taskName'.
*/
@Suppress("EnumNaming")
enum class $className(
/**
* The id of the $description.
@@ -23,6 +23,7 @@ package com.here.ort.spdx
* An enum containing all SPDX license IDs. This class is generated by the Gradle task
* 'generateSpdxLicenseEnum'.
*/
@Suppress("EnumNaming")
enum class SpdxLicense(
/**
* The id of the license.
@@ -23,6 +23,7 @@ package com.here.ort.spdx
* An enum containing all SPDX license exception IDs. This class is generated by the Gradle task
* 'generateSpdxLicenseExceptionEnum'.
*/
@Suppress("EnumNaming")
enum class SpdxLicenseException(
/**
* The id of the license exception.
@@ -17,6 +17,8 @@
* License-Filename: LICENSE
*/

@file:Suppress("TooManyFunctions")

package com.here.ort.utils

import com.fasterxml.jackson.databind.JsonNode

0 comments on commit 97bbecc

Please sign in to comment.
You can’t perform that action at this time.