Diff formatting shows weird whitespace characters on Windows 10 (� and ╖ instead of ·)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- build-system, tooling
調査の方向性
まず、Windows 10 上で示されている Spotless 5.5.1 構成を使って gradlew spotlessCheck を再現し、そのコンソール出力を macOS と比較します。Kotlin が使用する差分フォーマットのエントリーポイントを追跡します。完了条件は、Windows Command Prompt と IDE コンソールで空白マーカーが一貫して · として表示されることです。
索引モデルが issue の本文から書いたものです。
説明
Summary of problem
When outputting the details of what lines have format violations, the · characters representing whitespace are not rendering correctly in the Command Prompt, Android Studio & Intellij's console output on Windows 10. I tried the same project with the same IDEs and Gradle files on Mac OS Catalina and don't see the issue.
I use defaults fonts on Windows and in the IDEs. I tried other monospaced fonts and character encoding thinking it's something on my end. Didn't seem to have any effect. I'm suspecting something in the library is possibly using an encoding that isn't translating back to UTF-8 correctly.
Android Studio & Intellij's output (Windows 10)
Execution failed for task ':app:spotlessKotlinCheck'.
> The following files had format violations:
app\src\main\java\com\corwinjv\postmodernandroid\common\di\NetworkModule.kt
@@ -6,15 +6,14 @@
import�dagger.Provides
import�dagger.hilt.InstallIn
import�dagger.hilt.android.components.ApplicationComponent
+import�javax.inject.Singleton
import�okhttp3.OkHttpClient
import�retrofit2.Retrofit
import�retrofit2.converter.gson.GsonConverterFactory
-import�javax.inject.Singleton
@InstallIn(ApplicationComponent::class)
@Module
-class�NetworkModule
-{
+class�NetworkModule�{
����@Provides
����@Singleton
����fun�provideOkHttpClient():�OkHttpClient�{
@@ -24,7 +23,7 @@
����@Provides
����@Singleton
-����fun�provideProgrammingQuotesApi(okHttpClient:�OkHttpClient)�:�ProgrammingQuotesApi�{
+����fun�provideProgrammingQuotesApi(okHttpClient:�OkHttpClient):�ProgrammingQuotesApi�{
��������return�Retrofit.Builder()
... (8 more lines that didn't fit)
Command Prompt's output (Windows 10)
Execution failed for task ':app:spotlessKotlinCheck'.
> The following files had format violations:
app\src\main\java\com\corwinjv\postmodernandroid\common\di\NetworkModule.kt
@@ -6,15 +6,14 @@
import╖dagger.Provides
import╖dagger.hilt.InstallIn
import╖dagger.hilt.android.components.ApplicationComponent
+import╖javax.inject.Singleton
import╖okhttp3.OkHttpClient
import╖retrofit2.Retrofit
import╖retrofit2.converter.gson.GsonConverterFactory
-import╖javax.inject.Singleton
@InstallIn(ApplicationComponent::class)
@Module
-class╖NetworkModule
-{
+class╖NetworkModule╖{
╖╖╖╖@Provides
╖╖╖╖@Singleton
╖╖╖╖fun╖provideOkHttpClient():╖OkHttpClient╖{
@@ -24,7 +23,7 @@
╖╖╖╖@Provides
╖╖╖╖@Singleton
-╖╖╖╖fun╖provideProgrammingQuotesApi(okHttpClient:╖OkHttpClient)╖:╖ProgrammingQuotesApi╖{
+╖╖╖╖fun╖provideProgrammingQuotesApi(okHttpClient:╖OkHttpClient):╖ProgrammingQuotesApi╖{
╖╖╖╖╖╖╖╖return╖Retrofit.Builder()
... (8 more lines that didn't fit)
Android Studio 4.0's output (Mac OS Catalina)
Execution failed for task ':app:spotlessKotlinCheck'.
> The following files had format violations:
app/src/androidTest/java/com/corwinjv/postmodernandroid/ExampleInstrumentedTest.kt
@@ -1,13 +1,11 @@
package·com.corwinjv.postmodernandroid
+import·androidx.test.ext.junit.runners.AndroidJUnit4
import·androidx.test.platform.app.InstrumentationRegistry
-import·androidx.test.ext.junit.runners.AndroidJUnit4
-
+import·org.junit.Assert.assertEquals
import·org.junit.Test
import·org.junit.runner.RunWith
-import·org.junit.Assert.assertEquals
-
/**
·*·Instrumented·test,·which·will·execute·on·an·Android·device.
·*
app/src/main/java/com/corwinjv/postmodernandroid/App.kt
@@ -4,4 +4,4 @@
import·dagger.hilt.android.HiltAndroidApp
@HiltAndroidApp
-class·App·:·Application()
+class·App·:·Application()
app/src/main/java/com/corwinjv/postmodernandroid/common/di/NetworkModule.kt
@@ -6,15 +6,14 @@
import·dagger.Provides
import·dagger.hilt.InstallIn
import·dagger.hilt.android.components.ApplicationComponent
+import·javax.inject.Singleton
import·okhttp3.OkHttpClient
import·retrofit2.Retrofit
import·retrofit2.converter.gson.GsonConverterFactory
-import·javax.inject.Singleton
@InstallIn(ApplicationComponent::class)
@Module
-class·NetworkModule
-{
+class·NetworkModule·{
····@Provides
····@Singleton
····fun·provideOkHttpClient():·OkHttpClient·{
@@ -24,7 +23,7 @@
····@Provides
····@Singleton
-····fun·provideProgrammingQuotesApi(okHttpClient:·OkHttpClient)·:·ProgrammingQuotesApi·{
+····fun·provideProgrammingQuotesApi(okHttpClient:·OkHttpClient):·ProgrammingQuotesApi·{
········return·Retrofit.Builder()
... (8 more lines that didn't fit)
gradle or maven version
Gradle - 6.1.1
spotless version
5.5.1
operating system and version
- Windows 10 Pro (19041.508)
- Android Studio 4.0
- Intellij IDEA 2019.3.4
copy-paste your full Spotless configuration block(s)
Root project Gradle file
buildscript {
repositories {
// ...
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
// ...
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:5.5.1"
}
}
apply plugin: "com.diffplug.spotless"
// ...
Subproject (app)'s Gradle file
// ...
apply plugin: "com.diffplug.spotless"
spotless {
kotlin {
target 'src/*/java/**/*.kt'
ktlint()
}
}
// ...
copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace
See summary
- 主要言語
- Java
- スター
- 5.7k
- フォーク
- 560
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 43
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/spotless のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
diffplug/spotless の issue をすべて見る
似ている issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apache/flink-agents#1152 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
jenkinsci/blueocean-plugin#5417 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
objectionary/eo-graphs#75 ·