Hi, I've started looking at Spring-fu code, and im...
# spring
c
Hi, I've started looking at Spring-fu code, and immediately stumbled upon this. I commend the project developers on deciding to use tabs for indentation, but smart indent for arguments? Is this the recommended formatting for spring-fu? One of the benefits of using tab is customizable indent width without change in the source itself, smart-indent kills this benefit. Look at the part of spring-fu code on the screenshot

https://k62.kn3.net/B/E/A/3/4/7/558.png

2) is with indent settings in IntelliJ set to 4-4-8 (probably what spring-fu original devs have) 1) is same code without any change with 2-2-4 setting in IntelliJ 3) is proposed best practice, if written that way, code will look good regardless of settings. (sorry, I screwed up numbering while editing screenshot, that's why my comments are 2 -> 1 -> 3 😄 ) Also please note that 3) is recommended by official kotlin style guide: https://kotlinlang.org/docs/reference/coding-conventions.html#function-formatting Even though being fan of using tabs I ignore parts of the guide, mostly it is sound and logical, including parameters formatting recommendation mentioned above. I also see that there are unneeded double indents e.g.
Copy code
application {
	logging {
		logback = logback {
			rollingFileAppender(
					file = File.createTempFile("mylog", ".txt"),
					name = "MY_ROLLING",
					pattern = "%d{yyyy-MM}",
					fileNamePattern = "%i.gz",
					maxFileSize = "2GB",
					maxHistory = 11,
					totalSizeCap = "1MB",
					append = false
			)
		}
	}
}
instead of
Copy code
application {
	logging {
		logback = logback {
			rollingFileAppender(
				file = File.createTempFile("mylog", ".txt"),
				name = "MY_ROLLING",
				pattern = "%d{yyyy-MM}",
				fileNamePattern = "%i.gz",
				maxFileSize = "2GB",
				maxHistory = 11,
				totalSizeCap = "1MB",
				append = false
			)
		}
	}
}
From this I conclude that JetBrains' Kotlin style formatter is not enabled at all. Which is disappointing if it was a conscious decision.
c
Yup, will get on it as soon as I finish my job-work for today 🙂
s
No hurry I am about to push a big commit
I will warn you when that will be ok to avoid merge conflicts
Thanks for your contributions BTW
c
Oh, sure, it is a pleasure, I'm planning to stick around, I like ideas behind spring-fu very much.
s
👍
Big commit pushed 😉