Skip to content

Commit bc3815c

Browse files
committed
Revert "chore: Re-enable Detekt except in CI"
This reverts commit 533262d.
1 parent 533262d commit bc3815c

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

buildSrc/src/main/groovy/au.com.dius.pact.kotlin-common-conventions.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ plugins {
33
id 'org.jetbrains.kotlin.jvm'
44

55
id 'groovy'
6-
// TODO: Detekt does not support JDK 23 yet
7-
id "io.gitlab.arturbosch.detekt" apply false
6+
// id "io.gitlab.arturbosch.detekt" TODO: Detekt does not support JDK 23 yet
87
id 'codenarc'
98
}
109

@@ -113,8 +112,6 @@ codenarcTest {
113112
}
114113

115114
// TODO: Detekt does not support JDK 23 yet
116-
if (System.getenv('CI') == null) {
117-
detekt {
118-
config = files(rootProject.file("config/detekt-config.yml"))
119-
}
120-
}
115+
//detekt {
116+
// config = files(rootProject.file("config/detekt-config.yml"))
117+
//}

core/model/src/main/kotlin/au/com/dius/pact/core/model/matchingrules/MatchingRuleCategory.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package au.com.dius.pact.core.model.matchingrules
22

3-
import au.com.dius.pact.core.model.PactSpecVersion
4-
import au.com.dius.pact.core.model.PathToken
5-
import au.com.dius.pact.core.model.atLeast
3+
import au.com.dius.pact.core.model.*
64
import au.com.dius.pact.core.model.generators.Generator
75
import au.com.dius.pact.core.support.json.JsonValue
8-
import io.github.oshai.kotlinlogging.KotlinLogging
6+
import io.github.oshai.kotlinlogging.KLogging
7+
import java.util.Comparator
98
import java.util.function.Predicate
109

11-
private val logger = KotlinLogging.logger {}
12-
1310
/**
1411
* Matching rules category
1512
*/
1613
data class MatchingRuleCategory @JvmOverloads constructor(
1714
val name: String,
1815
var matchingRules: MutableMap<String, MatchingRuleGroup> = mutableMapOf()
1916
) {
17+
18+
companion object : KLogging()
19+
2020
/**
2121
* Add a rule by key to the given category
2222
*/

core/model/src/main/kotlin/au/com/dius/pact/core/model/matchingrules/MatchingRules.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ import au.com.dius.pact.core.support.Either
1414
import au.com.dius.pact.core.support.Json
1515
import au.com.dius.pact.core.support.json.JsonValue
1616
import au.com.dius.pact.core.support.json.map
17-
import io.github.oshai.kotlinlogging.KotlinLogging
17+
import io.github.oshai.kotlinlogging.KLogging
1818
import java.lang.RuntimeException
1919

20-
private val logger = KotlinLogging.logger {}
21-
2220
/**
2321
* Logic to use to combine rules
2422
*/
@@ -65,7 +63,7 @@ interface MatchingRule {
6563
*/
6664
val attributes: Map<String, JsonValue>
6765

68-
companion object {
66+
companion object : KLogging() {
6967
private const val MATCH = "match"
7068
private const val MIN = "min"
7169
private const val MAX = "max"
@@ -87,12 +85,12 @@ interface MatchingRule {
8785
j.has(TIME) -> TimeMatcher(j[TIME].asString()!!)
8886
j.has(DATE) -> DateMatcher(j[DATE].asString()!!)
8987
else -> {
90-
logger.warn { "Unrecognised matcher definition $j, defaulting to equality matching" }
88+
MatchingRuleGroup.logger.warn { "Unrecognised matcher definition $j, defaulting to equality matching" }
9189
EqualsMatcher
9290
}
9391
}
9492
} else {
95-
logger.warn { "Unrecognised matcher definition $json, defaulting to equality matching" }
93+
MatchingRuleGroup.logger.warn { "Unrecognised matcher definition $json, defaulting to equality matching" }
9694
EqualsMatcher
9795
}
9896
}
@@ -110,7 +108,7 @@ interface MatchingRule {
110108
"integer" -> NumberTypeMatcher(NumberTypeMatcher.NumberType.INTEGER)
111109
"decimal" -> NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL)
112110
"real" -> {
113-
logger.warn { "The 'real' type matcher is deprecated, use 'decimal' instead" }
111+
MatchingRuleGroup.logger.warn { "The 'real' type matcher is deprecated, use 'decimal' instead" }
114112
NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL)
115113
}
116114
MIN -> MinTypeMatcher(values[MIN].asNumber()!!.toInt())
@@ -196,7 +194,7 @@ interface MatchingRule {
196194
EachValueMatcher(definition)
197195
}
198196
else -> {
199-
logger.warn { "Unrecognised matcher ${values[MATCH]}, defaulting to equality matching" }
197+
MatchingRuleGroup.logger.warn { "Unrecognised matcher ${values[MATCH]}, defaulting to equality matching" }
200198
EqualsMatcher
201199
}
202200
}
@@ -678,7 +676,7 @@ data class MatchingRuleGroup @JvmOverloads constructor(
678676
return rules.any { matchers.contains(it.javaClass) }
679677
}
680678

681-
companion object {
679+
companion object : KLogging() {
682680
@JvmStatic
683681
fun fromJson(json: JsonValue): MatchingRuleGroup {
684682
var ruleLogic = RuleLogic.AND
@@ -693,7 +691,7 @@ data class MatchingRuleGroup @JvmOverloads constructor(
693691
ruleLogic = RuleLogic.valueOf(value)
694692
}
695693
} catch (e: IllegalArgumentException) {
696-
logger.warn { "${groupJson["combine"]} is not a valid matcher rule logic value: ${e.message}" }
694+
logger.warn { "${groupJson["combine"]} is not a valid matcher rule logic value" }
697695
}
698696
}
699697

core/model/src/main/kotlin/au/com/dius/pact/core/model/messaging/Message.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ class Message @JvmOverloads constructor(
169169
}
170170
}
171171

172-
@Suppress("SwallowedException")
173172
private fun tryParseKafkaSchemaRegistryMagicBytes(): String {
174173
return try {
175174
parseKafkaSchemaRegistryMagicBytes()

0 commit comments

Comments
 (0)