From e39010d06763597fea35f551896b0683b232c703 Mon Sep 17 00:00:00 2001 From: Igor Wojda Date: Sun, 25 Sep 2022 18:13:39 +0200 Subject: [PATCH 01/13] Update docs - mention the `detekt-formatting` default rules and a way to disable/enable them (#5345) Co-authored-by: schalkms <30376729+schalkms@users.noreply.github.com> --- website/versioned_docs/version-1.21.0/rules/formatting.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/versioned_docs/version-1.21.0/rules/formatting.md b/website/versioned_docs/version-1.21.0/rules/formatting.md index 4018ddb9cd9..74f1dd12966 100644 --- a/website/versioned_docs/version-1.21.0/rules/formatting.md +++ b/website/versioned_docs/version-1.21.0/rules/formatting.md @@ -9,12 +9,17 @@ folder: documentation This rule set provides wrappers for rules implemented by ktlint - https://ktlint.github.io/. Note: Issues reported by this rule set can only be suppressed on file level (`@file:Suppress("detekt.rule")`). -Note: The formatting rule set is not included in the detekt-cli or gradle plugin. +Note: The formatting rule set is not included by default in the detekt-cli or gradle plugin. To enable this rule set, add `detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$version"` to your gradle dependencies or reference the `detekt-formatting`-jar with the `--plugins` option in the command line interface. +See the [config.yml](https://github.com/detekt/detekt/blob/main/detekt-formatting/src/main/resources/config/config.yml) +file for all `detekt-formatting` configuration options and their default values. + +To enable\disable a rule add the `formatting:` section (from the above config file) to your custom detekt config file. + ### AnnotationOnSeparateLine See [ktlint-readme](https://github.com/pinterest/ktlint#standard-rules) for documentation. From 2db2098f460e5f926c104c1b287fb94237e4c245 Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Sun, 25 Sep 2022 21:18:00 +0200 Subject: [PATCH 02/13] Convert previously known string property to list based on default value (#5347) * Convert previously known string property to list based on default value - #5323 * Improve test name --- .../gitlab/arturbosch/detekt/api/SplitPattern.kt | 2 +- .../arturbosch/detekt/cli/runners/RunnerSpec.kt | 16 ++++++++++++++++ .../return-count-with-string-property.yml | 4 ++++ .../arturbosch/detekt/core/config/BaseConfig.kt | 2 ++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 detekt-cli/src/test/resources/configs/return-count-with-string-property.yml diff --git a/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/SplitPattern.kt b/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/SplitPattern.kt index e76bf39d35f..afb0e8440cc 100644 --- a/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/SplitPattern.kt +++ b/detekt-api/src/main/kotlin/io/gitlab/arturbosch/detekt/api/SplitPattern.kt @@ -57,7 +57,7 @@ open class SplitPattern( } /** - * Splits given String into a sequence of strings splited by the provided delimiters ("," by default). + * Splits given String into a sequence of strings split by the provided delimiters ("," by default). * * It also trims the strings and removes the empty ones */ diff --git a/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/RunnerSpec.kt b/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/RunnerSpec.kt index 2bacf7242ec..7376c3ebacf 100644 --- a/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/RunnerSpec.kt +++ b/detekt-cli/src/test/kotlin/io/gitlab/arturbosch/detekt/cli/runners/RunnerSpec.kt @@ -13,6 +13,7 @@ import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Nested import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertDoesNotThrow import java.nio.file.Files import java.nio.file.Path @@ -299,4 +300,19 @@ class RunnerSpec { executeDetekt("--input", inputPath.toString(), "--max-issues", "2") } } + + @Test + fun `does not fail on rule property type change from comma separated string to list when YamlConfig is wrapped`() { + assertDoesNotThrow { + executeDetekt( + "--all-rules", // wrapping config + "--input", + inputPath.toString(), + "--config-resource", + "configs/return-count-with-string-property.yml", + "--max-issues", + "-1" + ) + } + } } diff --git a/detekt-cli/src/test/resources/configs/return-count-with-string-property.yml b/detekt-cli/src/test/resources/configs/return-count-with-string-property.yml new file mode 100644 index 00000000000..32a173856c5 --- /dev/null +++ b/detekt-cli/src/test/resources/configs/return-count-with-string-property.yml @@ -0,0 +1,4 @@ +style: + ReturnCount: + active: true + excludedFunctions: 'test' diff --git a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt index 19e6ab850e3..4c1b2407a2e 100644 --- a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt +++ b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/config/BaseConfig.kt @@ -2,6 +2,7 @@ package io.gitlab.arturbosch.detekt.core.config import io.gitlab.arturbosch.detekt.api.Config import io.gitlab.arturbosch.detekt.api.Config.Companion.CONFIG_SEPARATOR +import io.gitlab.arturbosch.detekt.api.commaSeparatedPattern private val ALLOWED_BOOL_VALUES = setOf("true", "false") @@ -48,5 +49,6 @@ fun tryParseBasedOnDefault(result: String, defaultResult: Any): Any = when (defa } is Double -> result.toDouble() is String -> result + is List<*> -> result.commaSeparatedPattern().toList() else -> throw ClassCastException() } From 7b73606ede75b2a9066ec57006e4c6273e4c4391 Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Sun, 25 Sep 2022 21:20:01 +0200 Subject: [PATCH 03/13] Report CastToNullableType at the cast operator instead of the whole expression (#5350) Closes #5346 --- .../gitlab/arturbosch/detekt/rules/bugs/CastToNullableType.kt | 2 +- .../arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableType.kt b/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableType.kt index 2e9c3231441..76f77fb282f 100644 --- a/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableType.kt +++ b/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableType.kt @@ -47,6 +47,6 @@ class CastToNullableType(config: Config = Config.empty) : Rule(config) { val message = "Use the safe cast ('as? ${nullableTypeElement.innerType?.text}')" + " instead of 'as ${nullableTypeElement.text}'." - report(CodeSmell(issue, Entity.from(expression), message)) + report(CodeSmell(issue, Entity.from(operationReference), message)) } } diff --git a/detekt-rules-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt b/detekt-rules-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt index 02e832c6b45..b112884f9e3 100644 --- a/detekt-rules-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt +++ b/detekt-rules-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt @@ -16,7 +16,7 @@ class CastToNullableTypeSpec { """.trimIndent() val findings = subject.compileAndLint(code) assertThat(findings).hasSize(1) - assertThat(findings).hasStartSourceLocation(2, 22) + assertThat(findings).hasStartSourceLocation(2, 24) assertThat(findings[0]).hasMessage("Use the safe cast ('as? String') instead of 'as String?'.") } From 121b0d883f3dbe0d4bc684c1f4cf36b8d0b217a0 Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Sun, 25 Sep 2022 21:20:40 +0200 Subject: [PATCH 04/13] Report LabeledExpression as the label instead of the whole expression (#5351) Closes #5316 --- .../detekt/rules/complexity/LabeledExpression.kt | 8 ++++---- .../detekt/rules/complexity/LabeledExpressionSpec.kt | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/detekt-rules-complexity/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpression.kt b/detekt-rules-complexity/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpression.kt index 85e16753bd0..83a8aedaa38 100644 --- a/detekt-rules-complexity/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpression.kt +++ b/detekt-rules-complexity/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpression.kt @@ -76,10 +76,10 @@ class LabeledExpression(config: Config = Config.empty) : Rule(config) { override fun visitExpressionWithLabel(expression: KtExpressionWithLabel) { super.visitExpressionWithLabel(expression) if (expression !is KtThisExpression || isNotReferencingOuterClass(expression)) { - expression.getLabelName()?.let { labelName -> - if (ignoredLabels.none { labelName.contains(it, ignoreCase = true) }) { - report(CodeSmell(issue, Entity.from(expression), issue.description)) - } + val label = expression.getTargetLabel() + val labelName = label?.getReferencedName() + if (labelName != null && ignoredLabels.none { labelName.contains(it, ignoreCase = true) }) { + report(CodeSmell(issue, Entity.from(label), issue.description)) } } } diff --git a/detekt-rules-complexity/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpressionSpec.kt b/detekt-rules-complexity/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpressionSpec.kt index 9bfb957cca2..7a13a6ab792 100644 --- a/detekt-rules-complexity/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpressionSpec.kt +++ b/detekt-rules-complexity/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/complexity/LabeledExpressionSpec.kt @@ -1,8 +1,8 @@ package io.gitlab.arturbosch.detekt.rules.complexity import io.gitlab.arturbosch.detekt.test.TestConfig +import io.gitlab.arturbosch.detekt.test.assertThat import io.gitlab.arturbosch.detekt.test.compileAndLint -import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test class LabeledExpressionSpec { @@ -34,7 +34,11 @@ class LabeledExpressionSpec { } } """.trimIndent() - assertThat(subject.compileAndLint(code)).hasSize(1) + + val findings = subject.compileAndLint(code) + + assertThat(findings).hasSize(1) + assertThat(findings).hasStartSourceLocation(3, 28) } @Test From bb0f6cdeef1bd5e8c10991eb62a7d9f23881936d Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Sun, 25 Sep 2022 21:21:09 +0200 Subject: [PATCH 05/13] Report UseDataClass findings on class name (#5352) Closes #5338 --- .../gitlab/arturbosch/detekt/rules/style/UseDataClass.kt | 2 +- .../arturbosch/detekt/rules/style/UseDataClassSpec.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClass.kt b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClass.kt index 0a61812d6f2..defda0c037c 100644 --- a/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClass.kt +++ b/detekt-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClass.kt @@ -102,7 +102,7 @@ class UseDataClass(config: Config = Config.empty) : Rule(config) { report( CodeSmell( issue, - Entity.from(klass), + Entity.from(klass.nameIdentifier ?: klass), "The class ${klass.nameAsSafeName} defines no " + "functionality and only holds data. Consider converting it to a data class." ) diff --git a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClassSpec.kt b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClassSpec.kt index 4547d276cd9..59b01105e29 100644 --- a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClassSpec.kt +++ b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UseDataClassSpec.kt @@ -153,11 +153,16 @@ class UseDataClassSpec(val env: KotlinCoreEnvironment) { inner class `does report data class candidates` { @Test - fun `does report a data class candidate`() { + fun `does report a data class candidate on the class name`() { val code = """ class DataClassCandidate1(val i: Int) """.trimIndent() - assertThat(subject.compileAndLint(code)).hasSize(1) + + val findings = subject.compileAndLint(code) + + assertThat(findings).hasSize(1) + assertThat(findings).hasStartSourceLocation(1, 7) + assertThat(findings).hasEndSourceLocation(1, 26) } @Test From dbc89c02abb94e5213f3e6abfc9d661b1d962eb5 Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Mon, 26 Sep 2022 09:40:57 +0200 Subject: [PATCH 06/13] Change requires type resolution rule warning to debug level to not spam the user console (#5353) --- .../kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt | 8 ++++---- .../arturbosch/detekt/core/ProcessingSettingsFactory.kt | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt index 44cc294f5bd..c6dac59e708 100644 --- a/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt +++ b/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt @@ -43,7 +43,6 @@ internal class Analyzer( ): Map> { val languageVersionSettings = settings.environment.configuration.languageVersionSettings - @Suppress("DEPRECATION") val dataFlowValueFactory = DataFlowValueFactoryImpl(languageVersionSettings) val compilerResources = CompilerResources(languageVersionSettings, dataFlowValueFactory) val findingsPerFile: FindingsResult = @@ -52,8 +51,9 @@ internal class Analyzer( } else { runSync(ktFiles, bindingContext, compilerResources) } + if (bindingContext == BindingContext.EMPTY) { - warnAboutEnabledRequiresTypeResolutionRules(settings::info) + warnAboutEnabledRequiresTypeResolutionRules() } val findingsPerRuleSet = HashMap>() @@ -144,7 +144,7 @@ internal class Analyzer( return result } - private fun warnAboutEnabledRequiresTypeResolutionRules(log: (String) -> Unit) { + private fun warnAboutEnabledRequiresTypeResolutionRules() { providers.asSequence() .map { it to config.subConfig(it.ruleSetId) } .filter { (_, ruleSetConfig) -> ruleSetConfig.isActive() } @@ -153,7 +153,7 @@ internal class Analyzer( .filter { rule -> (rule as? Rule)?.active == true } .filter { rule -> rule::class.hasAnnotation() } .forEach { rule -> - log("The rule '${rule.ruleId}' requires type resolution but it was run without it.") + settings.debug { "The rule '${rule.ruleId}' requires type resolution but it was run without it." } } } } diff --git a/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/ProcessingSettingsFactory.kt b/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/ProcessingSettingsFactory.kt index 5a9cf1d80f5..3671c3f406d 100644 --- a/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/ProcessingSettingsFactory.kt +++ b/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/ProcessingSettingsFactory.kt @@ -27,6 +27,7 @@ fun createProcessingSettings( inputPaths = listOfNotNull(inputPath) } logging { + debug = true this.outputChannel = outputChannel errorChannel = NullPrintStream() } From 9d99f4220fb4b30a85619f12c3b601cffa46c168 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 07:49:48 +1000 Subject: [PATCH 07/13] Update dependency org.yaml:snakeyaml to v1.33 (#5354) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b03c5f25b1a..a80330ad1b2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -37,7 +37,7 @@ sarif4k = "io.github.detekt.sarif4k:sarif4k:0.0.1" assertj = "org.assertj:assertj-core:3.23.1" reflections = "org.reflections:reflections:0.10.2" mockk = "io.mockk:mockk:1.13.1" -snakeyaml = "org.yaml:snakeyaml:1.32" +snakeyaml = "org.yaml:snakeyaml:1.33" jcommander = "com.beust:jcommander:1.82" contester-breakpoint = { module = "io.github.davidburstrom.contester:contester-breakpoint", version.ref = "contester" } contester-driver = { module = "io.github.davidburstrom.contester:contester-driver", version.ref = "contester" } From 54968a8f7fe292b7ad8dbd1126d26e44eebc8337 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 22:19:02 +1000 Subject: [PATCH 08/13] Update actions/setup-java digest to a18c333 (#5356) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codecoverage.yaml | 2 +- .github/workflows/deploy-snapshot.yaml | 2 +- .github/workflows/detekt-with-type-resolution.yaml | 4 ++-- .github/workflows/pre-merge.yaml | 8 ++++---- .github/workflows/website.yaml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codecoverage.yaml b/.github/workflows/codecoverage.yaml index 597087ca09f..fde9102bb4f 100644 --- a/.github/workflows/codecoverage.yaml +++ b/.github/workflows/codecoverage.yaml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' diff --git a/.github/workflows/deploy-snapshot.yaml b/.github/workflows/deploy-snapshot.yaml index 8bb770b1687..e92b2072573 100644 --- a/.github/workflows/deploy-snapshot.yaml +++ b/.github/workflows/deploy-snapshot.yaml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' diff --git a/.github/workflows/detekt-with-type-resolution.yaml b/.github/workflows/detekt-with-type-resolution.yaml index 5c0d2eaacf3..19488bc760d 100644 --- a/.github/workflows/detekt-with-type-resolution.yaml +++ b/.github/workflows/detekt-with-type-resolution.yaml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index b21c325095f..1778d7b5963 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -32,7 +32,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: ${{ matrix.jdk }} distribution: 'temurin' @@ -65,7 +65,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' @@ -81,7 +81,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' @@ -97,7 +97,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 012b8fd3aa7..455e5eadc4f 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Java - uses: actions/setup-java@d854b6da19cdadd9a010605529e522c2393ebd38 # tag=v3 + uses: actions/setup-java@a18c333f3f14249953dab3e186e5e21bf3390f1d # tag=v3 with: java-version: 17 distribution: 'temurin' From 59bedc9eeda131b404dda44330e5cf4645e81fa1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:13:54 +1000 Subject: [PATCH 09/13] Update dependency io.mockk:mockk to v1.13.2 (#5361) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a80330ad1b2..1f958dedfe9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -36,7 +36,7 @@ junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "jun sarif4k = "io.github.detekt.sarif4k:sarif4k:0.0.1" assertj = "org.assertj:assertj-core:3.23.1" reflections = "org.reflections:reflections:0.10.2" -mockk = "io.mockk:mockk:1.13.1" +mockk = "io.mockk:mockk:1.13.2" snakeyaml = "org.yaml:snakeyaml:1.33" jcommander = "com.beust:jcommander:1.82" contester-breakpoint = { module = "io.github.davidburstrom.contester:contester-breakpoint", version.ref = "contester" } From 753fec9d7212499bb32148fddf70f4d9404e99d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 08:02:51 +1000 Subject: [PATCH 10/13] Update gradle/gradle-build-action digest to fd32ae9 (#5364) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/codecoverage.yaml | 2 +- .github/workflows/deploy-snapshot.yaml | 4 ++-- .github/workflows/detekt-with-type-resolution.yaml | 4 ++-- .github/workflows/pre-merge.yaml | 14 +++++++------- .github/workflows/website.yaml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/codecoverage.yaml b/.github/workflows/codecoverage.yaml index fde9102bb4f..09a0967589d 100644 --- a/.github/workflows/codecoverage.yaml +++ b/.github/workflows/codecoverage.yaml @@ -29,7 +29,7 @@ jobs: distribution: 'temurin' - name: Generate Coverage Report - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: jacocoMergedReport diff --git a/.github/workflows/deploy-snapshot.yaml b/.github/workflows/deploy-snapshot.yaml index e92b2072573..ca2c3df1f5c 100644 --- a/.github/workflows/deploy-snapshot.yaml +++ b/.github/workflows/deploy-snapshot.yaml @@ -26,12 +26,12 @@ jobs: distribution: 'temurin' - name: Build detekt - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: build - name: Deploy Snapshot - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 env: ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }} ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }} diff --git a/.github/workflows/detekt-with-type-resolution.yaml b/.github/workflows/detekt-with-type-resolution.yaml index 19488bc760d..b83b7b0b322 100644 --- a/.github/workflows/detekt-with-type-resolution.yaml +++ b/.github/workflows/detekt-with-type-resolution.yaml @@ -34,7 +34,7 @@ jobs: distribution: 'temurin' - name: Run detekt-cli with argsfile - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: :detekt-cli:runWithArgsFile @@ -58,6 +58,6 @@ jobs: java-version: 17 distribution: 'temurin' - name: Run analysis - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: detektMain detektTest diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index 1778d7b5963..8b13e0da9f9 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -37,7 +37,7 @@ jobs: java-version: ${{ matrix.jdk }} distribution: 'temurin' - name: Build detekt - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: build -x detekt - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3 @@ -46,15 +46,15 @@ jobs: path: '**.hprof' if-no-files-found: ignore - name: Run detekt-cli --help - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: :detekt-cli:runWithHelpFlag - name: Run detekt-cli with argsfile - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: :detekt-cli:runWithArgsFile - name: Try to publish to Maven Local - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: publishToMavenLocal @@ -70,7 +70,7 @@ jobs: java-version: 17 distribution: 'temurin' - name: Verify Generated Detekt Config File - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: verifyGeneratorOutput @@ -86,7 +86,7 @@ jobs: java-version: 17 distribution: 'temurin' - name: Build and compile test snippets - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: test -Pcompile-test-snippets=true @@ -102,6 +102,6 @@ jobs: java-version: 17 distribution: 'temurin' - name: Run with allWarningsAsErrors - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: build -x detekt -PwarningsAsErrors=true diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 455e5eadc4f..3727521cb36 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -36,7 +36,7 @@ jobs: cache-dependency-path: 'website/yarn.lock' - name: Build Detekt Documentation - uses: gradle/gradle-build-action@c295a4096e1d2c453eaf1f65c6f96686e26bd8be # tag=v2 + uses: gradle/gradle-build-action@fd32ae908111fe31afa48827bd1ee909540aa971 # tag=v2 with: arguments: :detekt-generator:generateDocumentation From ab1807c158b7ea60990de0b045bf16c0ba400fbd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 01:55:59 +0100 Subject: [PATCH 11/13] Update github/codeql-action digest to e0e5ded (#5329) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/detekt-with-type-resolution.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detekt-with-type-resolution.yaml b/.github/workflows/detekt-with-type-resolution.yaml index b83b7b0b322..83c0867b035 100644 --- a/.github/workflows/detekt-with-type-resolution.yaml +++ b/.github/workflows/detekt-with-type-resolution.yaml @@ -39,7 +39,7 @@ jobs: arguments: :detekt-cli:runWithArgsFile - name: Upload SARIF to Github using the upload-sarif action - uses: github/codeql-action/upload-sarif@904260d7d935dff982205cbdb42025ce30b7a34f # tag=v2 + uses: github/codeql-action/upload-sarif@e0e5ded33cabb451ae0a9768fc7b0410bad9ad44 # tag=v2 if: ${{ always() }} with: sarif_file: build/detekt-report.sarif From 265109a2ed0b43fa55c2dcf19f819b6bc1355bdf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 01:56:31 +0100 Subject: [PATCH 12/13] Update kotlin to v1.7.20 (#5363) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1f958dedfe9..98c71bbd804 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] dokka = "1.7.10" jacoco = "0.8.8" -kotlin = "1.7.10" +kotlin = "1.7.20" ktlint = "0.46.1" junit = "5.9.1" contester = "0.2.0" From 522994af3e4c63ae7bd701c5666eb38003c29db8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 02:02:21 +0100 Subject: [PATCH 13/13] Update actions/setup-node digest to 969bd26 (#5359) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/danger.yaml | 2 +- .github/workflows/website.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/danger.yaml b/.github/workflows/danger.yaml index f216d7a228e..79029a72339 100644 --- a/.github/workflows/danger.yaml +++ b/.github/workflows/danger.yaml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - name: Setup Node - uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 with: node-version: "16" cache: "yarn" diff --git a/.github/workflows/website.yaml b/.github/workflows/website.yaml index 3727521cb36..b3b242bdb7a 100644 --- a/.github/workflows/website.yaml +++ b/.github/workflows/website.yaml @@ -29,7 +29,7 @@ jobs: distribution: 'temurin' - name: Setup Node - uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 # tag=v3 + uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 with: node-version: '16' cache: 'yarn'