Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SpaceInsideParentheses and SpaceInsideBrackets preferences (closes …
…#14)
- Loading branch information
Showing
6 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
scalariform/src/test/scala/scalariform/formatter/ParenAndBracketSpacingTest.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package scalariform.formatter | ||
|
||
import scalariform.formatter.preferences._ | ||
|
||
class ParenAndBracketSpacingTest extends AbstractExpressionFormatterTest { | ||
|
||
{ | ||
implicit val formattingPreferences = FormattingPreferences.setPreference(SpaceInsideParentheses, true) | ||
"()" ==> "()" | ||
"(a: Int) => 3" ==> "( a: Int ) => 3" | ||
"(3)" ==> "( 3 )" | ||
"(3, 4)" ==> "( 3, 4 )" | ||
"for (n <- 1 to 10) yield foo(n, n)" ==> "for ( n <- 1 to 10 ) yield foo( n, n )" | ||
} | ||
|
||
{ | ||
implicit val formattingPreferences = FormattingPreferences.setPreference(SpaceInsideBrackets, true) | ||
"x: List[String]" ==> "x: List[ String ]" | ||
"foo[Bar](baz)" ==> "foo[ Bar ](baz)" | ||
"{ class A[B] { private[this] val bob } }" ==> "{ class A[ B ] { private[ this ] val bob } }" | ||
"super[X].y" ==> "super[ X ].y" | ||
} | ||
|
||
} |