Add ktformat task to build.gradle
task ktFormat {
description "R.I.P danger..."
classpath = configrations.ktlint
Main = "com.github.shyiko.ktlint.Main"
args "-F", "src/**/*.kt"
} For p i
Slide 16
Slide 16 text
Add ktformat task to build.gradle
task ktFormat {
description "R.I.P danger..."
classpath = configrations.ktlint
Main = "com.github.shyiko.ktlint.Main"
args "-F", "src/**/*.kt"
} Yo c ha t et s
Slide 17
Slide 17 text
Only format @ local debug build time
e.g.
applicationVariants.all { variant ->
def flavor = variant.productFlavors[0].name
def buildType = variant.buildType.name
if (flavor == 'develop' && buildType == 'debug') {
ktFormat.execute()
}
}
Slide 18
Slide 18 text
$./gradlew --profile ktFormat
Che p r a c
on p o c !
Slide 19
Slide 19 text
What I talk about
● Use ktlint for your team
● Do not review about code fomat
● And I want to remove “Format commit”
● Use ktFormat for reviewer and you
● Format at local debug build time
● Focus your coding
Slide 20
Slide 20 text
Tha y .
What
I talk
about
when I
talk
about
Ktlint