From f621070f011f6356ff1c91d216a34288772d3eaa Mon Sep 17 00:00:00 2001 From: Ralf Wondratschek Date: Tue, 11 Aug 2020 09:59:20 -0700 Subject: [PATCH 01/12] Stop always wrapping chained function calls in Kotlin. The old setting used "Always wrap", the new setting uses "Chop down if long". The Java code style uses "Chop down if long", too. The old setting made code harder to read in many scenarios: // Old assertThat(myList).containsExactly("a", "b", "c") .inOrder() // New assertThat(myList).containsExactly("a", "b", "c").inOrder() // Old if (project.file("src/debug") .exists() || project.file("src/release") .exists() ) { return } // New if (project.file("src/debug").exists() || project.file("src/release").exists()) { return } // Old val string = "The project path is ${ project.path.substring(1) .replace(':', '/') }" // New val string = "The project path is ${project.path.substring(1).replace(':', '/')}" // Old stringList .filter {..} .map { it.trim() .substring(1) } // New stringList .filter {..} .map { it.trim().substring(1) } --- configs/codestyles/Square.xml | 2 +- configs/codestyles/SquareAndroid.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configs/codestyles/Square.xml b/configs/codestyles/Square.xml index 458ef16..62a867e 100644 --- a/configs/codestyles/Square.xml +++ b/configs/codestyles/Square.xml @@ -303,7 +303,7 @@