From ced78e0b1ffa67c74087ffeb731d1b907d64abdd Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Wed, 30 Dec 2020 15:29:26 -0600 Subject: [PATCH] Update guidelines on code style --- docs/GUIDELINES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/GUIDELINES.md b/docs/GUIDELINES.md index d72402c8c..69abfaeaa 100644 --- a/docs/GUIDELINES.md +++ b/docs/GUIDELINES.md @@ -46,6 +46,11 @@ Further resources: * [*How to Make Your Code Reviewer Fall in Love with You*](https://mtlynch.io/code-review-love), by Michael Lynch. +## Code Style + +For Kotlin, we follow [ktlint](https://ktlint.github.io/) style with default settings. This code style is enforced by our automated build pipeline. To make sure that Android Studio is configured according to ktlint, navigate to `android` and run `./gradlew ktlintApplyToIdea`. To check that all code is properly formatted, run `./gradlew ktlintCheck`. See more details in [ktlint-gradle](https://github.com/jlleitschuh/ktlint-gradle). + +For legacy Java code, we don't have strict guidelines. Please follow a code style similar to the file you are modifying. Note that new classes should be written in Kotlin. Pull requests converting existing Java code to Kotlin are also welcome. ## Release Process