Colton Idle
03/19/2020, 3:28 AMSha Sha Chu
03/19/2020, 3:35 AMColton Idle
03/19/2020, 3:40 AMSha Sha Chu
03/19/2020, 3:43 AMColton Idle
03/19/2020, 3:44 AMSha Sha Chu
03/19/2020, 3:45 AMBrais Gabin
03/19/2020, 8:00 AMsubprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
ktlint {
version = "0.36.0"
ignoreFailures = true
reporters {
reporter "checkstyle"
}
}
}
tapchicoma
03/19/2020, 8:31 AMktlint-gradle
to root project to have additional helper tasks like git hook integration or IDEA codestyle integration.
Other then that what @Brais Gabin wrote is correct (maybe except ignoreFailures
🙂 )Brais Gabin
03/19/2020, 8:33 AMignoreFailures
.tapchicoma
03/19/2020, 8:35 AM.editorconfig
with kotlin stylingColton Idle
03/19/2020, 2:55 PM// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.3.70"
repositories {
google()
jcenter()
maven {
url "<https://plugins.gradle.org/m2/>"
}
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0-beta02"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.2.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: "org.jlleitschuh.gradle.ktlint"
But when I run ./gradlew ktlintCheck
I don't get any report.tapchicoma
03/19/2020, 2:56 PMsubprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
}
Colton Idle
03/19/2020, 2:57 PMktlintApplyToIdea
. Which one gives me the "cmd + shift + L" to reformat code as per the style in the IDE?
2. "Unexpected indentation (2) (it should be 4) " Why can't this be auto corrected?
3. Why don't comments that start at the beginning of the file, get indented?tapchicoma
03/19/2020, 3:06 PMColton Idle
03/19/2020, 3:07 PMtapchicoma
03/19/2020, 3:09 PMColton Idle
03/19/2020, 3:11 PMSha Sha Chu
03/19/2020, 4:27 PM--experimental
flag, but i’m not 100% how to enable them via the plugin.
#3 is likely a bug - feel free to file on githubColton Idle
03/19/2020, 6:14 PM