Kaynağa Gözat

Checkstyle stuff

Remove targets for individual weird bits of the codebase
Add in code from submodules
Include checkstyle jar in the lib directory
Update rules for checkstyle 5.3

Change-Id: I85b5a53165fcef05bb176d4f5e93aa6ae3cf562a
Reviewed-on: http://gerrit.dmdirc.com/1747
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5rc1
Chris Smith 13 yıl önce
ebeveyn
işleme
6b6cec7c83
4 değiştirilmiş dosya ile 19 ekleme ve 153 silme
  1. 1
    0
      .gitignore
  2. 11
    127
      build-reports.xml
  3. 7
    26
      checkstyle/dmdirc_checks.xml
  4. BIN
      lib/checkstyle-5.3-all.jar

+ 1
- 0
.gitignore Dosyayı Görüntüle

@@ -29,6 +29,7 @@ __history
29 29
 /reports/findbugs/
30 30
 /reports/report-fb.html
31 31
 /reports/report-pmd.*
32
+/reports/checkstyle.*
32 33
 /lib/clover.license
33 34
 /.clover
34 35
 /test_profile

+ 11
- 127
build-reports.xml Dosyayı Görüntüle

@@ -7,142 +7,26 @@
7 7
     <target name="domostreports" depends="test-both,-mostreports,javadoc"
8 8
             description="Run all reports except Findbugs." />
9 9
 
10
-    <target name="checkstyle" depends="checkstyle-all, checkstyle-actions,
11
-                                       checkstyle-core,
12
-                                       checkstyle-commandparser,
13
-                                       checkstyle-config, checkstyle-logger,
14
-                                       checkstyle-parser, checkstyle-plugins,
15
-                                       checkstyle-ui, -remove-xml-files,
16
-                                       -move-index"
17
-            description="Run checkstyle." /> 
10
+    <target name="checkstyle" depends="checkstyle-all, -move-index" description="Run checkstyle." /> 
18 11
 
19 12
     <target name="-allreports" depends="findbugs, cpd, pmd, checkstyle" /> 
20 13
     <target name="-mostreports" depends="cpd, pmd, checkstyle" /> 
21
-    
22
-    <target name="checkstyle-plugins">
23
-        <taskdef resource="checkstyletask.properties"
24
-                         classpath="checkstyle-all-4.3.jar"/>
25
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
26
-                                failOnViolation="false">
27
-            <fileset dir="src/com/dmdirc/plugins/" includes="**/*.java"/>
28
-            <formatter type="xml" tofile="reports/report-plugins.xml"/>
29
-            
30
-        </checkstyle>
31
-        <xslt in="reports/report-plugins.xml" out="reports/report-plugins.html" style="checkstyle/checkstyle.xsl"/>
32
-    </target>
33
-    
34
-    <target name="checkstyle-actions">
35
-        <taskdef resource="checkstyletask.properties"
36
-                         classpath="checkstyle.jar"/>
37
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
38
-                                failOnViolation="false">
39
-            <fileset dir="src/com/dmdirc/actions/" includes="**/*.java"/>
40
-            <formatter type="xml" tofile="reports/report-actions.xml"/>
41
-            
42
-        </checkstyle>
43
-        <xslt in="reports/report-actions.xml" out="reports/report-actions.html" style="checkstyle/checkstyle.xsl"/>
44
-    </target>            
45
-    
46
-    <target name="checkstyle-ui">
47
-        <taskdef resource="checkstyletask.properties"
48
-                         classpath="checkstyle.jar"/>
49
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
50
-                                failOnViolation="false">
51
-            <fileset dir="src/com/dmdirc/ui/" includes="**/*.java"/>
52
-            <formatter type="xml" tofile="reports/report-ui.xml"/>
53
-        </checkstyle>
54
-        
55
-        <xslt in="reports/report-ui.xml" out="reports/report-ui.html" style="checkstyle/checkstyle.xsl"/>
56
-    </target>
57
-    
58
-    <target name="checkstyle-parser">
59
-        <taskdef resource="checkstyletask.properties"
60
-                         classpath="checkstyle.jar"/>
61
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
62
-                                failOnViolation="false">
63
-            <fileset dir="modules/parser/src/com/dmdirc/parser/irc/" includes="**/*.java"/>
64
-            <formatter type="xml" tofile="reports/report-parser.xml"/>
65
-        </checkstyle>
66
-        <xslt in="reports/report-parser.xml" out="reports/report-parser.html" style="checkstyle/checkstyle.xsl"/>
67
-
68
-    </target>
69
-
70
-    <target name="checkstyle-addons">
71
-        <taskdef resource="checkstyletask.properties"
72
-                         classpath="checkstyle.jar"/>
73
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
74
-                                failOnViolation="false">
75
-            <fileset dir="modules/addons/src/com/dmdirc/addons/" includes="**/*.java"/>
76
-            <formatter type="xml" tofile="reports/report-addons.xml"/>
77
-        </checkstyle>
78
-        <xslt in="reports/report-addons.xml" out="reports/report-addons.html" style="checkstyle/checkstyle.xsl"/>
79 14
 
