scalastyle-config.xml
<scalastyle>
<name>Parsley configuration</name>
<check enabled="true" class="org.scalastyle.file.FileLengthChecker" level="warning">
<parameters>
<parameter name="maxFileLength">1500</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.file.FileLineLengthChecker" level="warning">
<parameters>
<parameter name="maxLineLength">160</parameter>
<parameter name="tabSize">4</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.file.FileTabChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.file.NewLineAtEofChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.file.NoNewLineAtEofChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.file.RegexChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.file.WhitespaceEndOfLineChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.BlockImportChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.CaseBraceChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.ClassNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[^a-z].*$</parameter>
</parameters>
<customMessage>Classes must not start with a lowercase letter!</customMessage>
</check>
<check enabled="true" class="org.scalastyle.scalariform.ClassTypeParameterChecker" level="warning">
<parameters>
<parameter name="regex">^[A-Z_]|Err$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.CovariantEqualsChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.CurliesImportChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" level="warning">
<parameters>
<parameter name="maximum">10</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.DeprecatedJavaChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceAfterTokenChecker" level="warning">
<parameters>
<parameter name="tokens">LPAREN</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.DisallowSpaceBeforeTokenChecker" level="warning">
<parameters>
<parameter name="tokens">COMMA, RPAREN</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EmptyClassChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.EmptyInterpolatedStringChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.EnsureSingleSpaceAfterTokenChecker" level="warning">
<parameters>
<parameter name="tokens">COLON, IF, FOR, WHILE, TRY, MATCH, LINE_COMMENT</parameter>
</parameters>
</check>
<!-- Unneeded, unless it supports multiple chars before! -->
<check enabled="false" class="org.scalastyle.scalariform.EnsureSingleSpaceBeforeTokenChecker" level="warning">
<parameters>
<parameter name="tokens">ARROW</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.EqualsHashCodeChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.FieldNamesChecker" level="warning">
<parameters>
<parameter name="regex">^_?[a-z][A-Za-z0-9]*_?$</parameter>
<!-- In principle, we want this, but the parsers in character and Parsley are lowercase leading... -->
<!--<parameter name="objectFieldRegex">^[A-Z][A-Za-z0-9]*$</parameter>-->
<parameter name="objectFieldRegex">^_?[a-zA-Z][A-Za-z0-9]*$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.ForBraceChecker" level="warning">
<parameters>
<parameter name="singleLineAllowed">true</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.ForLoopChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.IfBraceChecker" level="warning">
<parameters>
<parameter name="singleLineAllowed">true</parameter>
<parameter name="doubleLineAllowed">true</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.IllegalImportsChecker" level="warning">
<parameters>
<parameter name="illegalImports">sun._,java.awt._</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.ImportGroupingChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.ImportOrderChecker" level="warning">
<parameters>
<parameter name="groups">java,scala,parsley,parsley.internal,others</parameter>
<parameter name="group.java">javax?\..+</parameter>
<parameter name="group.scala">scala\..+</parameter>
<parameter name="group.parsley">parsley\.(?!internal).+</parameter>
<parameter name="group.parsley.internal">parsley\.internal\..+</parameter>
<parameter name="group.others">.+</parameter>
</parameters>
</check>
<check enabled="false" class="org.scalastyle.scalariform.LowercasePatternMatchChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.MagicNumberChecker" level="warning">
<parameters>
<parameter name="ignore">-1,0,1,2,3,8,10,16</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.MethodArgumentNamesChecker" level="warning">
<parameters>
<parameter name="regex">^_?[a-z][A-Za-z0-9]*_?$</parameter>
<parameter name="ignoreRegex">^$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.MethodLengthChecker" level="warning">
<parameters>
<parameter name="maxLength">50</parameter>
<parameter name="ignoreComments">true</parameter>
</parameters>
</check>
<!-- This is obviously a no-go, although we could add the combinators here explicitly to exclude them? -->
<check enabled="false" class="org.scalastyle.scalariform.MethodNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[a-z][A-Za-z0-9]*$</parameter>
<parameter name="ignoreRegex">^$</parameter>
<parameter name="ignoreOverride">false</parameter>
</parameters>
</check>
<check enabled="false" class="org.scalastyle.scalariform.MultipleStringLiteralsChecker" level="warning">
<parameters>
<parameter name="allowed">1</parameter>
<parameter name="ignoreRegex">^\"\"$</parameter>
</parameters>
</check>
<!-- We use quite a lot of these, and I'm not sure I want to change the styling over right now. -->
<check enabled="false" class="org.scalastyle.scalariform.NamedArgumentChecker" level="warning">
<parameters>
<parameter name="checkString">false</parameter>
<parameter name="ignoreMethod">^set.+$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.NoCloneChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.NoFinalizeChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.NoWhitespaceBeforeRightBracketChecker" level="warning"/>
<!-- We use a special ' type, so this is out the window! -->
<check enabled="false" class="org.scalastyle.scalariform.NonASCIICharacterChecker" level="warning">
<parameters>
<parameter name="allowStringLiterals">true</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.NotImplementedErrorUsage" level="warning"/>
<!-- We use null for the stack bases -->
<check enabled="false" class="org.scalastyle.scalariform.NullChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" level="warning">
<parameters>
<parameter name="maxMethods">50</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.NumberOfTypesChecker" level="warning">
<parameters>
<parameter name="maxTypes">30</parameter>
</parameters>
</check>
<!-- We don't want this, becasue we have combinator-based class names and module names with lowercase -->
<check enabled="false" class="org.scalastyle.scalariform.ObjectNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[A-Z][A-Za-z]*$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.OverrideJavaChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.PackageNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[a-z][A-Za-z]*$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.PackageObjectNamesChecker" level="warning">
<parameters>
<parameter name="regex">^[a-z][A-Za-z]*$</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.ParameterNumberChecker" level="warning">
<parameters>
<parameter name="maxParameters">8</parameter>
</parameters>
</check>
<!-- Too fiddly, only if it allowed for same line alignment only... -->
<check enabled="false" class="org.scalastyle.scalariform.PatternMatchAlignChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.ProcedureDeclarationChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.RedundantIfChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.ReturnChecker" level="warning"/>
<!-- As nice as it would be, there are too many classes that would need to go in the ignore Regex: maybe in the future -->
<check enabled="false" class="org.scalastyle.scalariform.ScalaDocChecker" level="warning">
<parameters>
<parameter name="ignoreRegex"></parameter>
<parameter name="ignoreTokenTypes"></parameter>
<parameter name="ignoreOverride">false</parameter>
<parameter name="indentStyle">scaladoc</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.SpaceAfterCommentStartChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.StructuralTypeChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.ThrowChecker" level="warning"/>
<!-- This seems to be broken right now? -->
<!--<check enabled="true" class="org.scalastyle.scalariform.TodoCommentChecker" level="warning">
<parameters>
<parameter name="words" type="string" default="FIXME"/>
</parameters>
<customMessage>Please fix any FIXMEs</customMessage>
</check>-->
<check enabled="false" class="org.scalastyle.scalariform.TokenChecker" level="info">
<parameters>
<parameter name="regex">^[ai]sInstanceOf$</parameter>
</parameters>
<customMessage>Avoid casting.</customMessage>
</check>
<check enabled="true" class="org.scalastyle.scalariform.UnderscoreImportChecker" level="warning">
<parameters>
<parameter name="ignoreRegex">X(\w)*Compat|XAssert|Predef|singletons|lift</parameter>
</parameters>
</check>
<check enabled="true" class="org.scalastyle.scalariform.UppercaseLChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.VarFieldChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.VarLocalChecker" level="warning"/>
<check enabled="true" class="org.scalastyle.scalariform.WhileBraceChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.WhileChecker" level="warning"/>
<check enabled="false" class="org.scalastyle.scalariform.XmlLiteralChecker" level="warning"/>
</scalastyle>