简体   繁体   中英

CheckStyle generate html report

I am using CheckStyle tool for generating some reports for a java project. Also, I am using this command(extracted from a sh script)

java -jar ./utilJars/checkstyle-6.5-all.jar -c ./sun_checks.xml -f xml $p >> "$DEST_FOLDER/$REPORT_FILE"

It works fine and it generates a xml report. Now, I need also a html report. I have been looking on their site, but all that I have found is this line:

   Command line usage: 
-f format - specify the output format. Options are "plain" for the DefaultLogger and "xml" for the XMLLogger. Defaults to "plain". 

I guess there must be a way to obtain a html report without parsing manually the xml report and build step by step an html file. Any ideas?

Checkstyle project does not have HTML report generator. You need to generate XML and then use other tools (xslt, .....) to generate HTML. Some xsl to process XML format (I am not sure how they works) - https://github.com/checkstyle/contribution/tree/master/xsl

Alternatively you can use checkstyle-maven-plugin - Here is example of hack over plugin usage https://github.com/checkstyle/contribution/tree/master/checkstyle-tester to get a HTML report.

To use latest Checkstyle and have active links to code lines , please read http://roman-ivanov.blogspot.com/2014/10/how-to-use-snapshot-checkstyle-version.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM