Skip to content

Commit

Permalink
fix new ktlint errors that come from our new default version of ktlint (
Browse files Browse the repository at this point in the history
#651)

fix syntax bug in release logic for VERSION_LATEST_RELEASE.txt
  • Loading branch information
wakingrufus authored Mar 3, 2023
1 parent 6aa84dc commit 8338219
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
GITHUB_KEY: ${{ secrets.GITHUB_TOKEN }}
run: ./plugin/gradlew -p ./plugin githubRelease --no-daemon
- name: Update VERSION_LATEST_RELEASE to new published version
run: cp plugin/VERSION_CURRENT.txt > plugin/VERSION_LATEST_RELEASE.txt
run: cp plugin/VERSION_CURRENT.txt plugin/VERSION_LATEST_RELEASE.txt
- name: Update VERSION_LATEST_RELEASE
uses: stefanzweifel/git-auto-commit-action@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Fixed

- fix new ktlint errors that come from our new default version of ktlint [#651](https://github.com/JLLeitschuh/ktlint-gradle/pull/651)
- fix syntax bug in release logic for VERSION_LATEST_RELEASE.txt [#651](https://github.com/JLLeitschuh/ktlint-gradle/pull/651)

## [11.3.1] - 2023-03-03

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion plugin/VERSION_LATEST_RELEASE.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.1.0
11.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,32 @@ internal constructor(
* Enable verbose mode.
*/
val verbose: Property<Boolean> = objectFactory.property { set(false) }

/**
* Enable debug mode.
*/
val debug: Property<Boolean> = objectFactory.property { set(false) }

/**
* Enable android mode.
*/
val android: Property<Boolean> = objectFactory.property { set(false) }

/**
* Enable console output mode.
*/
val outputToConsole: Property<Boolean> = objectFactory.property { set(true) }

/**
* Enabled colored output to console.
*/
val coloredOutput: Property<Boolean> = objectFactory.property { set(true) }

/**
* Specify the color of the terminal output.
*/
val outputColorName: Property<String> = objectFactory.property { set("") }

/**
* Whether or not to allow the build to continue if there are warnings;
* defaults to {@code false}, as for any other static code analysis tool.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data class CustomReporter(
val name: String,
val reporterId: String = name,
var fileExtension: String = reporterId,
@Transient var dependency: Any? = null,
@Transient var dependency: Any? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 2012775L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum class ReporterType(
val reporterName: String,
val availableSinceVersion: SemVer,
val fileExtension: String,
val options: List<String>,
val options: List<String>
) : Serializable {
PLAIN("plain", SemVer(0, 9, 0), "txt", emptyList()),
PLAIN_GROUP_BY_FILE("plain", SemVer(0, 9, 0), "txt", listOf("group_by_file")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ abstract class BaseKtLintCheckTask @Inject constructor(

@Internal
override fun getIncludes(): MutableSet<String> = patternFilterable.includes

@Internal
override fun getExcludes(): MutableSet<String> = patternFilterable.excludes

Expand Down Expand Up @@ -225,7 +226,7 @@ abstract class BaseKtLintCheckTask @Inject constructor(

private fun logTaskExecutionState(
inputChanges: InputChanges,
editorConfigUpdated: Boolean,
editorConfigUpdated: Boolean
) {
logger.info("Executing ${if (inputChanges.isIncremental) "incrementally" else "non-incrementally"}")
logger.info("Editorconfig files were changed: $editorConfigUpdated")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import javax.inject.Inject
internal abstract class LoadReportersTask @Inject constructor(
private val workerExecutor: WorkerExecutor,
objectFactory: ObjectFactory,
projectLayout: ProjectLayout,
projectLayout: ProjectLayout
) : DefaultTask() {

@get:Classpath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ private fun userDataToEditorConfigOverride(userData: Map<String, String>): Any {
defaultEditorConfigPropertiesClass.kotlin.memberProperties.firstOrNull { it.name == "ktlintDisabledRulesProperty" }
?: defaultEditorConfigPropertiesClass.kotlin.memberProperties.first { it.name == "disabledRulesProperty" }
addMethod.invoke(
editorConfigOverride, disabledRulesProperty.getter.call(defaultEditorConfigProperties),
editorConfigOverride,
disabledRulesProperty.getter.call(defaultEditorConfigProperties),
userData["disabled_rules"]
)
}
Expand All @@ -186,7 +187,7 @@ internal class ExperimentalParamsProviderInvocation(
private val editorConfigPath: String?,
private val ruleProviders: Set<Any>,
private val userData: Map<String, String>,
private val debug: Boolean,
private val debug: Boolean
) : KtLintInvocation {
companion object Factory : KtLintInvocationFactory {
fun initialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ class BuildCacheTest : AbstractPluginTest() {
"test",
GenerateReportsTask.LintType.CHECK
)

project(gradleVersion, projectPath = originalRoot) {
configureDefaultProject()

build(
CHECK_PARENT_TASK_NAME, "--build-cache"
) {
build(CHECK_PARENT_TASK_NAME, "--build-cache") {
assertThat(task(":$mainSourceSetCheckTaskName")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
assertThat(task(":$testSourceCheckTaskName")?.outcome).isEqualTo(TaskOutcome.SUCCESS)
}
Expand Down Expand Up @@ -73,7 +70,7 @@ class BuildCacheTest : AbstractPluginTest() {
.appendText(
//language=Groovy
"""
repositories {
jcenter()
}
Expand All @@ -94,7 +91,7 @@ class BuildCacheTest : AbstractPluginTest() {
private fun File.addBuildCacheSettings() = appendText(
//language=Groovy
"""
buildCache {
local {
directory = '${localBuildCache.toURI()}'
Expand All @@ -111,7 +108,7 @@ class BuildCacheTest : AbstractPluginTest() {
"src/test/kotlin/Test.kt",
"""
class Test
""".trimIndent()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ConfigurationCacheTest : AbstractPluginTest() {
build(
configurationCacheFlag,
configurationCacheWarnFlag,
FORMAT_PARENT_TASK_NAME, "--debug"
FORMAT_PARENT_TASK_NAME,
"--debug"
) {
assertThat(task(":$formatTaskName")?.outcome).isEqualTo(TaskOutcome.UP_TO_DATE)
assertThat(task(":$mainSourceSetFormatTaskName")?.outcome).isEqualTo(TaskOutcome.UP_TO_DATE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ private val GradleVersion.supportedKotlinVersion

fun projectSetup(
kotlinPluginType: String,
gradleVersion: GradleVersion,
gradleVersion: GradleVersion
): (File) -> Unit = {
val kotlinPluginVersion = gradleVersion.supportedKotlinVersion
//language=Groovy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ internal class SerializableLintErrorTest {

@Test
internal fun `Should correctly serialize and deserialize LintError`() {
val lintError = LintError(
14, 154, "test-rule", "details about error", false
)
val lintError = LintError(14, 154, "test-rule", "details about error", false)
val wrappedLintError = SerializableLintError(lintError)
val serializeIntoFile = temporaryFolder.resolve("lintError.test")

Expand Down

0 comments on commit 8338219

Please sign in to comment.