Skip to content

Commit

Permalink
[RESTEASY-1974] Update checkstyle.xml and enable checkstyle by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Terem authored and asoldano committed Nov 16, 2018
1 parent 066939d commit 7b8e9de
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 46 deletions.
23 changes: 11 additions & 12 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@

<module name="TreeWalker">

<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="@cs-: (\w+) \((\w|\s)+\)"/>
<property name="checkFormat" value="$1"/>
<property name="influenceFormat" value="0"/>
</module>

<property name="cacheFile" value="${checkstyle.cache.file}"/>

<!-- Checks for imports -->
Expand Down Expand Up @@ -88,23 +82,28 @@
<module name="ArrayTypeStyle"/>

<!-- Checks for System.out -->
<module name="Regexp">
<module name="RegexpSinglelineJava">
<property name="format" value="System\.out"/>
<property name="illegalPattern" value="true"/>
<property name="ignoreComments" value="true"/>
</module>

<!-- Checks for System.err -->
<module name="Regexp">
<module name="RegexpSinglelineJava">
<property name="format" value="System\.err"/>
<property name="illegalPattern" value="true"/>
<property name="ignoreComments" value="true"/>
</module>

<!-- Checks for printStackTrace -->
<module name="Regexp">
<module name="RegexpSinglelineJava">
<property name="format" value="printStackTrace\(\)"/>
<property name="illegalPattern" value="true"/>
<property name="ignoreComments" value="true"/>
</module>

<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
<property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>
</module>

</module>
Expand Down
56 changes: 22 additions & 34 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,40 +190,6 @@
</dependencies>
</dependencyManagement>
</profile>
<profile>
<id>checkstyle</id>
<activation>
<property>
<name>checkstyle</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${version.checkstyle.plugin}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<excludes>**/*$logger.java,**/*$bundle.java</excludes>
<useFile/>
</configuration>
<executions>
<execution>
<id>check-style</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>travis</id>
<activation>
Expand Down Expand Up @@ -340,6 +306,28 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${version.checkstyle.plugin}</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<excludes>**/*$logger.java,**/*$bundle.java</excludes>
<useFile/>
</configuration>
<executions>
<execution>
<id>check-style</id>
<phase>compile</phase>
<goals>
<goal>checkstyle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 7b8e9de

Please sign in to comment.