Added checkstyle
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 6 Dec 2006 22:11:47 +0000 (22:11 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 6 Dec 2006 22:11:47 +0000 (22:11 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2081 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

.checkstyle [new file with mode: 0644]
.project
.settings/org.eclipse.jdt.ui.prefs
build-lib/checkstyle-all-4.2.jar [new file with mode: 0644]
build.xml
checkstyle.xml [new file with mode: 0644]

diff --git a/.checkstyle b/.checkstyle
new file mode 100644 (file)
index 0000000..731d9f1
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fileset-config file-format-version="1.2.0" simple-config="true">
+    <local-check-config name="Internet 2" location="checkstyle.xml" type="project" description="Coding standards for Internet 2 code">
+        <additional-data name="protect-config-file" value="true"/>
+    </local-check-config>
+    <fileset name="all" enabled="true" check-config-name="Internet 2" local="true">
+        <file-match-pattern match-pattern="." include-pattern="true"/>
+    </fileset>
+    <filter name="FileTypesFilter" enabled="true">
+        <filter-data value="java"/>
+    </filter>
+</fileset-config>
index a958096..94f9b58 100644 (file)
--- a/.project
+++ b/.project
                        <arguments>
                        </arguments>
                </buildCommand>
+               <buildCommand>
+                       <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.team.cvs.core.cvsnature</nature>
                <nature>com.sysdeo.eclipse.tomcat.tomcatnature</nature>
+               <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
        </natures>
 </projectDescription>
index df8328d..587c36f 100644 (file)
@@ -1,6 +1,6 @@
-#Wed Nov 15 19:40:04 EST 2006
+#Thu Nov 30 08:32:18 EST 2006
 eclipse.preferences.version=1
-formatter_profile=_Internet2 Format
+formatter_profile=_Georgetown
 formatter_settings_version=10
 org.eclipse.jdt.ui.exception.name=e
 org.eclipse.jdt.ui.gettersetter.use.is=true
diff --git a/build-lib/checkstyle-all-4.2.jar b/build-lib/checkstyle-all-4.2.jar
new file mode 100644 (file)
index 0000000..35865ca
Binary files /dev/null and b/build-lib/checkstyle-all-4.2.jar differ
index 2fba2f9..dc388c3 100755 (executable)
--- a/build.xml
+++ b/build.xml
        <property name="dist" value="${root}/dist/" />
        <property name="docs" value="${root}/doc/" />
        <property name="javadocs" value="${docs}/api/" />
+       <property name="reports.dir" value="${docs}/reports" />
+       <property name="test-report.dir" value="${reports.dir}/unit-test" />
 
        <property name="year" value="2002-2005"/>
        <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
 
        <!-- antcontrib tasks -->
-       <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildlibs}/ant-contrib.jar"/>
+       <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+       
+       <!-- Load Checkstyle tasks -->
+       <taskdef resource="checkstyletask.properties" />
 
        <!-- Import the tasks for building custom extensions -->
        <import file="${custom}/extension-build.xml"/>
                <delete dir="${tomcat.home}/webapps/${idp.webapp.name}" />
        </target>
        
-</project>
+       <!-- Checks code against style guidelines -->
+       <target name="checkstyle" >
+               <mkdir dir="${reports.dir}" />
+               
+               <checkstyle config="${basedir}/checkstyle.xml"
+                                       failOnViolation="false"
+                       classpathref="build-path">
+                       <fileset dir="src" includes="**/*.java"/>
+                       <formatter type="plain"
+                                          toFile="${reports.dir}/checkstyle-report.txt" />
+               </checkstyle>
+       </target>
+       
+</project>
\ No newline at end of file
diff --git a/checkstyle.xml b/checkstyle.xml
new file mode 100644 (file)
index 0000000..e5f7dee
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+       This configuration file was written by the eclipse-cs plugin configuration editor
+-->
+<!--
+Checkstyle-Configuration: Internet2
+Description:
+Internet2 project checks
+-->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+    <property name="severity" value="warning"/>
+    <module name="TreeWalker">
+        <property name="tabWidth" value="4"/>
+        <module name="JavadocMethod">
+            <property name="allowUndeclaredRTE" value="true"/>
+            <property name="allowThrowsTagsForSubclasses" value="true"/>
+        </module>
+        <module name="JavadocType"/>
+        <module name="JavadocVariable"/>
+        <module name="JavadocStyle">
+            <property name="checkEmptyJavadoc" value="true"/>
+        </module>
+        <module name="ConstantName"/>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName"/>
+        <module name="AvoidStarImport"/>
+        <module name="IllegalImport"/>
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+        <module name="FileLength">
+            <property name="max" value="1000"/>
+        </module>
+        <module name="LineLength">
+            <property name="max" value="120"/>
+        </module>
+        <module name="MethodLength">
+            <property name="max" value="50"/>
+        </module>
+        <module name="ParameterNumber">
+            <property name="max" value="5"/>
+        </module>
+        <module name="EmptyForIteratorPad"/>
+        <module name="MethodParamPad"/>
+        <module name="TabCharacter"/>
+        <module name="ModifierOrder"/>
+        <module name="AvoidNestedBlocks"/>
+        <module name="EmptyBlock"/>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+        <module name="AvoidInlineConditionals"/>
+        <module name="DoubleCheckedLocking"/>
+        <module name="EmptyStatement"/>
+        <module name="EqualsHashCode"/>
+        <module name="HiddenField"/>
+        <module name="IllegalInstantiation"/>
+        <module name="InnerAssignment"/>
+        <module name="MagicNumber"/>
+        <module name="MissingSwitchDefault"/>
+        <module name="RedundantThrows"/>
+        <module name="SimplifyBooleanExpression"/>
+        <module name="SimplifyBooleanReturn"/>
+        <module name="FinalClass"/>
+        <module name="HideUtilityClassConstructor"/>
+        <module name="InterfaceIsType"/>
+        <module name="VisibilityModifier"/>
+        <module name="ArrayTypeStyle"/>
+        <module name="UpperEll"/>
+        <module name="AbstractClassName">
+            <property name="format" value="^Abstract.*$|^Base.*$"/>
+        </module>
+        <module name="AnonInnerLength"/>
+        <module name="EmptyForInitializerPad"/>
+        <module name="CovariantEquals"/>
+        <module name="DefaultComesLast"/>
+        <module name="DeclarationOrder"/>
+        <module name="ExplicitInitialization"/>
+        <module name="FallThrough"/>
+        <module name="IllegalCatch"/>
+        <module name="IllegalThrows"/>
+        <module name="JUnitTestCase"/>
+        <module name="MultipleVariableDeclarations"/>
+        <module name="PackageDeclaration"/>
+        <module name="ParameterAssignment"/>
+        <module name="ReturnCount">
+            <property name="max" value="4"/>
+        </module>
+        <module name="StringLiteralEquality"/>
+        <module name="SuperFinalize"/>
+        <module name="ArrayTrailingComma"/>
+        <module name="UnnecessaryParentheses"/>
+        <module name="MutableException"/>
+        <module name="ThrowsCount">
+            <property name="max" value="3"/>
+        </module>
+        <module name="CyclomaticComplexity">
+            <property name="max" value="7"/>
+        </module>
+        <module name="TrailingComment"/>
+    </module>
+    <module name="PackageHtml">
+        <property name="fileExtensions" value="html"/>
+    </module>
+</module>