Hi Greg/Werner,

I use jalopy to reformat all of my java code as part of my ant build script for 
my other projects.

It seems to correct tabbing and general styling errors fine, as long as you 
define your convention.xml file with the right rules for the Castor code 
guidelines.

I have attached a convention.xml file so you can see what Jalopy does/can do.

Hope it helps.

Pat

-----Original Message-----
From: Werner Guttmann [mailto:[EMAIL PROTECTED] 
Sent: 03 August 2005 10:10
To: dev@castor.codehaus.org
Subject: AW: [castor-dev] Checkstyle, and existing source bases....

Greg,

I think I don't go about a general clean-up per se. My rule of thumb: if I am 
working on a feature/bug, I'll be touching files. As I touch them, I checkstyle 
them. And don't forget about the checkstyle integration within Eclipse. 

Werner 

-----Ursprüngliche Nachricht-----
Von: Gregory Block [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 03. August 2005 10:14
An: dev@castor.codehaus.org
Betreff: [castor-dev] Checkstyle, and existing source bases....


... oh my god...

Ok, so I've never seen checkstyle before; went and ran it against my  
codebase.

So how do you go about 'cleaning up' ~600 files worth of hundreds of  
screenfuls of errors??? What do you do for a 'first pass' cleaning  
run to get rid of tabbing and formatting errors?  There's got to be  
some kind of tool that can get rid of the majority of the crap.

What did Castor use when it implemented checkstyle?  Elbow grease?

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<jalopy>
    <general>
        <compliance>
            <version>14</version>
        </compliance>
        <style>
            <description>Sun Java Coding Convention</description>
            <name>Sun</name>
        </style>
    </general>
    <inspector>

        <enable>false</enable>
        <tips>
            <adhereToNamingConvention>false</adhereToNamingConvention>
            <alwaysOverrideEquals>false</alwaysOverrideEquals>
            <alwaysOverrideHashCode>false</alwaysOverrideHashCode>
            <avoidThreadGroups>false</avoidThreadGroups>

            <declareCollectionComment>false</declareCollectionComment>
            <dontIgnoreExceptions>false</dontIgnoreExceptions>
            <dontSubstituteObjectEquals>false</dontSubstituteObjectEquals>
            <neverDeclareException>false</neverDeclareException>
            <neverDeclareThrowable>false</neverDeclareThrowable>
            <neverInvokeWaitOutsideLoop>false</neverInvokeWaitOutsideLoop>

            <neverReturnZeroArrays>false</neverReturnZeroArrays>
            <neverUseEmptyFinally>false</neverUseEmptyFinally>
            <obeyContractEquals>false</obeyContractEquals>
            <overrideToString>false</overrideToString>
            <referToObjectsByInterface>false</referToObjectsByInterface>
            <replaceStructureWithClass>false</replaceStructureWithClass>

            <stringLiterallI18n>false</stringLiterallI18n>
            <useInterfaceOnlyForTypes>false</useInterfaceOnlyForTypes>
            <wrongCollectionComment>false</wrongCollectionComment>
        </tips>
    </inspector>
    <internal>
        <version>6</version>

    </internal>
    <printer>
        <alignment>
            <methodCallChain>true</methodCallChain>
            <parameterMethodDeclaration>false</parameterMethodDeclaration>
            <ternaryOperator>true</ternaryOperator>
            <variableAssignment>false</variableAssignment>

            <variableIdentifier>false</variableIdentifier>
        </alignment>
        <blanklines>
            <after>
                <block>1</block>
                <braceLeft>0</braceLeft>
                <class>1</class>

                <declaration>0</declaration>
                <interface>1</interface>
                <lastImport>2</lastImport>
                <method>1</method>
                <package>1</package>
            </after>

            <before>
                <block>1</block>
                <braceRight>0</braceRight>
                <caseBlock>1</caseBlock>
                <comment>
                    <javadoc>1</javadoc>
                    <multiline>1</multiline>

                    <singleline>1</singleline>
                </comment>
                <controlStatement>1</controlStatement>
                <declaration>1</declaration>
            </before>
            <keepUpTo>1</keepUpTo>
        </blanklines>

        <braces>
            <empty>
                <cuddle>false</cuddle>
                <insertStatement>false</insertStatement>
            </empty>
            <insert>
                <dowhile>true</dowhile>

                <for>true</for>
                <ifelse>true</ifelse>
                <while>true</while>
            </insert>
            <remove>
                <block>true</block>
                <dowhile>false</dowhile>

                <for>false</for>
                <ifelse>false</ifelse>
                <while>false</while>
            </remove>
            <treatDifferent>
                <methodClass>false</methodClass>
                <methodClassIfWrapped>false</methodClassIfWrapped>

            </treatDifferent>
        </braces>
        <chunks>
            <blanklines>true</blanklines>
            <comments>true</comments>
        </chunks>
        <comments>
            <separator>

                <fillCharacter>-</fillCharacter>
                <insert>false</insert>
                <insertRecursive>false</insertRecursive>
                <text>
                    <class>Inner Classes</class>
                    <constructor>Constructors</constructor>

                    <field>Instance fields</field>
                    <initializer>Instance initializers</initializer>
                    <interface>Inner Interfaces</interface>
                    <method>Methods</method>
                    <static>Static fields/initializers</static>
                </text>

            </separator>
        </comments>
        <indentation>
            <caseFromSwitch>false</caseFromSwitch>
            <continuation>
                <block>true</block>
                <operator>false</operator>

            </continuation>
            <firstColumnComments>true</firstColumnComments>
            <label>false</label>
            <policy>
                <deep>false</deep>
            </policy>
            <sizes>

                <braceCuddled>1</braceCuddled>
                <braceLeft>1</braceLeft>
                <braceRight>0</braceRight>
                <braceRightAfter>1</braceRightAfter>
                <continuation>4</continuation>
                <deep>55</deep>

                <extends>-1</extends>
                <general>4</general>
                <implements>-1</implements>
                <leading>0</leading>
                <tabs>8</tabs>
                <throws>-1</throws>

                <trailingComment>1</trailingComment>
            </sizes>
            <tabs>
                <enable>false</enable>
                <onlyLeading>false</onlyLeading>
            </tabs>
        </indentation>

        <whitespace>
            <after>
                <comma>true</comma>
                <semicolon>true</semicolon>
                <typeCast>true</typeCast>
            </after>
            <before>

                <braces>true</braces>
                <brackets>false</brackets>
                <bracketsTypes>false</bracketsTypes>
                <caseColon>false</caseColon>
                <operator>
                    <not>false</not>

                </operator>
                <parentheses>
                    <methodCall>false</methodCall>
                    <methodDeclaration>false</methodDeclaration>
                    <statement>true</statement>
                </parentheses>
            </before>

            <padding>
                <braces>true</braces>
                <brackets>false</brackets>
                <operator>
                    <assignment>true</assignment>
                    <bitwise>true</bitwise>
                    <logical>true</logical>

                    <mathematical>true</mathematical>
                    <relational>true</relational>
                    <shift>true</shift>
                </operator>
                <parenthesis>true</parenthesis>
                <typeCast>true</typeCast>

            </padding>
        </whitespace>
        <wrapping>
            <always>
                <after>
                    <arrayElement>1</arrayElement>
                    <braceRight>false</braceRight>
                    <extendsTypes>false</extendsTypes>

                    <implementsTypes>false</implementsTypes>
                    <label>true</label>
                    <methodCallChained>true</methodCallChained>
                    <ternaryOperator>
                        <first>false</first>
                        <second>false</second>

                    </ternaryOperator>
                    <throwsTypes>false</throwsTypes>
                </after>
                <before>
                    <braceLeft>false</braceLeft>
                    <extends>true</extends>
                    <implements>true</implements>

                    <throws>true</throws>
                </before>
                <parameter>
                    <methodCall>false</methodCall>
                    <methodCallNested>false</methodCallNested>
                    <methodDeclaration>true</methodDeclaration>
                </parameter>

            </always>
            <general>
                <beforeOperator>true</beforeOperator>
                <enable>true</enable>
                <lineLength>80</lineLength>
            </general>
            <ondemand>

                <after>
                    <assignment>true</assignment>
                    <leftParenthesis>false</leftParenthesis>
                    <parameter>true</parameter>
                    <types>
                        <extends>false</extends>
                        <implements>false</implements>

                        <throws>false</throws>
                    </types>
                </after>
                <before>
                    <rightParenthesis>true</rightParenthesis>
                </before>
                <groupingParentheses>true</groupingParentheses>

            </ondemand>
        </wrapping>
    </printer>
</jalopy>

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to