pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.23k stars 512 forks source link

Apply recommendations from yole/kotlin-style-guide #4

Closed shyiko closed 5 years ago

shyiko commented 8 years ago

https://github.com/yole/kotlin-style-guide

pardom commented 7 years ago

Shouldn't we be targeting this now?

https://github.com/JetBrains/kotlin-web-site/blob/yole/styleguide/pages/docs/reference/coding-conventions.md

shyiko commented 7 years ago

@pardonut Thank you for the link! I wasn't aware of it. Definitely something to look into. On a separate note, I'm sorry to hear about your 2FA recovery ordeal :cry: I hope you recover access to the original account soon.

pardom commented 7 years ago

Hah, yeah well I guess I learned a valuable lesson.

Tapchicoma commented 7 years ago

FYI: Styleguide for Kotlin from Google: https://android.github.io/kotlin-guides/style.html

shyiko commented 7 years ago

@Tapchicoma thank you!

pardom commented 7 years ago

Probably want to have some sort of rulesets in case people prefer Google's over the official Kotlin style.

shyiko commented 7 years ago

@pardonut At first glance, it looks like Google style guide is compatible (unless I'm missed something) with the one enforced by ktlint (some of the rules are not yet enforced but it's a matter of time) (ktlint --apply-to-idea needs to be updated to detect .editorconfig's continuation_indent_size value but other than that it looks like we're good for now).

twaddington commented 7 years ago

KotlinConf 2017 just wrapped and there are now some additional style docs:

vanniktech commented 6 years ago

Is there anything specific missing? Otherwise I'd close this and do necessary changes when they are requested.

shyiko commented 6 years ago

@vanniktech this ticket is pretty much a reminder that there are a lot of rules that still need to be implemented (like https://github.com/android/kotlin-guides/blob/master/style.md#empty-blocks or https://github.com/android/kotlin-guides/blob/master/style.md#expressions). We should probably create an issue for each missing rule (if anybody feels like helping I would appreciate it) and close this (but not until it's done).

vanniktech commented 6 years ago

Then let's separate, close this and implement each thing on it's own.

Tapchicoma commented 6 years ago

And here it is official coding convention: https://kotlinlang.org/docs/reference/coding-conventions.html

mkulak commented 6 years ago

Would love to see ktlint consistent with official JetBrains style guide.