Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkstyle seems to be broken #156

Open
fgalan opened this issue Jan 24, 2020 · 0 comments
Open

Checkstyle seems to be broken #156

fgalan opened this issue Jan 24, 2020 · 0 comments

Comments

@fgalan
Copy link
Member

fgalan commented Jan 24, 2020

(Rasied in #151 (comment))

It seems that the checkstyle pass (based in telefonica_checkstyle.xml ruleset) is not working. Although the pom.xml is supposedly configured to use it, it seems that mvn checkstyle:check uses the default sun_checks.xml ruleset.

I did an attemp of fixing it, but not sure if it's ok. I'm including it below, it could be a good starting point.

diff --git a/pom.xml b/pom.xml
index a210429..d8bcaea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,7 +41,8 @@
             **/src/main/java/org/json/**, org/json/**
         </sonar.exclusions>
         <sonar.language>java</sonar.language>
-        <sonar.dynamic>reuseReports</sonar.dynamic>
+	<sonar.dynamic>reuseReports</sonar.dynamic>
+	<checkstyle.config.location>telefonica_checkstyle.xml</checkstyle.config.location>
     </properties>
 
     <build>
@@ -121,6 +122,11 @@
                 <configuration>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <version>3.0.0</version>
+            </plugin>
         </plugins>
     </build>
     <reporting>
@@ -146,9 +152,7 @@
                 <artifactId>maven-checkstyle-plugin</artifactId>
                 <version>3.0.0</version>
                 <configuration>
-                    <configLocation>telefonica_checkstyle.xml</configLocation>
-                    <includeTestSourceDirectory>false</includeTestSourceDirectory>
-                    <failOnViolation>false</failOnViolation>
+		    <configLocation>telefonica_checkstyle.xml</configLocation>
                 </configuration>
             </plugin>
             <plugin>
diff --git a/telefonica_checkstyle.xml b/telefonica_checkstyle.xml
index 5a6539e..1dfab02 100644
--- a/telefonica_checkstyle.xml
+++ b/telefonica_checkstyle.xml
@@ -196,7 +196,7 @@
         <module name="MagicNumber"/>
         -->
         <module name="MissingSwitchDefault"/>
-        <module name="RedundantThrows"/>
+        <!--module name="RedundantThrows"/-->
         <module name="SimplifyBooleanExpression"/>
         <module name="SimplifyBooleanReturn"/>
 
@@ -229,4 +229,4 @@
         </module>
     </module>
 
-</module>
\ No newline at end of file
+</module>

Ideally, checkstyle should be included in .travis.yml.

@fgalan fgalan changed the title Checkstyle seems to broken Checkstyle seems to be broken Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant