Skip to content

Commit 2a11f80

Browse files
authoredJul 14, 2017
Merge pull request #244 from godenji/0.2.1
0.2.1 release
2 parents 8380d17 + f66c504 commit 2a11f80

File tree

10 files changed

+450
-310
lines changed

10 files changed

+450
-310
lines changed
 

‎CHANGELOG

+25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
0.2.0 (11/July/17)
2+
3+
* Added alignArguments
4+
* Added compactControlReadability
5+
* Added doubleIndentConstructorArguments
6+
* Added doubleIndentMethodDeclaration
7+
* Added firstArgumentOnNewline
8+
* Added firstParameterOnNewline
9+
* Added indentWithTabs
10+
* Added multilineScaladocCommentsStartOnFirstLine
11+
* Added newlineAtEndOfFile
12+
* Added placeScaladocAsterisksBeneathSecondAsterisk
13+
* Added spaceBeforeContextColon
14+
* Added lexer support for string extractors with wildcards (#144)
15+
* Added support for Scala 2.12
16+
* Added support for ScalaTest 3.0
17+
* FIX: multi-line indentation in more than call and match expressions (#143)
18+
* FIX: line-wrapping of class parameters when using DoubleIndentClassDeclaration (#187)
19+
* FIX: comment formatter to retain blank lines in multiline comments (#208)
20+
* Default danglingCloseParenthesis to Prevent (#200)
21+
* Default spacesAroundMultiImports to true (#198)
22+
* Remove RARROW TokenType (#210)
23+
* Deprecated PreserveDanglingCloseParenthesis replaced with DanglingCloseParenthesis
24+
* Deprecated DoubleIndentClassDeclaration replaced with DoubleIndentConstructorArguments
25+
126
0.1.8 (7/December/15)
227
* FIX: broken indentation in multiline argument lists. (issue #85)
328
* Added backwards compatible dangling parenthesis via DanglingCloseParenthesis (issue #79, #29)

‎README.rst

+207-177
Large diffs are not rendered by default.

‎formatterPreferences.properties

+26-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
#Scalariform formatter preferences
2-
#Fri Apr 01 21:09:37 BST 2011
1+
#alignArguments=false
32
alignParameters=true
4-
compactStringConcatenation=false
5-
indentPackageBlocks=true
6-
formatXml=true
7-
preserveSpaceBeforeArguments=false
8-
doubleIndentConstructorArguments=false
9-
doubleIndentMethodDeclaration=false
10-
rewriteArrowSymbols=false
113
alignSingleLineCaseStatements=true
12-
alignSingleLineCaseStatements.maxArrowIndent=40
13-
spaceBeforeColon=false
14-
spaceInsideBrackets=false
15-
spaceInsideParentheses=false
16-
preserveDanglingCloseParenthesis=false
17-
indentSpaces=2
18-
indentLocalDefs=false
19-
spacesWithinPatternBinders=true
20-
spacesAroundMultiImports=true
4+
#alignSingleLineCaseStatements.maxArrowIndent=40
5+
#compactControlReadability=false
6+
#compactStringConcatenation=false
7+
danglingCloseParenthesis=Force
8+
#doubleIndentClassDeclaration=false
9+
#doubleIndentConstructorArguments=false
10+
#doubleIndentMethodDeclaration=false
11+
#firstArgumentOnNewline=Force
12+
#firstParameterOnNewline=Force
13+
#formatXml=true
14+
#indentLocalDefs=false
15+
#indentPackageBlocks=true
16+
#indentSpaces=2
17+
#indentWithTabs=false
18+
#multilineScaladocCommentsStartOnFirstLine=false
19+
#newlineAtEndOfFile=false
20+
#placeScaladocAsterisksBeneathSecondAsterisk=false
21+
#preserveSpaceBeforeArguments=false
22+
#rewriteArrowSymbols=false
23+
#spaceBeforeColon=false
24+
#spaceBeforeContextColon=false
25+
#spaceInsideBrackets=false
26+
#spaceInsideParentheses=false
27+
#spacesAroundMultiImports=true
28+
#spacesWithinPatternBinders=true

‎scalariform/src/main/scala/scalariform/formatter/ScalaFormatter.scala

+27-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ trait HasHiddenTokenInfo {
2121
def newlineBefore(node: AstNode): Boolean = newlineBefore(node.firstToken)
2222
}
2323

24-
abstract class ScalaFormatter extends HasFormattingPreferences with TypeFormatter with AnnotationFormatter with ExprFormatter with HasHiddenTokenInfo with TemplateFormatter with XmlFormatter with CaseClauseFormatter with CommentFormatter {
24+
abstract class ScalaFormatter
25+
extends HasFormattingPreferences
26+
with TypeFormatter
27+
with AnnotationFormatter
28+
with ExprFormatter
29+
with HasHiddenTokenInfo
30+
with TemplateFormatter
31+
with XmlFormatter
32+
with CaseClauseFormatter
33+
with CommentFormatter {
2534

2635
val newlineSequence: String
2736

@@ -82,10 +91,23 @@ abstract class ScalaFormatter extends HasFormattingPreferences with TypeFormatte
8291
var suspendFormatting = false
8392
var edits: List[TextEdit] = Nil // Stored in reverse
8493

85-
def printableFormattingInstruction(previousTokenOpt: Option[Token], token: Token) =
86-
predecessorFormatting.get(token) orElse
87-
previousTokenOpt.map(defaultFormattingInstruction(_, token)) getOrElse
88-
(if (token.tokenType == EOF) EnsureNewlineAndIndent(0) /* <-- to allow formatting of files with just a scaladoc comment */ else Compact)
94+
def printableFormattingInstruction(previousTokenOpt: Option[Token], token: Token) = {
95+
val isGaplessAssignment =
96+
predecessorFormatting.get(token) match { // avoid `foreach(_.id= ...)` gapless assignment (see MutateTest.scala)
97+
case Some(PlaceAtColumn(_, _, Some(Token(USCORE, _, _, _)))) if token.tokenType == EQUALS => true
98+
case _ => false
99+
}
100+
val maybeInstruction =
101+
if (isGaplessAssignment) Some(CompactEnsuringGap)
102+
else
103+
predecessorFormatting.get(token).orElse(
104+
previousTokenOpt.map(defaultFormattingInstruction(_, token))
105+
)
106+
maybeInstruction.getOrElse(
107+
if (token.tokenType == EOF) EnsureNewlineAndIndent(0) /* <-- to allow formatting of files with just a scaladoc comment */
108+
else Compact
109+
)
110+
}
89111

90112
for ((previousTokenOption, token, nextTokenOption) Utils.withPreviousAndNext(tokens)) {
91113
val previousTokenIsPrintable = previousTokenOption exists { !isInferredNewline(_) }

‎scalariform/src/main/scala/scalariform/formatter/TemplateFormatter.scala

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ trait TemplateFormatter { self: HasFormattingPreferences with AnnotationFormatte
3939
}
4040
for (TemplateInheritanceSection(extendsOrSubtype, earlyDefsOpt, templateParentsOpt) templateInheritanceSectionOpt) {
4141
val doubleIndentTemplateInheritance = !formattingPreferences(DoubleIndentConstructorArguments) &&
42+
formattingPreferences(DoubleIndentClassDeclaration) &&
4243
(templateBodyOption.exists(containsNewline(_)) || paramClausesOpt.exists(containsNewline(_)))
4344
val inheritanceIndent = if (doubleIndentTemplateInheritance) 2 else 1
4445
var currentFormatterState = formatterState

‎scalariform/src/main/scala/scalariform/formatter/preferences/PreferenceDescriptor.scala

+94-89
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,12 @@ trait IntegerPreferenceDescriptor extends PreferenceDescriptor[Int] {
9090

9191
object AllPreferences {
9292
val preferences: List[PreferenceDescriptor[_]] = List(
93-
RewriteArrowSymbols, IndentSpaces, SpaceBeforeColon, SpaceBeforeContextColon, CompactStringConcatenation,
94-
PreserveSpaceBeforeArguments, AlignParameters, FirstParameterOnNewline, AlignArguments, FirstArgumentOnNewline,
95-
DoubleIndentConstructorArguments, FormatXml, IndentPackageBlocks, AlignSingleLineCaseStatements,
96-
AlignSingleLineCaseStatements.MaxArrowIndent, IndentLocalDefs, DanglingCloseParenthesis,
97-
SpaceInsideParentheses, SpaceInsideBrackets, SpacesWithinPatternBinders, MultilineScaladocCommentsStartOnFirstLine, IndentWithTabs,
98-
CompactControlReadability, PlaceScaladocAsterisksBeneathSecondAsterisk, DoubleIndentMethodDeclaration, SpacesAroundMultiImports,
99-
NewlineAtEndOfFile
93+
AlignArguments, AlignParameters, AlignSingleLineCaseStatements, AlignSingleLineCaseStatements.MaxArrowIndent,
94+
CompactControlReadability, CompactStringConcatenation, DanglingCloseParenthesis, DoubleIndentClassDeclaration,
95+
DoubleIndentConstructorArguments, DoubleIndentMethodDeclaration, FirstArgumentOnNewline, FirstParameterOnNewline,
96+
FormatXml, IndentLocalDefs, IndentPackageBlocks, IndentSpaces, IndentWithTabs, MultilineScaladocCommentsStartOnFirstLine,
97+
NewlineAtEndOfFile, PlaceScaladocAsterisksBeneathSecondAsterisk, PreserveSpaceBeforeArguments, RewriteArrowSymbols,
98+
SpaceBeforeColon, SpaceBeforeContextColon, SpaceInsideBrackets, SpaceInsideParentheses, SpacesAroundMultiImports, SpacesWithinPatternBinders
10099
)
101100

102101
val preferencesByKey: Map[String, PreferenceDescriptor[_]] =
@@ -105,28 +104,34 @@ object AllPreferences {
105104
}
106105
}
107106

108-
case object RewriteArrowSymbols extends BooleanPreferenceDescriptor {
109-
val key = "rewriteArrowSymbols"
110-
val description = "Replace arrow tokens with unicode equivalents: => with ⇒, and <- with ←"
107+
case object AlignArguments extends BooleanPreferenceDescriptor {
108+
val key = "alignArguments"
109+
val description = "Align method arguments on different lines in the same column"
111110
val defaultValue = false
112111
}
113112

114-
case object IndentSpaces extends IntegerPreferenceDescriptor {
115-
val key = "indentSpaces"
116-
val description = "Number of spaces to use for indentation"
117-
val preferenceType = IntegerPreference(1, 10)
118-
val defaultValue = 2
113+
case object AlignParameters extends BooleanPreferenceDescriptor {
114+
val key = "alignParameters"
115+
val description = "Align parameters on different lines in the same column"
116+
val defaultValue = false
119117
}
120118

121-
case object SpaceBeforeColon extends BooleanPreferenceDescriptor {
122-
val key = "spaceBeforeColon"
123-
val description = "Add a space before colons"
119+
case object AlignSingleLineCaseStatements extends BooleanPreferenceDescriptor {
120+
val key = "alignSingleLineCaseStatements"
121+
val description = "Align the arrows of consecutive single-line case statements"
124122
val defaultValue = false
123+
124+
case object MaxArrowIndent extends IntegerPreferenceDescriptor {
125+
val key = "alignSingleLineCaseStatements.maxArrowIndent"
126+
val description = "Maximum number of spaces inserted before an arrow to align case statements"
127+
val preferenceType = IntegerPreference(1, 100)
128+
val defaultValue = 40
129+
}
125130
}
126131

127-
case object SpaceBeforeContextColon extends BooleanPreferenceDescriptor {
128-
val key = "spaceBeforeContextColon"
129-
val description = "Add a space before colons in context bounds"
132+
case object CompactControlReadability extends BooleanPreferenceDescriptor {
133+
val key = "compactControlReadability"
134+
val description = "Enable Compact Control Readability style"
130135
val defaultValue = false
131136
}
132137

@@ -136,27 +141,28 @@ case object CompactStringConcatenation extends BooleanPreferenceDescriptor {
136141
val defaultValue = false
137142
}
138143

139-
case object PreserveSpaceBeforeArguments extends BooleanPreferenceDescriptor {
140-
val key = "preserveSpaceBeforeArguments"
141-
val description = "Preserve a space before a parenthesis argument"
142-
val defaultValue = false
144+
case object DanglingCloseParenthesis extends IntentPreferenceDescriptor {
145+
val key = "danglingCloseParenthesis"
146+
val description = "Put a newline before a ')' in an argument expression"
147+
val defaultValue = Prevent
143148
}
144149

145-
case object AlignParameters extends BooleanPreferenceDescriptor {
146-
val key = "alignParameters"
147-
val description = "Align parameters on different lines in the same column"
150+
case object DoubleIndentConstructorArguments extends BooleanPreferenceDescriptor {
151+
val key = "doubleIndentConstructorArguments"
152+
val description = "Class (and trait / object) declarations will be formatted as recommended by the Scala Style Guide"
148153
val defaultValue = false
149154
}
150155

151-
case object FirstParameterOnNewline extends IntentPreferenceDescriptor {
152-
val key = "firstParameterOnNewline"
153-
val description = "Places the first parameter in function or class definitions on a new line"
154-
val defaultValue = Force
156+
@deprecated("This has been dropped in favor of DoubleIndentConstructorArguments.", since = "0.2.0")
157+
case object DoubleIndentClassDeclaration extends BooleanPreferenceDescriptor {
158+
val key = "doubleIndentClassDeclaration"
159+
val description = "Double indent a class's inheritance list (only applies when DoubleIndentConstructorArguments is set to false)"
160+
val defaultValue = false
155161
}
156162

157-
case object AlignArguments extends BooleanPreferenceDescriptor {
158-
val key = "alignArguments"
159-
val description = "Align method arguments on different lines in the same column"
163+
case object DoubleIndentMethodDeclaration extends BooleanPreferenceDescriptor {
164+
val key = "doubleIndentMethodDeclaration"
165+
val description = "Double indent a method's parameters, if they span multiple lines"
160166
val defaultValue = false
161167
}
162168

@@ -166,16 +172,10 @@ case object FirstArgumentOnNewline extends IntentPreferenceDescriptor {
166172
val defaultValue = Force
167173
}
168174

169-
case object DoubleIndentConstructorArguments extends BooleanPreferenceDescriptor {
170-
val key = "doubleIndentConstructorArguments"
171-
val description = "Class (and trait / object) declarations will be formatted as recommended by the Scala Style Guide"
172-
val defaultValue = false
173-
}
174-
175-
case object DoubleIndentMethodDeclaration extends BooleanPreferenceDescriptor {
176-
val key = "doubleIndentMethodDeclaration"
177-
val description = "Double indent a method's parameters, if they span multiple lines"
178-
val defaultValue = false
175+
case object FirstParameterOnNewline extends IntentPreferenceDescriptor {
176+
val key = "firstParameterOnNewline"
177+
val description = "Places the first parameter in function or class definitions on a new line"
178+
val defaultValue = Force
179179
}
180180

181181
case object FormatXml extends BooleanPreferenceDescriptor {
@@ -184,77 +184,82 @@ case object FormatXml extends BooleanPreferenceDescriptor {
184184
val defaultValue = true
185185
}
186186

187+
case object IndentLocalDefs extends BooleanPreferenceDescriptor {
188+
val key = "indentLocalDefs"
189+
val description = "Indent local defs an extra level"
190+
val defaultValue = false
191+
}
192+
187193
case object IndentPackageBlocks extends BooleanPreferenceDescriptor {
188194
val key = "indentPackageBlocks"
189195
val description = "Indent package blocks"
190196
val defaultValue = true
191197
}
192198

193-
case object AlignSingleLineCaseStatements extends BooleanPreferenceDescriptor {
194-
val key = "alignSingleLineCaseStatements"
195-
val description = "Align the arrows of consecutive single-line case statements"
196-
val defaultValue = false
197-
198-
case object MaxArrowIndent extends IntegerPreferenceDescriptor {
199-
val key = "alignSingleLineCaseStatements.maxArrowIndent"
200-
val description = "Maximum number of spaces inserted before an arrow to align case statements"
201-
val preferenceType = IntegerPreference(1, 100)
202-
val defaultValue = 40
203-
}
199+
case object IndentSpaces extends IntegerPreferenceDescriptor {
200+
val key = "indentSpaces"
201+
val description = "Number of spaces to use for indentation"
202+
val preferenceType = IntegerPreference(1, 10)
203+
val defaultValue = 2
204+
}
204205

206+
case object IndentWithTabs extends BooleanPreferenceDescriptor {
207+
val key = "indentWithTabs"
208+
val description = "Use a tab character for indentation"
209+
val defaultValue = false
205210
}
206211

207-
case object IndentLocalDefs extends BooleanPreferenceDescriptor {
208-
val key = "indentLocalDefs"
209-
val description = "Indent local defs an extra level"
212+
case object MultilineScaladocCommentsStartOnFirstLine extends BooleanPreferenceDescriptor {
213+
val key = "multilineScaladocCommentsStartOnFirstLine"
214+
val description = "Start multiline Scaladoc comment body on same line as the opening '/**' "
210215
val defaultValue = false
211216
}
212217

213-
case object DanglingCloseParenthesis extends IntentPreferenceDescriptor {
214-
val key = "danglingCloseParenthesis"
215-
val description = "Put a newline before a ')' in an argument expression"
216-
val defaultValue = Prevent
218+
case object NewlineAtEndOfFile extends BooleanPreferenceDescriptor {
219+
val key = "newlineAtEndOfFile"
220+
val description = "Add a newline at the end of all files"
221+
val defaultValue = false
217222
}
218223

219-
case object SpaceInsideParentheses extends BooleanPreferenceDescriptor {
220-
val key = "spaceInsideParentheses"
221-
val description = "Require a space after '(' and before ')'"
224+
case object PlaceScaladocAsterisksBeneathSecondAsterisk extends BooleanPreferenceDescriptor {
225+
val key = "placeScaladocAsterisksBeneathSecondAsterisk"
226+
val description = "Place Scaladoc asterisks beneath the second asterisk in the opening '/**', as opposed to the first"
222227
val defaultValue = false
223228
}
224229

225-
case object SpaceInsideBrackets extends BooleanPreferenceDescriptor {
226-
val key = "spaceInsideBrackets"
227-
val description = "Require a space after '[' and before ']'"
230+
case object PreserveSpaceBeforeArguments extends BooleanPreferenceDescriptor {
231+
val key = "preserveSpaceBeforeArguments"
232+
val description = "Preserve a space before a parenthesis argument"
228233
val defaultValue = false
229234
}
230235

231-
case object SpacesWithinPatternBinders extends BooleanPreferenceDescriptor {
232-
val key = "spacesWithinPatternBinders"
233-
val description = "Add a space around the @ token in pattern binders"
234-
val defaultValue = true
236+
case object RewriteArrowSymbols extends BooleanPreferenceDescriptor {
237+
val key = "rewriteArrowSymbols"
238+
val description = "Replace arrow tokens with unicode equivalents: => with ⇒, and <- with ←"
239+
val defaultValue = false
235240
}
236241

237-
case object MultilineScaladocCommentsStartOnFirstLine extends BooleanPreferenceDescriptor {
238-
val key = "multilineScaladocCommentsStartOnFirstLine"
239-
val description = "Start multiline Scaladoc comment body on same line as the opening '/**' "
242+
case object SpaceBeforeColon extends BooleanPreferenceDescriptor {
243+
val key = "spaceBeforeColon"
244+
val description = "Add a space before colons"
240245
val defaultValue = false
241246
}
242247

243-
case object IndentWithTabs extends BooleanPreferenceDescriptor {
244-
val key = "indentWithTabs"
245-
val description = "Use a tab character for indentation"
248+
case object SpaceBeforeContextColon extends BooleanPreferenceDescriptor {
249+
val key = "spaceBeforeContextColon"
250+
val description = "Add a space before colons in context bounds"
246251
val defaultValue = false
247252
}
248253

249-
case object CompactControlReadability extends BooleanPreferenceDescriptor {
250-
val key = "compactControlReadability"
251-
val description = "Enable Compact Control Readability style"
254+
case object SpaceInsideBrackets extends BooleanPreferenceDescriptor {
255+
val key = "spaceInsideBrackets"
256+
val description = "Require a space after '[' and before ']'"
252257
val defaultValue = false
253258
}
254259

255-
case object PlaceScaladocAsterisksBeneathSecondAsterisk extends BooleanPreferenceDescriptor {
256-
val key = "placeScaladocAsterisksBeneathSecondAsterisk"
257-
val description = "Place Scaladoc asterisks beneath the second asterisk in the opening '/**', as opposed to the first"
260+
case object SpaceInsideParentheses extends BooleanPreferenceDescriptor {
261+
val key = "spaceInsideParentheses"
262+
val description = "Require a space after '(' and before ')'"
258263
val defaultValue = false
259264
}
260265

@@ -264,8 +269,8 @@ case object SpacesAroundMultiImports extends BooleanPreferenceDescriptor {
264269
val defaultValue = true
265270
}
266271

267-
case object NewlineAtEndOfFile extends BooleanPreferenceDescriptor {
268-
val key = "newlineAtEndOfFile"
269-
val description = "Add a newline at the end of all files"
270-
val defaultValue = false
272+
case object SpacesWithinPatternBinders extends BooleanPreferenceDescriptor {
273+
val key = "spacesWithinPatternBinders"
274+
val description = "Add a space around the @ token in pattern binders"
275+
val defaultValue = true
271276
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package scalariform.formatter
2+
3+
import scalariform.parser._
4+
5+
// format: OFF
6+
class MutateTest extends AbstractFormatterTest {
7+
8+
// avoid gapless assignment
9+
10+
"""object Test {
11+
| htmlNodeList.foreach(_.outerHTML=block.toString)
12+
|}""" ==>
13+
"""object Test {
14+
| htmlNodeList.foreach(_.outerHTML = block.toString)
15+
|}"""
16+
17+
"""object Test {
18+
| maybeHtmlNode.foreach(_.outerHTML= block.toString)
19+
|}""" ==>
20+
"""object Test {
21+
| maybeHtmlNode.foreach(_.outerHTML = block.toString)
22+
|}"""
23+
24+
// format: ON
25+
26+
override val debug = false
27+
28+
def parse(parser: ScalaParser) = parser.nonLocalDefOrDcl()
29+
30+
type Result = FullDefOrDcl
31+
32+
def format(formatter: ScalaFormatter, result: Result) = formatter.format(result)(FormatterState(indentLevel = 0))
33+
34+
}

‎scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala

+15
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ class ParenAndBracketSpacingTest extends AbstractExpressionFormatterTest {
8080
| "bar",
8181
| false
8282
|)"""
83+
84+
// TODO find out why parens based sub expressions do not dangle
85+
86+
"""foo(
87+
|alpha = "foo",
88+
|beta = collection.map { x =>
89+
| x
90+
|}
91+
)""" ==>
92+
"""foo(
93+
| alpha = "foo",
94+
| beta = collection.map { x =>
95+
| x
96+
| }
97+
|)"""
8398
}
8499

85100
{

‎scalariform/src/test/scala/scalariform/formatter/TemplateFormatterTest.scala

+20-20
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
600600
|})"""
601601

602602
{
603-
implicit val formattingPreferences = FormattingPreferences.setPreference(DoubleIndentConstructorArguments, true)
603+
implicit val formattingPreferences = FormattingPreferences.setPreference(DoubleIndentClassDeclaration, true)
604604
"""class Person(
605605
| name: String,
606606
| age: Int)
@@ -609,21 +609,21 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
609609
| with Identifiable
610610
| with Serializable""" ==>
611611
"""class Person(
612-
| name: String,
613-
| age: Int)
614-
| extends Entity
615-
| with Logging
616-
| with Identifiable
617-
| with Serializable"""
612+
| name: String,
613+
| age: Int)
614+
| extends Entity
615+
| with Logging
616+
| with Identifiable
617+
| with Serializable"""
618618

619619
"""class Person(
620620
| name: String,
621621
| age: Int) {
622622
| def firstMethod = 42
623623
|}""" ==>
624624
"""class Person(
625-
| name: String,
626-
| age: Int) {
625+
| name: String,
626+
| age: Int) {
627627
| def firstMethod = 42
628628
|}"""
629629

@@ -633,8 +633,8 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
633633
| def firstMethod = 42
634634
|}""" ==>
635635
"""class Person(
636-
| name: String,
637-
| age: Int) {
636+
| name: String,
637+
| age: Int) {
638638
| def firstMethod = 42
639639
|}"""
640640

@@ -646,10 +646,10 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
646646
|def firstMethod = 42
647647
|}""" ==>
648648
"""class Person(name: String, age: Int, birthdate: Date, astrologicalSign: String, shoeSize: Int, favoriteColor: java.awt.Color)
649-
| extends Entity
650-
| with Logging
651-
| with Identifiable
652-
| with Serializable {
649+
| extends Entity
650+
| with Logging
651+
| with Identifiable
652+
| with Serializable {
653653
| def firstMethod = 42
654654
|}"""
655655

@@ -660,9 +660,9 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
660660
|def method() = 42
661661
|}""" ==>
662662
"""class Person(
663-
| name: String,
664-
| age: Int)
665-
| extends Entity {
663+
| name: String,
664+
| age: Int)
665+
| extends Entity {
666666
| def method() = 42
667667
|}"""
668668

@@ -672,8 +672,8 @@ implicit val formattingPreferences = FormattingPreferences.setPreference(SpacesW
672672
|println("d")
673673
|}""" ==>
674674
"""trait A
675-
| extends B
676-
| with C {
675+
| extends B
676+
| with C {
677677
| println("d")
678678
|}"""
679679

‎version.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "0.2.0"
1+
version in ThisBuild := "0.2.1"

0 commit comments

Comments
 (0)
Please sign in to comment.