apache / mina-ftpserver

Apache Mina FTP Server
Apache License 2.0
50 stars 27 forks source link

add checkstyle. #7

Closed XenoAmess closed 2 years ago

XenoAmess commented 2 years ago

you can invoke it by opening profile "enforce", for example, "mvn install -Penforce"

elecharny commented 2 years ago

Applied your patch, and forced the checkstyle version to 9.2.1.

There are many errors to be fixed in the source code now :-)

[INFO] 
[INFO] ------------------< org.apache.ftpserver:ftplet-api >-------------------
[INFO] Building Apache Ftplet API 1.1.3-SNAPSHOT                          [2/8]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.2:checkstyle (default-cli) @ ftplet-api ---
[INFO] There are 383 errors reported by Checkstyle 9.2.1 with sun_checks.xml ruleset.
[INFO] 
[INFO] ----------------< org.apache.ftpserver:ftpserver-core >-----------------
[INFO] Building Apache FtpServer Core 1.1.3-SNAPSHOT                      [3/8]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.2:checkstyle (default-cli) @ ftpserver-core ---
[INFO] There are 4423 errors reported by Checkstyle 9.2.1 with sun_checks.xml ruleset.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] ---------< org.apache.ftpserver.examples:ftpserver-spring-war >---------
[INFO] Building FtpServer Spring web project example 1.1.3-SNAPSHOT       [4/8]
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.2:checkstyle (default-cli) @ ftpserver-spring-war ---
[INFO] There are 48 errors reported by Checkstyle 9.2.1 with sun_checks.xml ruleset.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] ----< org.apache.ftpserver.examples:ftpserver-osgi-ftplet-service >-----
[INFO] Building FtpServer OSGi Ftplet service example 1.1.3-SNAPSHOT      [5/8]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.2:checkstyle (default-cli) @ ftpserver-osgi-ftplet-service ---
[INFO] There are 18 errors reported by Checkstyle 9.2.1 with sun_checks.xml ruleset.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO] 
[INFO] ----< org.apache.ftpserver.examples:ftpserver-osgi-spring-service >-----
[INFO] Building FtpServer OSGi Spring-DM example 1.1.3-SNAPSHOT           [6/8]
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.1.2:checkstyle (default-cli) @ ftpserver-osgi-spring-service ---
[INFO] There are 13 errors reported by Checkstyle 9.2.1 with sun_checks.xml ruleset.
[WARNING] Unable to locate Source XRef to link to - DISABLED
...
elecharny commented 2 years ago

One of the issue is that it does not accept lines longer than 80 chars, despite the configuration that says 160 chars.

Do you have any idea how to get that fixed ?

Thanks !

elecharny commented 2 years ago

Also I'm trying to get rid of errors like:

<error line="33" column="22" severity="error" message="Le paramètre ftpletContext devrait être final." source="com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck"/>

I tried to add it to the checkstyle-suppressions.xml file:

...
<suppress checks="FinalParametersCheck" files=".*"/>
...

but that is not activated...