Scalastyle
#
RulesThis is a collection of all the Scalastyle rules created by sonar-scala in the Scalastyle rules repository.
- Avoid block imports
Minor
Checks that block imports are not used.
Block imports, e.g.
import a.{b, c}
can lead to annoying merge errors in large code bases that are maintained by lot of developers. This rule allows to ensure that only single imports are used in order to minimize merge errors in import declarations.org.scalastyle.scalariform.BlockImportChecker - Avoid curlies imports
Minor
Checks that curlies imports are not used.
Curlies imports, e.g.
import a.{b, c}
, can lead to annoying merge errors in large code bases that are maintained by lot of developers. This rule allows to ensure that only single imports, no renaming and no hiding imports are used in order to minimize merge errors in import declarations.org.scalastyle.scalariform.CurliesImportChecker - Avoid wildcard imports
Minor
Avoid wildcard imports.
Importing all classes from a package or static members from a class leads to tight coupling between packages or classes and might lead to problems when a new version of a library introduces name clashes.
org.scalastyle.scalariform.UnderscoreImportChecker - Class name
Minor
Check that class names match a regular expression.
The Scala style guide recommends that class names conform to certain standards.
org.scalastyle.scalariform.ClassNamesChecker - Class type parameter name
Minor
Checks that type parameter to a class matches a regular expression.
Scala generic type names are generally single upper case letters. This check checks for classes and traits. Note that this check only checks the innermost type parameter, to allow for
List[T]
.org.scalastyle.scalariform.ClassTypeParameterChecker - Clone method
Minor
Check that classes and objects do not define the clone() method.
The clone method is difficult to get right. You can use the copy constructor of case classes rather than implementing clone. For more information on
clone()
, see Effective Java by Joshua Bloch pages.org.scalastyle.scalariform.NoCloneChecker - Covariant equals
Minor
Check that classes and objects do not define equals without overriding equals(java.lang.Object).
Mistakenly defining a covariant
equals()
method without overriding methodequals(java.lang.Object)
can produce unexpected runtime behaviour.org.scalastyle.scalariform.CovariantEqualsChecker - Cyclomatic complexity
Minor
Checks that the cyclomatic complexity of a method does exceed a value.
If the code is too complex, then this can make code hard to read.
org.scalastyle.scalariform.CyclomaticComplexityChecker - Empty interpolated string
Minor
The interpolation for this string literal is not necessary.
Empty interpolated strings are harder to read and not necessary.
org.scalastyle.scalariform.EmptyInterpolatedStringChecker - Equals hashCode
Minor
Check that if a class implements either equals or hashCode, it should implement the other.
Defining either equals or hashCode in a class without defining the is a known source of bugs. Usually, when you define one, you should also define the other.
org.scalastyle.scalariform.EqualsHashCodeChecker - Field name
Minor
Check that field names match a regular expression.
A consistent naming convention for field names can make code easier to read and understand.
org.scalastyle.scalariform.FieldNamesChecker - File length
Minor
Check the number of lines in a file.
Files which are too long can be hard to read and understand.
org.scalastyle.file.FileLengthChecker - File line length
Minor
Check the number of characters in a line.
Lines that are too long can be hard to read and horizontal scrolling is annoying.
org.scalastyle.file.FileLineLengthChecker - Finalize method
Minor
Check that classes and objects do not define the finalize() method.
finalize()
is called when the object is garbage collected, and garbage collection is not guaranteed to happen. It is therefore unwise to rely on code infinalize()
method.org.scalastyle.scalariform.NoFinalizeChecker - Group imports
Minor
Checks that imports are grouped together, not throughout the file.
If imports are spread throughout the file, knowing what is in scope at any one place can be difficult to work out.
org.scalastyle.scalariform.ImportGroupingChecker - If block braces
Minor
Checks that if statements have braces.
Some people find if clauses with braces easier to read.
The
singleLineAllowed
property allows if constructions of the type:if (bool_expression) expression1 else expression2
The
doubleLineAllowed
property allows if constructions of the type:if (bool_expression) expression1 else expression2
Note: If you intend to enable only if expressions in the format below, disable the IfBraceChecker altogether.
if (bool_expression) expression1 else expression2
org.scalastyle.scalariform.IfBraceChecker - Illegal imports
Minor
Check that a class does not import certain classes.
Use of some classes can be discouraged for a project. For instance, use of
sun._
is generally discouraged because they are internal to the JDK and can be changed.org.scalastyle.scalariform.IllegalImportsChecker - Import Order
Minor
Checks that imports are grouped and ordered according to the style configuration.
Consistent import ordering improves code readability and reduces unrelated changes in patches.
org.scalastyle.scalariform.ImportOrderChecker - Line contains Tab
Minor
Check that there are no tabs in a file.
Some say that tabs are evil.
org.scalastyle.file.FileTabChecker - Literal passed as argument without name
Minor
Checks that argument literals are named.
Nameless literals make code harder to understand (consider
updateEntity(1, true)
andupdateEntity(id = 1, enabled = true)
).org.scalastyle.scalariform.NamedArgumentChecker - Long literal uppercase L
Minor
Checks that if a long literal is used, then an uppercase L is used.
A lowercase L (l) can look similar to a number 1 with some fonts.
org.scalastyle.scalariform.UppercaseLChecker - Lowercase pattern match
Minor
Checks that a case statement pattern match is not lower case, as this can cause confusion.
A lower case pattern match clause with no other tokens is the same as
_
; this is not true for patterns which start with an upper case letter. This can cause confusion, and may not be what was intended:val foo = "foo" val Bar = "bar" "bar" match { case Bar => "we got bar" } // result = "we got bar" "bar" match { case foo => "we got foo" } // result = "we got foo" "bar" match { case `foo` => "we got foo" } // result = MatchError
This checker raises a warning with the second match. To fix it, use an identifier which starts with an upper case letter (best), use
case _
or, if you wish to refer to the value, add a type: Any
, e.g.:val lc = "lc" "something" match { case lc: Any => "lc" } // result = "lc" "something" match { case _ => "lc" } // result = "lc"
org.scalastyle.scalariform.LowercasePatternMatchChecker - Magic Number
Minor
Checks for use of magic numbers.
Replacing a magic number with a named constant can make code easier to read and understand, and can avoid some subtle bugs.
A simple assignment to a val is not considered to be a magic number, for example:
val foo = 4
is not a magic number, butvar foo = 4
is considered to be a magic number.org.scalastyle.scalariform.MagicNumberChecker - Maximum parameters
Minor
Maximum number of parameters for a method.
A method which has more than a certain number of parameters can be hard to understand.
org.scalastyle.scalariform.ParameterNumberChecker - Method argument name
Minor
Check that method argument names match a regular expression.
The Scala style guide recommends that method argument names conform to certain standards.
org.scalastyle.scalariform.MethodArgumentNamesChecker - Method length
Minor
Checks that methods do not exceed a maximum length.
Long methods can be hard to read and understand.
org.scalastyle.scalariform.MethodLengthChecker - Method name
Minor
Check that method names match a regular expression.
The Scala style guide recommends that method names conform to certain standards. If the methods are overriding another method, and the overridden method cannot be changed, then use the
ignoreOverride
parameter.org.scalastyle.scalariform.MethodNamesChecker - Multiple string literals
Minor
Checks that a string literal does not appear multiple times.
Code duplication makes maintenance more difficult, so it can be better to replace the multiple occurrences with a constant.
org.scalastyle.scalariform.MultipleStringLiteralsChecker - Newline at EOF
Minor
Checks that a file ends with a newline character.
Some version control systems don't cope well with files which don't end with a newline character.
org.scalastyle.file.NewLineAtEofChecker - No Newline at EOF
Minor
Checks that a file does not end with a newline character.
Because Mirco Dotta wanted it.
org.scalastyle.file.NoNewLineAtEofChecker - No mutable fields
Minor
Checks that classes and objects do not define mutable fields.
var
(mutable fields) are deprecated if you're using a strict functional style.org.scalastyle.scalariform.VarFieldChecker - No mutable local variables
Minor
Checks that functions do not define mutable variables.
var
(mutable local variables) are deprecated if you're using a strict functional style.org.scalastyle.scalariform.VarLocalChecker - No redundant if expressions
Minor
Checks that if expressions are not redundant, i.e. easily replaced by a variant of the condition.
If expressions with boolean constants in both branches can be eliminated without affecting readability. Prefer simply
cond
toif (cond) true else false
and!cond
toif (cond) false else true
.org.scalastyle.scalariform.RedundantIfChecker - No space after tokens
Minor
Ensure single space after certain token(s).
Correct formatting can help readability.
org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker - No space before tokens
Minor
Ensure single space before certain token(s).
Correct formatting can help readability.
org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker - No throw statements.
Minor
Checks that throw is not used.
throw
statements should be replaced with type-safe error constructs likeTry
andEither
, which communicate the possibility of error in the type signature.org.scalastyle.scalariform.ThrowChecker - No use of Java @Deprecated
Minor
Checks that Java @Deprecated is not used, Scala @deprecated should be used instead.
You should be using the Scala
@deprecated
instead.org.scalastyle.scalariform.DeprecatedJavaChecker - No use of Java @Override
Minor
Checks that Java @Override is not used.
You should be using the Scala override keyword instead.
org.scalastyle.scalariform.OverrideJavaChecker - No while loops
Minor
Checks that while is not used.
while
loops are deprecated if you're using a strict functional style.org.scalastyle.scalariform.WhileChecker - No whitespace after left bracket ''[''
Minor
No whitespace after left bracket ''[''.
If there is whitespace after a left bracket, this can be confusing to the reader.
org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker - No whitespace before left bracket ''[''
Minor
No whitespace before left bracket ''[''.
If there is whitespace before a left bracket, this can be confusing to the reader.
org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker - No whitespace before right bracket '']''
Minor
No whitespace before right bracket '']''.
If there is whitespace before a right bracket, this can be confusing to the reader.
org.scalastyle.scalariform.NoWhitespaceBeforeRightBracketChecker - Non ASCII characters are not allowed
Minor
Some editors are unfriendly to non ASCII characters.
Scala allows unicode characters as operators and some editors misbehave when they see non-ascii character. In a project collaborated by a community of developers. This check can be helpful in such situations.
"value" match { case "value" => println("matched") ... }
is preferred to
"value" match { case "value" ⇒ println("matched") ... }
To fix it, replace the (unicode operator)
⇒
with=>
.org.scalastyle.scalariform.NonASCIICharacterChecker - Null
Minor
Check that null is not used.
Scala discourages use of
null
, preferringOption
.org.scalastyle.scalariform.NullChecker - Number of methods in type
Minor
Check that a class / trait / object does not have too many methods.
If a type declares too many methods, this can be an indication of bad design.
org.scalastyle.scalariform.NumberOfMethodsInTypeChecker - Number of types
Minor
Checks that there are not too many types declared in a file.
If there are too many classes/objects defined in a single file, this can cause the code to be difficult to understand.
org.scalastyle.scalariform.NumberOfTypesChecker - Object name
Minor
Check that object names match a regular expression.
The Scala style guide recommends that object names conform to certain standards.
org.scalastyle.scalariform.ObjectNamesChecker - Omit braces in case clauses
Minor
Checks that braces aren't used in case clauses.
Braces aren't required in case clauses. They should be omitted according to Scala Style Guide.
org.scalastyle.scalariform.CaseBraceChecker - Package name
Minor
Check that package names match a regular expression.
The Scala style guide recommends that package names conform to certain standards.
org.scalastyle.scalariform.PackageNamesChecker - Package object name
Minor
Check that package object names match a regular expression.
The Scala style guide recommends that package object names conform to certain standards.
org.scalastyle.scalariform.PackageObjectNamesChecker - Pattern match align
Minor
Check that pattern match arrows align.
Correct formatting can help readability.
org.scalastyle.scalariform.PatternMatchAlignChecker - Public method must have type
Minor
Check that a method has an explicit return type, it is not inferred.
A public method declared on a type is effectively an API declaration. Explicitly declaring a return type means that other code which depends on that type won't break unexpectedly.
org.scalastyle.scalariform.PublicMethodsHaveTypeChecker - Redundant braces in class definition
Minor
If a class/trait has no members, the braces are unnecessary.
If a
class
/trait
has no members, then braces are unnecessary, and can be removed.org.scalastyle.scalariform.EmptyClassChecker - Regular expression in a token
Minor
Checks that a regular expression cannot be matched in a token, if found reports this.
Some checks can be carried by just the presence of a particular token.
org.scalastyle.scalariform.TokenChecker - Return
Minor
Check that return is not used.
Use of
return
is not usually necessary in Scala. In fact, use of return can discourage a functional style of programming.org.scalastyle.scalariform.ReturnChecker - Simplify Boolean expression
Minor
Boolean expression can be simplified.
A boolean expression which can be simplified can make code easier to read.
org.scalastyle.scalariform.SimplifyBooleanExpressionChecker - Space after plus
Minor
Check that the plus sign is followed by a space.
An expression with spaces around
+
can be easier to read.org.scalastyle.scalariform.SpacesAfterPlusChecker - Space after the start of the comment
Minor
Checks a space after the start of the comment.
To bring consistency with how comments should be formatted, leave a space right after the beginning of the comment.
package foobar object Foobar { /**WRONG * */ /** Correct * */ val d = 2 /*Wrong*/ //Wrong /** * Correct */ val e = 3 /** Correct*/ // Correct }
org.scalastyle.scalariform.SpaceAfterCommentStartChecker - Space after tokens
Minor
Disallow space after certain token(s).
Correct formatting can help readability.
org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker - Space before plus
Minor
Check that the plus sign is preceded by a space.
An expression with spaces around
+
can be easier to read.org.scalastyle.scalariform.SpacesBeforePlusChecker - Space before tokens
Minor
Disallow space before certain token(s).
Correct formatting can help readability.
org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker - Structural type
Minor
Check that structural types are not used.
Structural types in Scala can use reflection - this can have unexpected performance consequences. Warning: This check can also wrongly pick up type lamdbas and other such constructs. This checker should be used with care. You always have the alternative of the scalac checking for structural types.
org.scalastyle.scalariform.StructuralTypeChecker - TODO/FIXME comment
Minor
Check for use of TODO/FIXME single line comments.
Some projects may consider
TODO
orFIXME
comments in a code bad style. They would rather you fix the problem.org.scalastyle.scalariform.TodoCommentChecker - Usage of ??? operator
Minor
Checks that the code does not have ??? operators.
The
???
operator denotes that an implementation is missing. This rule helps to avoid potential runtime errors because of not implemented code.org.scalastyle.scalariform.NotImplementedErrorUsage - Use : Unit = for procedures
Minor
Use a : Unit = for procedure declarations.
A procedure style declaration can cause confusion - the developer may have simply forgotten to add a
=
, and now their method returnsUnit
rather than the inferred type:def foo() { println("hello"); 5 }
This checker raises a warning with the first line. To fix it, use an explicit return type, or add a
=
before the body.def foo() = { println("hello"); 5 }
org.scalastyle.scalariform.ProcedureDeclarationChecker - Use braces in for comprehensions
Minor
Checks that braces are used in for comprehensions.
Usage of braces (rather than parentheses) within a
for
comprehension mean that you don't have to specify a semi-colon at the end of every line:for { // braces t <- List(1,2,3) if (t % 2 == 0) } yield t
is preferred to
for ( // parentheses t <- List(1,2,3); if (t % 2 == 0) ) yield t
To fix it, replace the
()
with{}
. And then remove the;
at the end of the lines.The
singleLineAllowed
property allows for constructions of the type:for (i <- List(1,2,3)) yield i
org.scalastyle.scalariform.ForBraceChecker - Use correct indentation
Minor
Checks that lines are indented by a multiple of the tab size.
Code that is not indented consistently can be hard to read.
org.scalastyle.file.IndentationChecker - Use parentheses in for loops
Minor
Checks that parentheses are used in for loops.
For-comprehensions which lack a
yield
clause is actually a loop rather than a functional comprehension and it is usually more readable to string the generators together between parentheses rather than using the syntactically-confusing} {
construct:for (x <- board.rows; y <- board.files) { printf("(%d, %d)", x, y) }
is preferred to
for { x <- board.rows y <- board.files } { printf("(%d, %d)", x, y) }
org.scalastyle.scalariform.ForLoopChecker - While body should have braces
Minor
Checks that while body have braces.
While cannot be used in a pure-functional manner, that's why it's recommended to never omit braces according to Scala Style Guide.
org.scalastyle.scalariform.WhileBraceChecker - Whitespace at end of line
Minor
Check that there is no trailing whitespace at the end of lines.
Whitespace at the end of a line can cause problems when diffing between files or between versions.
org.scalastyle.file.WhitespaceEndOfLineChecker - XML literals
Minor
Check that XML literals are not used.
Some projects prefer not to have XML literals. They could use a templating engine instead.
org.scalastyle.scalariform.XmlLiteralChecker
#
Templates- Class name
Minor template
Check that class names match a regular expression.
The Scala style guide recommends that class names conform to certain standards.
org.scalastyle.scalariform.ClassNamesChecker-template - Class type parameter name
Minor template
Checks that type parameter to a class matches a regular expression.
Scala generic type names are generally single upper case letters. This check checks for classes and traits. Note that this check only checks the innermost type parameter, to allow for
List[T]
.org.scalastyle.scalariform.ClassTypeParameterChecker-template - Cyclomatic complexity
Minor template
Checks that the cyclomatic complexity of a method does exceed a value.
If the code is too complex, then this can make code hard to read.
org.scalastyle.scalariform.CyclomaticComplexityChecker-template - Field name
Minor template
Check that field names match a regular expression.
A consistent naming convention for field names can make code easier to read and understand.
org.scalastyle.scalariform.FieldNamesChecker-template - File length
Minor template
Check the number of lines in a file.
Files which are too long can be hard to read and understand.
org.scalastyle.file.FileLengthChecker-template - File line length
Minor template
Check the number of characters in a line.
Lines that are too long can be hard to read and horizontal scrolling is annoying.
org.scalastyle.file.FileLineLengthChecker-template - If block braces
Minor template
Checks that if statements have braces.
Some people find if clauses with braces easier to read.
The
singleLineAllowed
property allows if constructions of the type:if (bool_expression) expression1 else expression2
The
doubleLineAllowed
property allows if constructions of the type:if (bool_expression) expression1 else expression2
Note: If you intend to enable only if expressions in the format below, disable the IfBraceChecker altogether.
if (bool_expression) expression1 else expression2
org.scalastyle.scalariform.IfBraceChecker-template - Illegal imports
Minor template
Check that a class does not import certain classes.
Use of some classes can be discouraged for a project. For instance, use of
sun._
is generally discouraged because they are internal to the JDK and can be changed.org.scalastyle.scalariform.IllegalImportsChecker-template - Literal passed as argument without name
Minor template
Checks that argument literals are named.
Nameless literals make code harder to understand (consider
updateEntity(1, true)
andupdateEntity(id = 1, enabled = true)
).org.scalastyle.scalariform.NamedArgumentChecker-template - Magic Number
Minor template
Checks for use of magic numbers.
Replacing a magic number with a named constant can make code easier to read and understand, and can avoid some subtle bugs.
A simple assignment to a val is not considered to be a magic number, for example:
val foo = 4
is not a magic number, butvar foo = 4
is considered to be a magic number.org.scalastyle.scalariform.MagicNumberChecker-template - Match Header
Minor template
Check the first lines of each file matches the text.
A lot of projects require a header with a copyright notice, or they require a license in each file. This does a simple text comparison between the header and the first lines of the file. You can have multiple lines, but make sure you surround the text with a
CDATA
section. You can also specify a regular expression, as long as you set the regex parameter totrue
.org.scalastyle.file.HeaderMatchesChecker-template - Maximum parameters
Minor template
Maximum number of parameters for a method.
A method which has more than a certain number of parameters can be hard to understand.
org.scalastyle.scalariform.ParameterNumberChecker-template - Method argument name
Minor template
Check that method argument names match a regular expression.
The Scala style guide recommends that method argument names conform to certain standards.
org.scalastyle.scalariform.MethodArgumentNamesChecker-template - Method length
Minor template
Checks that methods do not exceed a maximum length.
Long methods can be hard to read and understand.
org.scalastyle.scalariform.MethodLengthChecker-template - Method name
Minor template
Check that method names match a regular expression.
The Scala style guide recommends that method names conform to certain standards. If the methods are overriding another method, and the overridden method cannot be changed, then use the
ignoreOverride
parameter.org.scalastyle.scalariform.MethodNamesChecker-template - Missing or badly formed ScalaDoc
Minor template
Checks that the ScalaDoc on documentable members is well-formed.
Scaladoc is generally considered a good thing. Within reason.
Ignore tokens is a comma separated string that may include the following:
PatDefOrDcl
(variables),TmplDef
(classes, traits),TypeDefOrDcl
(type definitions),FunDefOrDcl
(functions). Supported indentation styles are "scaladoc" (for ScalaDoc-style comments, with two spaces before the asterisk), "javadoc" (for JavaDoc-style comments, with a single space before the asterisk) or "anydoc" to support any style (any number of spaces before the asterisk). For backwards compatibility, if left empty, "anydoc" will be assumed.org.scalastyle.scalariform.ScalaDocChecker-template - Multiple string literals
Minor template
Checks that a string literal does not appear multiple times.
Code duplication makes maintenance more difficult, so it can be better to replace the multiple occurrences with a constant.
org.scalastyle.scalariform.MultipleStringLiteralsChecker-template - Non ASCII characters are not allowed
Minor template
Some editors are unfriendly to non ASCII characters.
Scala allows unicode characters as operators and some editors misbehave when they see non-ascii character. In a project collaborated by a community of developers. This check can be helpful in such situations.
"value" match { case "value" => println("matched") ... }
is preferred to
"value" match { case "value" ⇒ println("matched") ... }
To fix it, replace the (unicode operator)
⇒
with=>
.org.scalastyle.scalariform.NonASCIICharacterChecker-template - Null
Minor template
Check that null is not used.
Scala discourages use of
null
, preferringOption
.org.scalastyle.scalariform.NullChecker-template - Number of methods in type
Minor template
Check that a class / trait / object does not have too many methods.
If a type declares too many methods, this can be an indication of bad design.
org.scalastyle.scalariform.NumberOfMethodsInTypeChecker-template - Number of types
Minor template
Checks that there are not too many types declared in a file.
If there are too many classes/objects defined in a single file, this can cause the code to be difficult to understand.
org.scalastyle.scalariform.NumberOfTypesChecker-template - Object name
Minor template
Check that object names match a regular expression.
The Scala style guide recommends that object names conform to certain standards.
org.scalastyle.scalariform.ObjectNamesChecker-template - Package name
Minor template
Check that package names match a regular expression.
The Scala style guide recommends that package names conform to certain standards.
org.scalastyle.scalariform.PackageNamesChecker-template - Package object name
Minor template
Check that package object names match a regular expression.
The Scala style guide recommends that package object names conform to certain standards.
org.scalastyle.scalariform.PackageObjectNamesChecker-template - Public method must have type
Minor template
Check that a method has an explicit return type, it is not inferred.
A public method declared on a type is effectively an API declaration. Explicitly declaring a return type means that other code which depends on that type won't break unexpectedly.
org.scalastyle.scalariform.PublicMethodsHaveTypeChecker-template - Regular expression
Minor template
Checks that a regular expression cannot be matched, if found reports this.
Some checks can be carried out with a regular expression.
org.scalastyle.file.RegexChecker-template - Regular expression in a token
Minor template
Checks that a regular expression cannot be matched in a token, if found reports this.
Some checks can be carried by just the presence of a particular token.
org.scalastyle.scalariform.TokenChecker-template - TODO/FIXME comment
Minor template
Check for use of TODO/FIXME single line comments.
Some projects may consider
TODO
orFIXME
comments in a code bad style. They would rather you fix the problem.org.scalastyle.scalariform.TodoCommentChecker-template - Use braces in for comprehensions
Minor template
Checks that braces are used in for comprehensions.
Usage of braces (rather than parentheses) within a
for
comprehension mean that you don't have to specify a semi-colon at the end of every line:for { // braces t <- List(1,2,3) if (t % 2 == 0) } yield t
is preferred to
for ( // parentheses t <- List(1,2,3); if (t % 2 == 0) ) yield t
To fix it, replace the
()
with{}
. And then remove the;
at the end of the lines.The
singleLineAllowed
property allows for constructions of the type:for (i <- List(1,2,3)) yield i
org.scalastyle.scalariform.ForBraceChecker-template - Use correct indentation
Minor template
Checks that lines are indented by a multiple of the tab size.
Code that is not indented consistently can be hard to read.
org.scalastyle.file.IndentationChecker-template - Whitespace at end of line
Minor template
Check that there is no trailing whitespace at the end of lines.
Whitespace at the end of a line can cause problems when diffing between files or between versions.
org.scalastyle.file.WhitespaceEndOfLineChecker-template