You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gi...@apache.org on 2018/06/08 04:45:48 UTC

ant-ivyde git commit: Sync Checkstyle setup with Ivy

Repository: ant-ivyde
Updated Branches:
  refs/heads/master 42e704e2e -> ec7fad920


Sync Checkstyle setup with Ivy

Project: http://git-wip-us.apache.org/repos/asf/ant-ivyde/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivyde/commit/ec7fad92
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivyde/tree/ec7fad92
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivyde/diff/ec7fad92

Branch: refs/heads/master
Commit: ec7fad92014acc24db4a0cab2c8fd79b64e7d3ca
Parents: 42e704e
Author: Gintas Grigelionis <gi...@apache.org>
Authored: Fri Jun 8 06:45:34 2018 +0200
Committer: Gintas Grigelionis <gi...@apache.org>
Committed: Fri Jun 8 06:45:34 2018 +0200

----------------------------------------------------------------------
 build.xml                                       | 34 ++++++++++++++++----
 .../src/etc/checkstyle/checkstyle-config        | 13 +++++---
 2 files changed, 35 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/ec7fad92/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 7b209f0..4213297 100644
--- a/build.xml
+++ b/build.xml
@@ -66,7 +66,7 @@
     </target>
 
     <target name="init-asciidoctor-extensions" depends="init-ivy" unless="skip.doc">
-        <ivy:cachepath pathid="asciidoctorj.path" organisation="org.asciidoctor" module="asciidoctorj" revision="1.5.5" inline="true"/>
+        <ivy:cachepath pathid="asciidoctorj.path" organisation="org.asciidoctor" module="asciidoctorj" revision="1.5.6" inline="true"/>
         <mkdir dir="${work.dir}/asciidoc-extensions/classes"/>
         <javac srcdir="${doc.dir}/extensions/src" destdir="${work.dir}/asciidoc-extensions/classes"
                debug="true" includeantruntime="no" classpathref="asciidoctorj.path"/>
@@ -510,21 +510,41 @@ You have to specify the Ivy to install with one of the following property:
         ======================================================================================
     -->
 
-    <target name="checkstyle" depends="init-ivy" description="Generate checkstyle report">
-        <ivy:cachepath organisation="checkstyle" module="checkstyle" revision="5.0"
+    <target name="checkstyle-internal" depends="init-ivy" description="Generate checkstyle report">
+        <ivy:cachepath organisation="com.puppycrawl.tools" module="checkstyle" revision="7.8.2"
                        inline="true" conf="default" pathid="checkstyle.classpath" transitive="true"/>
-        <taskdef resource="checkstyletask.properties" classpathref="checkstyle.classpath"/>
+        <taskdef uri="antlib:com.puppycrawl.tools.checkstyle.ant"
+                 resource="com/puppycrawl/tools/checkstyle/ant/antlib.xml" classpathref="checkstyle.classpath"/>
 
         <mkdir dir="${checkstyle.report.dir}"/>
-        <checkstyle config="${checkstyle.src.dir}/checkstyle-config" failOnViolation="false" failureProperty="checkstyle.failed">
+        <property name="src.dir" value="org.apache.ivyde.eclipse/src/java"/>
+        <cs:checkstyle xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant"
+                       config="${checkstyle.src.dir}/checkstyle-config"
+                       failOnViolation="false" failureProperty="checkstyle.failed">
             <classpath>
                 <path refid="checkstyle.classpath"/>
             </classpath>
             <formatter type="xml" toFile="${checkstyle.report.dir}/checkstyle.xml"/>
-            <fileset dir="org.apache.ivyde.eclipse/src/java">
+            <fileset dir="${src.dir}">
                 <include name="**/*.java"/>
             </fileset>
-        </checkstyle>
+        </cs:checkstyle>
+    </target>
+
+    <target name="checkstyle" depends="checkstyle-internal"
+            description="checks Ivy codebase according to ${checkstyle.src.dir}/checkstyle-config">
+        <fail if="checkstyle.failed"
+              message="Checkstyle has errors. See report in ${checkstyle.report.dir}"/>
+    </target>
+
+    <target name="checkstyle-report" depends="checkstyle-internal">
+        <property name="checkstyle.basedir" location="${src.dir}"/>
+        <xslt in="${checkstyle.report.dir}/checkstyle.xml"
+              style="${checkstyle.src.dir}/checkstyle-frames.xsl"
+              out="${checkstyle.report.dir}/output.txt">
+            <param name="basedir" expression="${checkstyle.basedir}"/>
+            <param name="output.dir" expression="${checkstyle.report.dir}"/>
+        </xslt>
     </target>
 
     <!--

http://git-wip-us.apache.org/repos/asf/ant-ivyde/blob/ec7fad92/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
----------------------------------------------------------------------
diff --git a/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config b/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
index 8cd7fd5..ebfb5d8 100644
--- a/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
+++ b/org.apache.ivyde.eclipse/src/etc/checkstyle/checkstyle-config
@@ -25,7 +25,7 @@
     <property name="ignoreLines" value="2"/>
   </module>
   <module name="FileLength"/>
-  <module name="FileTabCharacterCheck"/>
+  <module name="FileTabCharacter"/>
   <module name="TreeWalker">
     <!-- Javadoc requirements -->
     <!-- TODO uncomment this when javadoc will be improved
@@ -100,9 +100,11 @@
     <module name="InnerAssignment"/>
     <module name="MagicNumber"/>
     <module name="MissingSwitchDefault"/>
+    <!-- Allow redundant throw declarations for doc purposes
     <module name="RedundantThrows">
       <property name="allowUnchecked" value="true"/>
     </module>
+    -->
     <module name="SimplifyBooleanExpression"/>
     <module name="SimplifyBooleanReturn"/>
 
@@ -129,11 +131,12 @@
     <module name="FileContentsHolder"/>
   </module>
 
-  <!--TODO: comment this out, if Simian is not present -->
-  <!--
-  <module name="au.com.redhillconsulting.simian.SimianCheck"/>
-  -->
+  <module name="RegexpSingleline">
+    <!-- \s matches whitespace character, $ matches end of line. -->
+    <property name="format" value="\s+$"/>
+  </module>
 
+  <!-- <module name="au.com.redhillconsulting.simian.SimianCheck"/> -->
   <module name="SuppressionCommentFilter">
     <property name="offCommentFormat" value="CheckStyle\:([\w\|]+) *OFF"/>
     <property name="onCommentFormat" value="CheckStyle\:([\w\|]+) *ON"/>