Add google-java-format as a submodule Summary: Pull Request resolved: https://github.com/facebookincubator/ktfmt/pull/4 Reviewed By: strulovich Differential Revision: D19195021 Pulled By: cgrushko fbshipit-source-id: 74cb0b4bfa2b784cab3dae7a4942ce0a80512934
ktfmt is a program that pretty-prints (formats) Kotlin code, based on google-java-format.
private fun declareOne( kind: DeclarationKind, modifiers: KtModifierList? = null, valOrVarKeyword: String? = null, typeParameters: KtTypeParameterList? = null, receiver: KtTypeReference? = null, name: String? = "", type: KtTypeReference? = null, op: String = "", equals: String = "=", typeConstraintList: KtTypeConstraintList? = null, initializer: PsiElement? = null, delegate: KtPropertyDelegate? = null, trailing: String? = null ): Int { // }
private fun declareOne( kind: DeclarationKind, modifiers: KtModifierList? = null, valOrVarKeyword: String? = null, typeParameters: KtTypeParameterList? = null, receiver: KtTypeReference? = null, name: String? = "", type: KtTypeReference? = null, op: String = "", equals: String = "=", typeConstraintList: KtTypeConstraintList? = null, initializer: PsiElement? = null, delegate: KtPropertyDelegate? = null, trailing: String? = null ): Int { // }
Note that ktfmt still has some rough edges which we're constantly working on fixing.
vendor/google-java/format submodule is populated. Either clone with submodules (git pull --recurse-submodules https://github.com/facebookincubator/ktfmt.git) or populate the submodule after cloning (git submodule update --init)mvn installjava -jar core/target/ktfmt-0.1-SNAPSHOT-jar-with-dependencies.jarktfmt uses a 2-space indent; why not 4?Two reasons -
vendor/google-java/format submodule is populated. Either clone with submodules (git pull --recurse-submodules https://github.com/facebookincubator/ktfmt.git) or populate the submodule after cloning (git submodule update --init)pom.xml in IntelliJ. Choose “Open as a Project”FormatterKtTest.kt.Apache License 2.0