forked from swoogles/zio-ecosystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.scalafmt.conf
68 lines (58 loc) · 1.96 KB
/
.scalafmt.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
version = 3.1.1
runner.dialect = scala3
# Currently 49 instead of 47 because to run scalafmt on our code snippets, we have to temporarily wrap them
# in an object, which results in everything being indented by an additional 2 spaces.
maxColumn = 100
# Re-enable once markdown changes are merged into official scalafmt project
# project.includeMarkdown = true
project.includePaths = ["glob:**.scala", "glob:**.sbt", "glob:**.sc", "glob:**.md"]
project.excludePaths = ["glob:**build.sbt", "glob:**MdToSourcePlugin/**.scala"]
verticalMultiline.arityThreshold = 0
optIn.configStyleArguments = true
# These settings ensure that even our comments are wrapped base on our maxColumn setting
comments.wrap = "standalone"
align.preset = more
comments.wrapStandaloneSlcAsSlc = true
# This forces all of our code (not just recently changed lines) to get
# styled in a very vertical way. Good for ensuring book/phone compatibility
newlines.source = unfold
# Before this rule:
# def sendResources[A <: Resource[
# A
# ], B <: Resource[B]](
#
# After:
# +def sendResources[
# + A <: Resource[A],
# + B <: Resource[B]
# +](
newlines.beforeTypeBounds = unfold
# This turns code like:
#
# val x = if x then "good" else "bad"
#
# into
#
# val x =
# if x then "good" else "bad"
#
# Combined with other settings, it will ultimately be:
#
# val x =
# if x
# then
# "good"
# else
# "bad"
newlines.forceBeforeMultilineAssign = any
newlines.topLevelStatementBlankLines = [
{blanks {before = 0, after = 0, beforeEndMarker = 0}}
]
rewrite.rules = [SortModifiers, RedundantParens]
# rewrite.rules = [SortModifiers, SortImports, RedundantParens]
rewrite.scala3.removeOptionalBraces = true
# This is one of my favorites :)
# If we omit braces in a class/function/etc, it will leave short bodies alone,
# but if it's longer than this cutoff, it will insert an endmarker with appropriate name
rewrite.scala3.insertEndMarkerMinLines = 20
rewrite.scala3.removeEndMarkerMaxLines = 18