https://kotlinlang.org logo
#kotest
Title
# kotest
t

thana

04/18/2022, 9:31 AM
Hi! I was wondering if there are any recommended formatter settings in conjunction with kotest. when using the standard kotlin formatter settings from intellij there is really much whitespace in front of all lines...
s

sam

04/18/2022, 9:34 AM
This is because it's nested right? You could try using the inline constructor style to save an indentation level
t

thana

04/18/2022, 9:36 AM
its not just one level of indentation. for me, intellij always end up with this"
Copy code
class VisitMoveChainTest : DescribeSpec({
                                            describe("f1") {
                                                it("f2") {
                                                    TestClass("", 0) shouldBe TestClass("", 0)
                                                    describe("f3") {
                                                        TestClass("", 0) shouldBe TestClass("fii", 12)
                                                    }
                                                }
                                            }
                                        })
s

sam

04/18/2022, 9:48 AM
Oh that's just weird, mine doesn't do that
Must be some odd setting in your intellij formatting rules
I get this:
Copy code
class ThreadCountCacheTest : FunSpec({

   test("get and set thread counts") {

   }

})
These are my settings for wrapping and braces
t

thana

04/18/2022, 9:52 AM
i guess its the "keep linebreak when reformatting". this whole think is arguably a intellij problem because you cannot configure how constructor calls should be formatted, it seems 😕
oh and i just found out, that using named arguments the formatting looks way better. lol
2 Views