--- /dev/null
+<?xml version="1.0"?>\r
+<!DOCTYPE module PUBLIC\r
+ "-//Puppy Crawl//DTD Check Configuration 1.3//EN"\r
+ "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">\r
+\r
+<!-- Checkstyle configuration for Vaadin that is based on the the sun coding\r
+ conventions from:\r
+ - the Java Language Specification at http://java.sun.com/docs/books/jls/second_edition/html/index.html\r
+ - the Sun Code Conventions at http://java.sun.com/docs/codeconv/\r
+ - the Javadoc guidelines at http://java.sun.com/j2se/javadoc/writingdoccomments/index.html\r
+ - the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html\r
+ - some best practices Vaadin specific changes:\r
+ - Removed DoubleCheckedLocking because it doesn't work in CheckStyle 5.6\r
+ -> http://www.smartics.eu/bugzilla/show_bug.cgi?id=593\r
+ - Modified HiddenField Check to allow field shadowing on Constructor, Setter\r
+ and Abstract Method parameters.\r
+ - Modified StaticVariableName Check format for PUBLIC variables from ^[a-z][a-zA-Z0-9]*$\r
+ to ^[A-Z_]*$ . Others (protected, package and private) still have ^[a-z][a-zA-Z0-9]*$\r
+ - Modified the severity of the following Checks from error to info:\r
+ • JavadocPackage (checks for package-info.java)\r
+ • JavadocType (class and interface declarations, scope private)\r
+ • JavadocMethod (method declarations, scope private)\r
+ • JavadocVariable (variable declarations, scope private)\r
+ • JavadocStyle (Javadocs are "well formed")\r
+ - Modified the severity of the following Checks from error to warning because\r
+ not so critical:\r
+ • LineLenght (the default value is 80 which is also used in formatter, but\r
+ i.e. member declarations are not wrapped onto next line)\r
+ • RedundantModifier (i.e. using public in interface method declarations)\r
+ • RedundantThrows (causes unnecessary fails when can't get class information)\r
+ • MethodLength (default maxLength is 150)\r
+ • ParameterNumber (default maxLength is 7)\r
+ • EmptyBlock (if-else statements have some blocks if x -> no action)\r
+ • UpperEll (should use L instead of l with long)\r
+ • TodoComment (not serious)\r
+ • WhitespaceAroundCheck (expects whitespace around some operators)\r
+ NOTE other checks are also warning but should be error.\r
+ - Modified the severity of the following Checks from error to ignore:\r
+ • FinalParameters (method parameters can be modified)\r
+ • VisibilityModifier (i.e. in state classes public members are allowed)\r
+ • DesignForExtension (this design is not used)\r
+ • FileLength (bad design to have files with over 2000 lines? see VScrollTable)\r
+ • MagicNumber (MagicNumbers like error codes are used, but could just ignore\r
+ this in some classes)\r
+ • AvoidInlineConditionals ( you like these ? ignore : error ) -->\r
+\r
+<module name="Checker">\r
+ <!-- If you set the basedir property below, then all reported file names\r
+ will be relative to the specified directory. See http://checkstyle.sourceforge.net/5.x/config.html#Checker\r
+ <property name="basedir" value="${basedir}"/> -->\r
+\r
+ <!-- Checks that a package-info.java file exists for each package. -->\r
+ <!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->\r
+ <module name="JavadocPackage">\r
+ <property name="severity" value="info" />\r
+ </module>\r
+\r
+ <!-- Checks whether files end with a new line. -->\r
+ <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->\r
+ <module name="NewlineAtEndOfFile">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+\r
+\r
+ <!-- Checks that property files contain the same keys. -->\r
+ <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->\r
+ <module name="Translation">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+\r
+ <!-- Checks for Size Violations. -->\r
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->\r
+ <module name="FileLength">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+\r
+ <!-- Checks for whitespace -->\r
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->\r
+ <module name="FileTabCharacter">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+\r
+ <!-- Checks for Headers -->\r
+ <!-- See http://checkstyle.sf.net/config_header.html -->\r
+ <module name="Header">\r
+ <property name="headerFile" value="${checkstyle.header.file}" />\r
+ <property name="fileExtensions" value="java" />\r
+ </module>\r
+\r
+ <module name="TreeWalker">\r
+ <property name="severity" value="warning" />\r
+\r
+ <!-- Custom checks to check serializable, neither is working because checkstyle\r
+ can't load the classes. <module name="com.vaadin.checks.CheckClassesSerializable"/>\r
+ <module name="com.vaadin.checks.IsSerializableClassCheck"/> -->\r
+\r
+ <!-- Checks for Javadoc comments. -->\r
+ <!-- See http://checkstyle.sf.net/config_javadoc.html -->\r
+ <module name="JavadocMethod">\r
+ <property name="severity" value="info" />\r
+ </module>\r
+ <module name="JavadocType">\r
+ <property name="severity" value="info" />\r
+ </module>\r
+ <module name="JavadocVariable">\r
+ <property name="severity" value="info" />\r
+ </module>\r
+ <module name="JavadocStyle">\r
+ <property name="severity" value="info" />\r
+ </module>\r
+\r
+ <!-- Checks for Naming Conventions. -->\r
+ <!-- See http://checkstyle.sf.net/config_naming.html -->\r
+ <module name="ConstantName" />\r
+ <module name="LocalFinalVariableName" />\r
+ <module name="LocalVariableName" />\r
+ <module name="MemberName" />\r
+ <module name="MethodName" />\r
+ <module name="PackageName" />\r
+ <module name="ParameterName" />\r
+ <module name="StaticVariableName">\r
+ <property name="applyToPublic" value="false" />\r
+ </module>\r
+ <module name="StaticVariableName">\r
+ <property name="applyToPublic" value="true" />\r
+ <property name="applyToProtected" value="false" />\r
+ <property name="applyToPackage" value="false" />\r
+ <property name="applyToPrivate" value="false" />\r
+ <property name="format" value="^[A-Z_]*$" />\r
+ </module>\r
+ <module name="TypeName" />\r
+\r
+\r
+ <!-- Checks for imports -->\r
+ <!-- See http://checkstyle.sf.net/config_import.html -->\r
+ <module name="AvoidStarImport" />\r
+ <module name="IllegalImport" /> <!-- defaults to sun.* packages -->\r
+ <module name="RedundantImport" />\r
+ <module name="UnusedImports" />\r
+\r
+\r
+ <!-- Checks for Size Violations. -->\r
+ <!-- See http://checkstyle.sf.net/config_sizes.html -->\r
+ <module name="LineLength">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ <module name="MethodLength">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ <module name="ParameterNumber">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+\r
+\r
+ <!-- Checks for whitespace -->\r
+ <!-- See http://checkstyle.sf.net/config_whitespace.html -->\r
+ <module name="EmptyForIteratorPad" />\r
+ <module name="GenericWhitespace" />\r
+ <module name="MethodParamPad" />\r
+ <module name="NoWhitespaceAfter" />\r
+ <module name="NoWhitespaceBefore" />\r
+ <module name="OperatorWrap" />\r
+ <module name="ParenPad" />\r
+ <module name="TypecastParenPad" />\r
+ <module name="WhitespaceAfter" />\r
+ <module name="WhitespaceAround" />\r
+ <!-- Check for trailing white space in Java code -->\r
+ <module name="RegexpSinglelineJava">\r
+ <!-- Ensure no whitespace at the end of line, excluding comments -->\r
+ <property name="format" value="\s+$" />\r
+ <property name="minimum" value="0" />\r
+ <property name="maximum" value="0" />\r
+ <property name="message" value="Java code has trailing white space." />\r
+ <property name="severity" value="warning" />\r
+ <property name="ignoreComments" value="true" />\r
+ </module>\r
+\r
+ <!-- Modifier Checks -->\r
+ <!-- See http://checkstyle.sf.net/config_modifiers.html -->\r
+ <module name="ModifierOrder" />\r
+ <module name="RedundantModifier">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+\r
+\r
+ <!-- Checks for blocks. You know, those {}'s -->\r
+ <!-- See http://checkstyle.sf.net/config_blocks.html -->\r
+ <module name="AvoidNestedBlocks" />\r
+ <module name="EmptyBlock">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ <module name="LeftCurly" />\r
+ <module name="NeedBraces" />\r
+ <module name="RightCurly" />\r
+\r
+\r
+ <!-- Checks for common coding problems -->\r
+ <!-- See http://checkstyle.sf.net/config_coding.html -->\r
+ <module name="AvoidInlineConditionals">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+ <module name="EmptyStatement" />\r
+ <module name="EqualsHashCode" />\r
+ <module name="HiddenField">\r
+ <property name="ignoreConstructorParameter" value="true" />\r
+ <property name="ignoreSetter" value="true" />\r
+ <property name="ignoreAbstractMethods" value="true" />\r
+ </module>\r
+ <module name="IllegalInstantiation" />\r
+ <module name="InnerAssignment" />\r
+ <module name="MagicNumber">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+ <module name="MissingSwitchDefault" />\r
+ <module name="RedundantThrows">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ <module name="SimplifyBooleanExpression" />\r
+ <module name="SimplifyBooleanReturn" />\r
+\r
+ <!-- Checks for class design -->\r
+ <!-- See http://checkstyle.sf.net/config_design.html -->\r
+ <module name="DesignForExtension">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+ <module name="FinalClass" />\r
+ <module name="HideUtilityClassConstructor" />\r
+ <module name="InterfaceIsType" />\r
+ <module name="VisibilityModifier">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+\r
+\r
+ <!-- Miscellaneous other checks. -->\r
+ <!-- See http://checkstyle.sf.net/config_misc.html -->\r
+ <module name="ArrayTypeStyle" />\r
+ <module name="FinalParameters">\r
+ <property name="severity" value="ignore" />\r
+ </module>\r
+ <module name="TodoComment">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ <module name="UpperEll">\r
+ <property name="severity" value="warning" />\r
+ </module>\r
+ \r
+ <!-- Check for System.err/out.println -->\r
+ <module name="RegexpSinglelineJava">\r
+ <property name="format" value="System\.out\.println"/>\r
+ </module>\r
+ <module name="RegexpSinglelineJava">\r
+ <property name="format" value="System\.err\.println"/>\r
+ </module>\r
+\r
+ </module>\r
+\r
+</module>\r