我正在尝试将 checkstyle 用于 java 项目,但我似乎无法使其正常工作:
虽然它显然运行顺利,但 html 报告并没有按应有的方式为每个作者提供任何信息,即作者表是空的。
问题是我不知道 checkstyle 如何识别作者。它是否查看 java doc 标签 @author ?在类级别还是在方法级别?
我使用的蚂蚁任务如下:
<taskdef resource="checkstyletask.properties" classpath="${libs.dir}/checkstyle-all-5.0.jar"/>
<target name="checkstyle" description="Generates a report of code convention violations.">
<mkdir dir="${checkstyle.dir}"/>
<checkstyle config="${util.dir}/checkstyle/sun_checks.xml" failureProperty="checkstyle.failure" failOnViolation="false">
<formatter type="xml" tofile="${checkstyle.dir}/checkstyle_report.xml"/>
<fileset dir="${src.dir}" includes="**/*.java"/>
</checkstyle>
<xslt in="${checkstyle.dir}/checkstyle_report.xml" out="${checkstyle.dir}/checkstyle_report.html" style="${util.dir}/checkstyle/checkstyle-author.xsl"/>
</target>
非常感谢您的帮助
大卫