From 0f8760bb83648663a2c16de938c2c5866074c6e7 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 7 Dec 2020 16:47:31 +0000 Subject: [PATCH] Add section about staircase indent --- code-style.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/code-style.md b/code-style.md index 823cdfb..17416d8 100644 --- a/code-style.md +++ b/code-style.md @@ -9,6 +9,29 @@ * `CONSTANTS_LIKE_THIS`, `variablesLikeThis` * `AbcCamelCase` rather than `ABCCamelCase` +The configuration for Android Studio to format source files like this is checked +into version control so that the formatter should apply this style out of the box +(Using Ctrl+Alt+L). + +# Avoid Staircase Indent + +Android Studio does not remove manual line breaks or line breaks that have been added +by the formatter before. Sometimes, e.g. when adding arguments or renaming methods or variables, +this can lead to staircase-like indent such as this: + +``` +someVariable + .someMethod( + new LongClassNameWithSomeParameters(int foo, long bar)); +``` + +Please avoid this and help the formatter by manually removing the first line break: + +``` +someVariable.someMethod( + new LongClassNameWithSomeParameters(int foo, long bar)); +``` + # Firefox Tab Size in Gitlab Create `$HOME/.mozilla/firefox/[your.profile.folder]/chrome/userContent.css` (if it doesn't exist) and add: