-
Notifications
You must be signed in to change notification settings - Fork 3
Scalastyle proposed rules (Whitespace)
This page contains proposed rules for Scalastyle, category Whitespace.
Checks that the whitespace around the Generic tokens [ and ] is correct to the typical convention. For example the following is legal:
val x: List[Integer] = List[Integer]();
val y: List[List[Integer]] = List[List[Integer]]();
But the following example is not:
val x: List [ Integer ] = List [ Integer ] ();
val y: List [ List [ Integer ] ] = List [ List [ Integer ] ] ();
Checks the padding between the identifier of a method definition, constructor definition, method call, or constructor invocation; and the left parenthesis of the parameter list. That is, if the identifier and left parenthesis are on the same line, checks whether a space is required immediately after the identifier or such a space is forbidden. If they are not on the same line, reports an error, unless configured to allow line breaks. To allow linebreaks after the identifier, set property allowLineBreaks to true.
Checks that there is no whitespace after a token. More specifically, it checks that it is not followed by whitespace, or (if linebreaks are allowed) all characters on the line after are whitespace. To forbid linebreaks after a token, set property allowLineBreaks to false.
Checks that there is no whitespace before a token. More specifically, it checks that it is not preceded with whitespace, or (if linebreaks are allowed) all characters on the line before are whitespace. To allow linebreaks before a token, set property allowLineBreaks to true.
Checks the policy on how to wrap lines on operators.
Checks the policy on the padding of parentheses; i.e. whether a space is required after a left parenthesis and before a right parenthesis, or such spaces are forbidden.
Checks that a token is followed by whitespace.
Checks that a token is surrounded by whitespace.