15
+    <target name="-init-checkstyle">
16
+        <taskdef resource="checkstyletask.properties" classpath="lib/checkstyle-5.3-all.jar"/>
80 17
     </target>
81 18
     
82
-    <target name="checkstyle-logger">
83
-        <taskdef resource="checkstyletask.properties"
84
-                         classpath="checkstyle.jar"/>
85
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
86
-                                failOnViolation="false">
87
-            <fileset dir="src/com/dmdirc/logger/" includes="**/*.java"/>
88
-            <formatter type="xml" tofile="reports/report-logger.xml"/>
19
+    <target name="checkstyle-all" depends="-init-checkstyle">
20
+        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure" failOnViolation="false">
21
+            <fileset dir="src/" includes="**/*.java" excludes="net/miginfocom/**"/>
22
+            <fileset dir="modules/plugins/src/" includes="**/*.java"/>
23
+            <fileset dir="modules/parser/src/" includes="**/*.java"/>
24
+            <fileset dir="modules/util/src/" includes="**/*.java"/>
25
+            <formatter type="xml" tofile="reports/checkstyle.xml"/>
89 26
         </checkstyle>
90
-        <xslt in="reports/report-logger.xml" out="reports/report-logger.html" style="checkstyle/checkstyle.xsl"/>
27
+        <xslt in="reports/checkstyle.xml" out="reports/checkstyle.html" style="checkstyle/checkstyle.xsl"/>
91 28
     </target>
92 29
     
93
-    
94
-    <target name="checkstyle-config">
95
-        <taskdef resource="checkstyletask.properties"
96
-                         classpath="checkstyle.jar"/>
97
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
98
-                                failOnViolation="false">
99
-            <fileset dir="src/com/dmdirc/config/" includes="**/*.java"/>
100
-            <formatter type="xml" tofile="reports/report-config.xml"/>
101
-        </checkstyle>
102
-        <xslt in="reports/report-config.xml" out="reports/report-config.html" style="checkstyle/checkstyle.xsl"/>
103
-    </target>
104
-    
105
-    <target name="checkstyle-commandparser">
106
-        <taskdef resource="checkstyletask.properties"
107
-                         classpath="checkstyle.jar"/>
108
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
109
-                                failOnViolation="false">
110
-            <fileset dir="src/com/dmdirc/commandparser/" includes="**/*.java"/>
111
-            <formatter type="xml" tofile="reports/report-commandparser.xml"/>
112
-        </checkstyle>
113
-        <xslt in="reports/report-commandparser.xml" out="reports/report-commandparser.html" style="checkstyle/checkstyle.xsl"/>
114
-    </target>
115
-    
116
-    <target name="checkstyle-core">
117
-        <taskdef resource="checkstyletask.properties"
118
-                         classpath="checkstyle.jar"/>
119
-        
120
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
121
-                                failOnViolation="false">
122
-            <fileset dir="src/com/dmdirc/" includes="*.java"/>
123
-            <formatter type="xml" tofile="reports/report-core.xml"/>
124
-        </checkstyle>
125
-        <xslt in="reports/report-core.xml" out="reports/report-core.html" style="checkstyle/checkstyle.xsl"/>
126
-    </target>
127
-    
128
-    <target name="checkstyle-all">
129
-        <taskdef resource="checkstyletask.properties"
130
-                         classpath="checkstyle.jar"/>
131
-        <checkstyle config="checkstyle/dmdirc_checks.xml" failureProperty="checkstyle.failure"
132
-                                failOnViolation="false">
133
-            
134
-            <fileset dir="src/com/dmdirc/" includes="**/*.java"/>
135
-            <formatter type="xml" tofile="reports/report-all.xml"/>
136
-        </checkstyle>
137
-        <xslt in="reports/report-all.xml" out="reports/report-all.html" style="checkstyle/checkstyle.xsl"/>
138
-    </target>
139
-    
140
-    <target name="-remove-xml-files">
141
-        <delete>
142
-            <fileset dir="reports/" includes="*.xml"/>
143
-        </delete>
144
-    </target>
145
-
146 30
     <target name="-move-index">
