tek / splain

better implicit errors for scala
MIT License
370 stars 28 forks source link

enable scalafmt 2.7.5 & its sbt plugin with default formatting #48

Closed tribbloid closed 3 years ago

tribbloid commented 3 years ago

this allows committers to work together without causing conflicts due to format differences.

Default format with no config at the moment. Please tell me your preferences

I can almost predict that you have a .NET background :)

tek commented 3 years ago

I don't, I format code solely based on what's efficient to edit with vim :smile:

I guess this is reasonable, I'll have a look at the scalafmt config docs, it seems to be quite extensive

tribbloid commented 3 years ago

any update?

tek commented 3 years ago

I took a deep dive into the options page and this is what I came up with:

maxColumn = 120
continuationIndent.defnSite = 2
continuationIndent.extendSite = 0
align.preset = none
align.tokens = []
align.openParenCallSite = false
align.openParenDefnSite = false
newlines.beforeMultiline = unfold
newlines.beforeMultilineDef = unfold
rewrite.rules = [AvoidInfix, RedundantBraces, RedundantParens]
rewrite.redundantBraces.stringInterpolation = true
rewrite.redundantBraces.ifElseExpressions = true
trailingCommas = always
includeNoParensInSelectChains = true
tribbloid commented 3 years ago

sounds good! updated. Still a lot of changes tho

tek commented 3 years ago

guess that's to be expected. but I like it! thanks a lot