Android Studio also has one default one. Android s...
# android
t
Android Studio also has one default one. Android studio provides a code style tool which can be customised and exported to be distributed to teams. Path to get this tool is Android Studio -> Preferences -> Editor -> Code Style -> Kotlin Default code style is present which follows https://android.github.io/kotlin-guides/style.html
j
@Tarun Yeah, at the time the default android linter did not support Kotlin yet (i believe). Have you personally tried it? Is it decent?
t
yes it is descent but not perfect, hence I also use two tools : one is default and one is KTLint lets see if anyone has used any different tool
j
Sry for the late reply @Tarun, but how did you configure linting with both AS linter and Ktlint?
t
Android Studio code style tool is already enabled by default for Kotlin enabled projects(as can be seen @Android Studio -> Preferences -> Editor -> Code Style -> Kotlin) and highlights errors as warning in light yellow color. We can enable disable check here just by unchecking the checkbox. FOr Ktlint we have to follow steps given in Usage section of @ https://github.com/shyiko/ktlint and this has to be executed manually(as against AS which runs automatically) by some command which is for example : "gradle ktlint" for gradle. so both works simultaneously
j
Thanks very much buddy, will see if this works for me. Thank you again!