Add rules for redundant empty lines

This commit is contained in:
Trustin Lee 2012-12-03 20:45:29 +09:00
parent 946cb46b30
commit 7c91c0dbda

View File

@ -19,7 +19,10 @@
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker"> <module name="Checker">
<module name="io.netty.build.checkstyle.SuppressionFilter"> <module name="io.netty.build.checkstyle.SuppressionFilter">
<property name="pattern" value="(LocalTimeProtocol|LinkedTransferQueue|Version|jzlib/.*|com/sun/nio/sctp/.*)\.java" />
<!--
<property name="pattern" value="(test[^/]*/.*|LocalTimeProtocol|LinkedTransferQueue|Version|jzlib/.*|com/sun/nio/sctp/.*)\.java" /> <property name="pattern" value="(test[^/]*/.*|LocalTimeProtocol|LinkedTransferQueue|Version|jzlib/.*|com/sun/nio/sctp/.*)\.java" />
-->
</module> </module>
<module name="FileTabCharacter"/> <module name="FileTabCharacter"/>
<module name="JavadocPackage"/> <module name="JavadocPackage"/>
@ -31,20 +34,38 @@
<property name="format" value="^(\s|\*)*Copyright\s+[0-9]+\s+The Netty Project\s*$"/> <property name="format" value="^(\s|\*)*Copyright\s+[0-9]+\s+The Netty Project\s*$"/>
<property name="minimum" value="1"/> <property name="minimum" value="1"/>
<property name="maximum" value="1"/> <property name="maximum" value="1"/>
<property name="message" value="missing copyright header"/>
</module> </module>
<!-- Unmaintainable Javadoc tags --> <!-- Unmaintainable Javadoc tags -->
<module name="RegexpSingleline"> <module name="RegexpSingleline">
<property name="format" value="(@(author|version)|\(non-Javadoc\))"/> <property name="format" value="(@(author|version)|\(non-Javadoc\))"/>
<property name="ignoreCase" value="true"/> <property name="ignoreCase" value="true"/>
<property name="message" value="unmaintainable Javadoc tags: @author, @version, or (non-Javadoc)"/>
</module> </module>
<!-- Force UNIX line separator --> <!-- Force UNIX line separator -->
<module name="RegexpMultiline"> <module name="RegexpMultiline">
<property name="format" value="\r"/> <property name="format" value="\r"/>
<property name="message" value="non-Unix line separator"/>
</module> </module>
<!-- Trailing whitespace --> <!-- Trailing whitespace -->
<module name="RegexpSingleline"> <module name="RegexpSingleline">
<property name="format" value="\s+$"/> <property name="format" value="\s+$"/>
<property name="message" value="trailing whitespace"/>
</module> </module>
<!-- Prohibit consecutive empty lines (except the lines after package/import) -->
<module name="RegexpMultiline">
<property name="format" value="\n *(?!package )(?!import )[^\n]+\n{3,}"/>
<property name="message" value="two or more consecutive empty lines"/>
</module>
<!-- Prohibit an empty after { or before } -->
<module name="RegexpMultiline">
<property name="format" value="\n\n\s+\}[^\n]{0,10}\n"/>
<property name="message" value="an empty line before '}'"/>
</module>
<module name="RegexpMultiline">
<property name="format" value="\n\s+[^\n]{1,8}\{\n\n"/>
<property name="message" value="an empty line after a short line that ends with '{'"/>
</module>
<module name="TreeWalker"> <module name="TreeWalker">
<module name="LineLength"> <module name="LineLength">