147 31
         <!-- <copy file="checkstyle/index.html" tofile="reports/index.html"/> -->
148 32
         <copy file="checkstyle/sorttable.js" tofile="reports/sorttable.js"/>

+ 7
- 26
checkstyle/dmdirc_checks.xml Dosyayı Görüntüle

@@ -7,7 +7,7 @@
7 7
 
8 8
     <!-- Checks that a package.html file exists for each package.     -->
9 9
     <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
10
-    <module name="PackageHtml"/>
10
+    <module name="JavadocPackage"/>
11 11
 
12 12
     <!-- Checks whether files end with a new line.                        -->
13 13
     <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
@@ -17,20 +17,20 @@
17 17
     <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
18 18
     <module name="Translation"/>
19 19
 
20
+    <module name="Header">
21
+                <property name="headerFile" value="checkstyle/dmdirc.license"/>
22
+                <property name="ignoreLines" value="2, 21"/>
23
+    </module>
24
+
25
+    <module name="FileLength"/>
20 26
 
21 27
     <module name="TreeWalker">
22
-	    
23 28
 	<module name="ImportOrder">
24 29
 		    <property name="groups" value="com.dmdirc,java,javax"/>
25 30
 		    <property name="ordered" value="true"/>
26 31
 		    <property name="separated" value="true"/>
27 32
 	</module>
28 33
 	    
29
-	<module name="Header">
30
-		    <property name="headerFile" value="checkstyle/dmdirc.license"/>
31
-		    <property name="ignoreLines" value="2, 21"/>
32
-	</module>
33
-
34 34
         <!-- Checks for Javadoc comments.                     -->
35 35
         <!-- See http://checkstyle.sf.net/config_javadoc.html -->
36 36
         <module name="JavadocMethod"/>
@@ -50,25 +50,9 @@
50 50
         <module name="StaticVariableName"/>
51 51
         <module name="TypeName"/>
52 52
 
53
-
54
-        <!-- Checks for Headers                                -->
55
-        <!-- See http://checkstyle.sf.net/config_header.html   -->
56
-        <!-- <module name="Header">                            -->
57
-            <!-- The follow property value demonstrates the ability     -->
58
-            <!-- to have access to ANT properties. In this case it uses -->
59
-            <!-- the ${basedir} property to allow Checkstyle to be run  -->
60
-            <!-- from any directory within a project. See property      -->
61
-            <!-- expansion,                                             -->
62
-            <!-- http://checkstyle.sf.net/config.html#properties        -->
63
-            <!-- <property                                              -->
64
-            <!--     name="headerFile"                                  -->
65
-            <!--     value="${basedir}/java.header"/>                   -->
66
-        <!-- </module> -->
67
-
68 53
         <!-- Following interprets the header file as regular expressions. -->
69 54
         <!-- <module name="RegexpHeader"/>                                -->
70 55
 
71
-
72 56
         <!-- Checks for imports                              -->
73 57
         <!-- See http://checkstyle.sf.net/config_import.html -->
74 58
         <module name="AvoidStarImport"/>
@@ -76,14 +60,11 @@
76 60
         <module name="RedundantImport"/>
77 61
         <module name="UnusedImports"/>
78 62
 
79
-
80 63
         <!-- Checks for Size Violations.                    -->
81 64
         <!-- See http://checkstyle.sf.net/config_sizes.html -->
82
-        <module name="FileLength"/>
83 65
         <module name="MethodLength"/>
84 66
         <module name="ParameterNumber"/>
85 67
 
86
-
87 68
         <!-- Checks for whitespace                               -->
88 69
         <!-- See http://checkstyle.sf.net/config_whitespace.html -->
89 70
         <module name="EmptyForIteratorPad"/>

BIN
lib/checkstyle-5.3-all.jar Dosyayı Görüntüle


Loading…
İptal
Kaydet