Make Windows-friendly
* SuppressionFilter now replaces \ with / before patterh matching * Added strict UNIX line separator check * Revived NewlineAtEndOfFile check with UNIX line separator * Confirmed checkstyle doesn't complain anymore in Windows
This commit is contained in:
parent
735aa8ff45
commit
381814f6da
@ -10,7 +10,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck;
|
||||
|
||||
public class SuppressionFilter extends AutomaticBean implements Filter {
|
||||
|
||||
private static final Pattern JAVA5PATTERN = Pattern.compile("[\\\\/]org[\\\\/]jboss[\\\\/]");
|
||||
private static final Pattern JAVA5PATTERN = Pattern.compile("/org/jboss/");
|
||||
|
||||
private Pattern pattern;
|
||||
private Pattern examplePattern = Pattern.compile("examples?");
|
||||
@ -25,16 +25,17 @@ public class SuppressionFilter extends AutomaticBean implements Filter {
|
||||
|
||||
@Override
|
||||
public boolean accept(AuditEvent evt) {
|
||||
if (JAVA5PATTERN.matcher(evt.getFileName()).find()) {
|
||||
String filename = evt.getFileName().replace('\\', '/');
|
||||
if (JAVA5PATTERN.matcher(filename).find()) {
|
||||
if (evt.getSourceName().endsWith("MissingOverrideCheck")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (pattern.matcher(evt.getFileName()).find()) {
|
||||
if (pattern.matcher(filename).find()) {
|
||||
return false;
|
||||
}
|
||||
if (examplePattern.matcher(evt.getFileName()).find()) {
|
||||
if (examplePattern.matcher(filename).find()) {
|
||||
if (evt.getSourceName().endsWith(".JavadocPackageCheck")) {
|
||||
return false;
|
||||
}
|
||||
|
@ -9,8 +9,7 @@
|
||||
<module name="FileTabCharacter"/>
|
||||
<module name="JavadocPackage"/>
|
||||
<module name="NewlineAtEndOfFile">
|
||||
<!-- Ignore as this is not possible in windows -->
|
||||
<property name="severity" value="ignore" />
|
||||
<property name="lineSeparator" value="lf" />
|
||||
</module>
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="^(\s|\*)*Copyright\s+[0-9]+\s+The Netty Project\s*$"/>
|
||||
@ -21,6 +20,10 @@
|
||||
<property name="format" value="(@(author|version)|\(non-Javadoc\))"/>
|
||||
<property name="ignoreCase" value="true"/>
|
||||
</module>
|
||||
<!-- Force UNIX line separator -->
|
||||
<module name="RegexpSingleline">
|
||||
<property name="format" value="\r"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="WhitespaceAfter"/>
|
||||
|
Loading…
Reference in New Issue
Block a user