Kotlin style guide Android Developers
BRANK
This document serves as the complete definition of Google’s Android coding standards for source code in the Kotlin Programming Language. A Kotlin source file is described as being in Google Android Style if and only if it adheres to the rules herein.Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards as well. However, this document focuses primarily on the hard-and-fast rules that we follow universally, and avoids giving advice that isn’t clearly enforceable (whether by human or tool).Last update: 2018-05-18Source filesAll source files must be encoded as UTF-8.NamingIf a source file contains only a single top-level class, the file name should reflect the case-sensitive name plus the .kt extension. Otherwise, if a source file contains multiple top-level declarations, choose a name that describes the contents of the file, apply PascalCase, and append the .kt extension.// MyClass.kt cla…
Android公式のKotlinスタイルガイド。
Java版のスタイルガイドでは
許容していなかった(訂正: 許容している) 一行if elseがOKだったり、言語ならではの違いがある。個人的に気がかりだった「companion objectの記述場所」と「ファイルの末尾改行」については、特に規定がない様子。