<property name="message" value="Line has trailing spaces."/>
</module>
<module name="RegexpMultiline">
- <property name="format" value="(\r\n|\r)"/>
- <property name="message" value="Line has Windows line delimiter."/>
+ <property name="format" value="(?s:\r\n.*)"/>
+ <property name="message" value="File has Windows (CR+LF) instead of UNIX (LF) end of line (EOL) delimiters."/>
+ </module>
+ <module name="SuppressionFilter">
+ <property name="file" value="${checkstyle.suppressions.file}" />
</module>
<module name="SuppressWarningsFilter"/>
<module name="TreeWalker">
<property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
- <module name="LeftCurly">
- <property name="maxLineLength" value="100"/>
- </module>
- <module name="RightCurly"/>
+ <module name="LeftCurly" />
<module name="RightCurly">
<property name="option" value="alone"/>
- <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+ <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
+ <module name="ParenPad" />
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="ArrayTypeStyle"/>
<property name="option" value="EOL"/>
</module>
<module name="PackageName">
- <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+ <property name="format" value="^[a-z]+(\.[a-z][a-z0-9_]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
+ <module name="ConstantName" />
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.followed"
<module name="JavadocStyle">
<!-- Do NOT 'scope' this one; any JavaDoc (public/protected/private) IFF present, should be style checked. -->
<property name="checkEmptyJavadoc" value="true" />
+ <!-- All except PACKAGE_DEF, due to a Checkstyle particularity (bug?):
+ For all tokens, JavadocStyle checks JavaDoc compliance IFF present;
+ only for package-info.java this ENFORCES that there is a JavaDoc
+ in each package-info.java. We believe this to be a bug because
+ JavadocPackage seems to be inteded for enforcement. Therefore,
+ in line with not enforcing JavaDoc everywhere, just checking when
+ it's present, we must therefore customize the tokens list here.
+ see https://github.com/checkstyle/checkstyle/issues/3416
+ -->
+ <property name="tokens" value="ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, VARIABLE_DEF"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc"/>
- <module name="UpperEll"/>
+
+ <module name="HiddenField">
+ <property name="ignoreConstructorParameter" value="true" />
+ <property name="ignoreSetter" value="true" />
+ <property name="setterCanReturnItsClass" value="true" />
+ </module>
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
+ <module name="FinalClass"/>
+ <module name="HideUtilityClassConstructor"/>
+ <module name="InnerAssignment"/>
<!-- Checks for Exception Handling Anti-Patterns -->
<module name="IllegalCatch"/>
- <!-- IllegalThrows does not seems to work.. :( -->
- <module name="IllegalThrows">
- <property name="ignoreOverriddenMethods" value="false"/>
- </module>
+ <module name="IllegalThrows" />
<module name="MutableException"/>
- <!-- TODO Once new remote repo to proxy for sevntu has be added to nexus.opendaylight.org ,
- (waiting for ticket #24830 with helpdesk@opendaylight.org), and https://git.opendaylight.org/gerrit/#/c/41075/
- has been merged, then add the following additional Exception Handling Anti-Patterns related checks here:
-
- <module name="AvoidHidingCauseExceptionCheck" />
- ??
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck" />
- <module name="EitherLogOrThrowCheck" />
- ??
- <module name="com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck" />
-
- -->
-
+ <!-- Checks for API conventions and the like -->
+ <module name="com.github.sevntu.checkstyle.checks.coding.ForbidCertainImportsCheck">
+ <property name="packageNameRegexp" value=".*" />
+ <property name="forbiddenImportsRegexp" value="com.google.common.base.Charsets" />
+ <property name="forbiddenImportsExcludesRegexp" value="" />
+ <message key="forbid.certain.imports" value="Use ''java.nio.charset.StandardCharsets'' instead of ''{0}''" />
+ </module>
</module>
</module>