https://kotlinlang.org logo
#fleet
Title
# fleet
m

Mikołaj Kąkol

12/02/2023, 7:50 AM
I’m using fleet from https://github.com/kotlin-hands-on/advent-of-code-kotlin-template and I have an issue with indentations. It formats code to sth like this:
Copy code
data class BallSet(
            val red: Int,
            val green: Int,
            val blue: Int,
    ) {
        companion object {
            fun fromString(input: String): BallSet {
                val set = input.trim().split(",")
                        .associate { ball -> ball.split(" ").let { it[1] to it[0].toInt() } }

                return BallSet(
                        red = set.getOrDefault("red", 0),
                        green = 5,
                        blue = 4,
                )
            }
        }
    }
so there is 8 spaces in constructor and in following lines. Same code copied to project generated using new kotlin project generator looks good. I don’t see anything in settings
a

andrey.dernov

12/04/2023, 11:13 AM
What is the expected formatting? If the project was opened in IntelliJ before and have specifically configured formatting rules - Fleet will use it. Otherwise it uses .editorconfig (if present) in project for formatting.
m

Mikołaj Kąkol

12/04/2023, 11:35 AM
I'd expect it to follow official kotlin styleguide. I'll try to open it in intellij to force to update formatting
3 Views