Skip to content

Commit d0ec780

Browse files
committed
fix new ktlint errors that come from our new default version of ktlint
fix syntax bug in release logic for VERSION_LATEST_RELEASE.txt
1 parent 6aa84dc commit d0ec780

File tree

14 files changed

+29
-20
lines changed

14 files changed

+29
-20
lines changed

.github/workflows/new-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
GITHUB_KEY: ${{ secrets.GITHUB_TOKEN }}
4343
run: ./plugin/gradlew -p ./plugin githubRelease --no-daemon
4444
- name: Update VERSION_LATEST_RELEASE to new published version
45-
run: cp plugin/VERSION_CURRENT.txt > plugin/VERSION_LATEST_RELEASE.txt
45+
run: cp plugin/VERSION_CURRENT.txt plugin/VERSION_LATEST_RELEASE.txt
4646
- name: Update VERSION_LATEST_RELEASE
4747
uses: stefanzweifel/git-auto-commit-action@v4
4848
with:

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- fix new ktlint errors that come from our new default version of ktlint [#651](https://github.com/JLLeitschuh/ktlint-gradle/pull/651)
13+
- fix syntax bug in release logic for VERSION_LATEST_RELEASE.txt [#651](https://github.com/JLLeitschuh/ktlint-gradle/pull/651)
14+
1015
## [11.3.1] - 2023-03-03
1116

1217
### Fixed

plugin/VERSION_LATEST_RELEASE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.1.0
1+
11.3.1

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/KtlintExtension.kt

+6
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,32 @@ internal constructor(
4646
* Enable verbose mode.
4747
*/
4848
val verbose: Property<Boolean> = objectFactory.property { set(false) }
49+
4950
/**
5051
* Enable debug mode.
5152
*/
5253
val debug: Property<Boolean> = objectFactory.property { set(false) }
54+
5355
/**
5456
* Enable android mode.
5557
*/
5658
val android: Property<Boolean> = objectFactory.property { set(false) }
59+
5760
/**
5861
* Enable console output mode.
5962
*/
6063
val outputToConsole: Property<Boolean> = objectFactory.property { set(true) }
64+
6165
/**
6266
* Enabled colored output to console.
6367
*/
6468
val coloredOutput: Property<Boolean> = objectFactory.property { set(true) }
69+
6570
/**
6671
* Specify the color of the terminal output.
6772
*/
6873
val outputColorName: Property<String> = objectFactory.property { set("") }
74+
6975
/**
7076
* Whether or not to allow the build to continue if there are warnings;
7177
* defaults to {@code false}, as for any other static code analysis tool.

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/reporter/CustomReporter.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ data class CustomReporter(
1818
val name: String,
1919
val reporterId: String = name,
2020
var fileExtension: String = reporterId,
21-
@Transient var dependency: Any? = null,
21+
@Transient var dependency: Any? = null
2222
) : Serializable {
2323
companion object {
2424
private const val serialVersionUID: Long = 2012775L

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/reporter/ReporterType.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ enum class ReporterType(
77
val reporterName: String,
88
val availableSinceVersion: SemVer,
99
val fileExtension: String,
10-
val options: List<String>,
10+
val options: List<String>
1111
) : Serializable {
1212
PLAIN("plain", SemVer(0, 9, 0), "txt", emptyList()),
1313
PLAIN_GROUP_BY_FILE("plain", SemVer(0, 9, 0), "txt", listOf("group_by_file")),

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/tasks/BaseKtLintCheckTask.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ abstract class BaseKtLintCheckTask @Inject constructor(
146146

147147
@Internal
148148
override fun getIncludes(): MutableSet<String> = patternFilterable.includes
149+
149150
@Internal
150151
override fun getExcludes(): MutableSet<String> = patternFilterable.excludes
151152

@@ -225,7 +226,7 @@ abstract class BaseKtLintCheckTask @Inject constructor(
225226

226227
private fun logTaskExecutionState(
227228
inputChanges: InputChanges,
228-
editorConfigUpdated: Boolean,
229+
editorConfigUpdated: Boolean
229230
) {
230231
logger.info("Executing ${if (inputChanges.isIncremental) "incrementally" else "non-incrementally"}")
231232
logger.info("Editorconfig files were changed: $editorConfigUpdated")

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/tasks/LoadReportersTask.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import javax.inject.Inject
2626
internal abstract class LoadReportersTask @Inject constructor(
2727
private val workerExecutor: WorkerExecutor,
2828
objectFactory: ObjectFactory,
29-
projectLayout: ProjectLayout,
29+
projectLayout: ProjectLayout
3030
) : DefaultTask() {
3131

3232
@get:Classpath

plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/worker/KtLintInvocation.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ private fun userDataToEditorConfigOverride(userData: Map<String, String>): Any {
170170
defaultEditorConfigPropertiesClass.kotlin.memberProperties.firstOrNull { it.name == "ktlintDisabledRulesProperty" }
171171
?: defaultEditorConfigPropertiesClass.kotlin.memberProperties.first { it.name == "disabledRulesProperty" }
172172
addMethod.invoke(
173-
editorConfigOverride, disabledRulesProperty.getter.call(defaultEditorConfigProperties),
173+
editorConfigOverride,
174+
disabledRulesProperty.getter.call(defaultEditorConfigProperties),
174175
userData["disabled_rules"]
175176
)
176177
}
@@ -186,7 +187,7 @@ internal class ExperimentalParamsProviderInvocation(
186187
private val editorConfigPath: String?,
187188
private val ruleProviders: Set<Any>,
188189
private val userData: Map<String, String>,
189-
private val debug: Boolean,
190+
private val debug: Boolean
190191
) : KtLintInvocation {
191192
companion object Factory : KtLintInvocationFactory {
192193
fun initialize(

plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/BuildCacheTest.kt

+4-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,10 @@ class BuildCacheTest : AbstractPluginTest() {
2525
"test",
2626
GenerateReportsTask.LintType.CHECK
2727
)
28-
2928
project(gradleVersion, projectPath = originalRoot) {
3029
configureDefaultProject()
3130

32-
build(
33-
CHECK_PARENT_TASK_NAME, "--build-cache"
34-
) {
31+
build(CHECK_PARENT_TASK_NAME, "--build-cache") {
3532
assertThat(task(":$mainSourceSetCheckTaskName")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
3633
assertThat(task(":$testSourceCheckTaskName")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
3734
}
@@ -73,7 +70,7 @@ class BuildCacheTest : AbstractPluginTest() {
7370
.appendText(
7471
//language=Groovy
7572
"""
76-
73+
7774
repositories {
7875
jcenter()
7976
}
@@ -94,7 +91,7 @@ class BuildCacheTest : AbstractPluginTest() {
9491
private fun File.addBuildCacheSettings() = appendText(
9592
//language=Groovy
9693
"""
97-
94+
9895
buildCache {
9996
local {
10097
directory = '${localBuildCache.toURI()}'
@@ -111,7 +108,7 @@ class BuildCacheTest : AbstractPluginTest() {
111108
"src/test/kotlin/Test.kt",
112109
"""
113110
class Test
114-
111+
115112
""".trimIndent()
116113
)
117114
}

plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/ConfigurationCacheTest.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class ConfigurationCacheTest : AbstractPluginTest() {
6767
build(
6868
configurationCacheFlag,
6969
configurationCacheWarnFlag,
70-
FORMAT_PARENT_TASK_NAME, "--debug"
70+
FORMAT_PARENT_TASK_NAME,
71+
"--debug"
7172
) {
7273
assertThat(task(":$formatTaskName")?.outcome).isEqualTo(TaskOutcome.UP_TO_DATE)
7374
assertThat(task(":$mainSourceSetFormatTaskName")?.outcome).isEqualTo(TaskOutcome.UP_TO_DATE)

plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/testdsl/testDsl.kt plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/testdsl/TestDsl.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private val GradleVersion.supportedKotlinVersion
147147

148148
fun projectSetup(
149149
kotlinPluginType: String,
150-
gradleVersion: GradleVersion,
150+
gradleVersion: GradleVersion
151151
): (File) -> Unit = {
152152
val kotlinPluginVersion = gradleVersion.supportedKotlinVersion
153153
//language=Groovy

plugin/src/test/kotlin/org/jlleitschuh/gradle/ktlint/worker/SerializableLintErrorTest.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ internal class SerializableLintErrorTest {
1414

1515
@Test
1616
internal fun `Should correctly serialize and deserialize LintError`() {
17-
val lintError = LintError(
18-
14, 154, "test-rule", "details about error", false
19-
)
17+
val lintError = LintError(14, 154, "test-rule", "details about error", false)
2018
val wrappedLintError = SerializableLintError(lintError)
2119
val serializeIntoFile = temporaryFolder.resolve("lintError.test")
2220

0 commit comments

Comments
 (0)