Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Using editorConfigOverride in kotlinGradle ktlint removes its default values, changing behavior

オープン
#2,226 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
kotlin
領域
build-system

調査の方向性

まず、空でない editorConfigOverride map を使った Gradle Kotlin DSL の例を再現し、空の map の場合と比較します。次に、editorConfigOverride のエントリポイントと、存在する場合は既存の ktlint 設定テストを追跡します。override に無関係なキーが含まれている場合でも、no-consecutive-comments を含むデフォルトの ktlint の動作が引き続き適用されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug-unconfirmed

When you use editorConfigOverride with map that has at least 1 entry, for example with arbitrary key that doesn't exist:

spotless {
    kotlinGradle {
        target("*.gradle.kts")
        ktlint("1.3.1").editorConfigOverride(
            mapOf(
                "abc" to "abc",
            ),
        )
    }
}

the default behavior changes. For example, when I fail the no-consecutive-comments rule by having this in build.gradle.kts:

/** Deps */
// Dep1

after adding the map with 1 element, ./gradlew spotlessApply will no longer display the error, and will successfully format the file.

> Task :spotlessApply

BUILD SUCCESSFUL in 220ms
6 actionable tasks: 3 executed, 3 up-to-date
15:25:53: Execution finished 'spotlessApply'.

With empty map, it finishes with error:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':spotlessKotlinGradle'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
...
Caused by: java.lang.AssertionError: Error on line: 20, column: 5
rule: standard:no-consecutive-comments
an EOL comment may not be preceded by a KDoc. Reversed order is allowed though when separated by a newline.
        at com.diffplug.spotless.glue.ktlint.compat.KtLintCompatReporting.report(KtLintCompatReporting.java:23)
        at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat1Dot0Dot0Adapter$FormatterCallback.invoke(KtLintCompat1Dot0Dot0Adapter.java:77)
        at com.diffplug.spotless.glue.ktlint.compat.KtLintCompat1Dot0Dot0Adapter$FormatterCallback.invoke(KtLintCompat1Dot0Dot0Adapter.java:72)
        at com.pinterest.ktlint.rule.engine.internal.CodeFormatter.format(CodeFormatter.kt:31)
        at com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine.format(KtLintRuleEngine.kt:116)
...

Versions:
Gradle 8.9
id("com.diffplug.spotless") version "7.0.0.BETA1"
Windows 10

主要言語
Java
スター
5.7k
フォーク
560
平均マージ
1日 13時間
マージ済み PR(30日)
43

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

diffplug/spotless のほかの issue

diffplug/spotless の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。