Hi All,

An extremely long time ago I proposed on this list [1] a new set of
Checkstyle rules that we would all agree to follow, so that we can
enforce a no warning policy. Glenn expressed disagreements with some of
the rules.

[1] http://markmail.org/thread/wnevlowocmlcm6xa

A very long time ago I had a Skype discussion with Glenn in order to try
and find a common ground; We agreed that, pending some action from my
part, we would settle on a compromise.

A long time ago I undertook that action and submitted my results to
Glenn, who was ok to proceed with the compromise we had found.

So, today, I’d like to propose this compromise to the rest of the
community and ask if everybody is ok with it. Mainly, we keep the rules
about whitespace that I suggested last year, but we introduce an
exception regarding line length: files originally authored by Glenn are
allowed to disable that rule.

The differences with the Checkstyle file currently in FOP are the
following (see [2] for rule descriptions):
• remove SuppressWithNearbyCommentFilter
• remove EqualsHashCode
• remove NoWhiteSpaceAfter for ARRAY_INIT
• add LineLength
• add MethodParamPad
• add ParenPad
• WhiteSpaceAfter: add TYPECAST
• WhiteSpaceAround: remove DIV and STAR

[2] http://checkstyle.sourceforge.net/availablechecks.html

I would also like to add ExplicitInitialization eventually, once I’ve
figured out an automatic way of removing the existing ones.

Some source files (e.g. o.a.f.complexscripts.bidi.BidiClass) were
automatically generated and are not meant to be human-readable,
therefore I will exclude them from the checks.

I’ll apply lazy consensus and, if nobody objects within 3 working days,
I will start to progressively apply the new rules and enable them in
Checkstyle. Then we can modify Gump to automatically run Checkstyle for
us after every commit.


Thanks,
Vincent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd";>

<!--
    This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
    Checkstyle-Configuration: XML Graphics Conventions V2
    Description: 
Slightly adapted from the Sun conventions.
-->
<module name="Checker">
  <property name="severity" value="warning"/>
  <module name="TreeWalker">
    <module name="FileContentsHolder"/>
    <module name="ConstantName">
      <property name="format" value="^([A-Z](_?[A-Z0-9]+)*)|(log)$"/>
    </module>
    <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="RedundantImport"/>
    <module name="UnusedImports"/>
    <module name="LineLength">
      <property name="max" value="120"/>
    </module>
    <module name="GenericWhitespace"/>
    <module name="MethodParamPad"/>
    <module name="NoWhitespaceAfter">
      <property name="allowLineBreaks" value="false"/>
      <property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
    </module>
    <module name="NoWhitespaceBefore"/>
    <module name="OperatorWrap"/>
    <module name="TypecastParenPad">
      <property name="tokens" value="RPAREN,TYPECAST"/>
    </module>
    <module name="WhitespaceAfter"/>
    <module name="WhitespaceAround">
      <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND,WILDCARD_TYPE"/>
      <property name="ignoreEnhancedForColon" value="false"/>
    </module>
    <module name="ModifierOrder"/>
    <module name="RedundantModifier"/>
    <module name="AvoidNestedBlocks"/>
    <module name="LeftCurly"/>
    <module name="NeedBraces"/>
    <module name="RightCurly"/>
    <module name="EmptyStatement"/>
    <module name="MissingSwitchDefault"/>
    <module name="SimplifyBooleanExpression"/>
    <module name="SimplifyBooleanReturn"/>
    <module name="FinalClass"/>
    <module name="HideUtilityClassConstructor"/>
    <module name="ArrayTypeStyle"/>
    <module name="UpperEll"/>
    <module name="AnnotationUseStyle"/>
    <module name="ImportOrder">
      <property name="groups" value="java,javax,org,org.apache,org.apache.batik,org.apache.xmlgraphics,org.apache.fop,com"/>
      <property name="separated" value="true"/>
    </module>
    <module name="DefaultComesLast"/>
    <module name="MultipleVariableDeclarations"/>
    <module name="OneStatementPerLine"/>
    <module name="EmptyBlock">
      <property name="option" value="text"/>
    </module>
    <module name="ParenPad"/>
    <module name="IllegalImport"/>
    <module name="InnerAssignment"/>
  </module>
  <module name="NewlineAtEndOfFile"/>
  <module name="FileTabCharacter">
    <property name="severity" value="error"/>
    <property name="eachLine" value="true"/>
  </module>
  <module name="RegexpSingleline">
    <property name="format" value="\s+$"/>
    <property name="message" value="Line has trailing spaces."/>
  </module>
  <module name="RegexpHeader">
    <property name="severity" value="error"/>
    <property name="header" value="\/\*\n \* Licensed to the Apache Software Foundation \(ASF\) under one or more\n \* contributor license agreements.  See the NOTICE file distributed with\n \* this work for additional information regarding copyright ownership.\n \* The ASF licenses this file to You under the Apache License, Version 2.0\n \* \(the &quot;License&quot;\); you may not use this file except in compliance with\n \* the License.  You may obtain a copy of the License at\n \*\n \*      http://www.apache.org/licenses/LICENSE-2.0\n \*\n \* Unless required by applicable law or agreed to in writing, software\n \* distributed under the License is distributed on an &quot;AS IS&quot; BASIS,\n \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n \* See the License for the specific language governing permissions and\n \* limitations under the License.\n \*\/\n\n"/>
  </module>
  <module name="SuppressionCommentFilter">
    <property name="offCommentFormat" value="CSOFF: (LineLengthCheck)"/>
    <property name="onCommentFormat" value="CSON: (LineLengthCheck)"/>
    <property name="checkFormat" value="$1"/>
  </module>
  <module name="RegexpSingleline">
    <property name="format" value="@author"/>
    <property name="message" value="Use of @author javadoc keyword is prohibited."/>
  </module>
</module>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to