xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Hennebert <vhenneb...@gmail.com>
Subject Re: Checkstyle, Reloaded
Date Wed, 08 Feb 2012 20:51:10 GMT
Hi Chris,

On 06/02/12 10:14, Chris Bowditch wrote:
> On 03/02/2012 17:45, Vincent Hennebert wrote:
<snip/>
>>
>> It is likely that the current code will not be compliant with the new
>> rules. However, most of them are really just about the syntax, so
>> I believe it should be fairly straightforward to make the code at least
>> 90% compliant just by applying Eclipse’s command-line code formatter.
> I'm not comfortable with that. Automated tools don't always fully grasp the
> code that they are changing, so there is a risk of introducing regressions.

I understand and share your concern in principle, however I believe that
in the present case the tool would be harmless. It really is as if
I were opening every Java file in Eclipse one by one and running the
formatter (aka hitting the Ctrl-F key). I actually discovered that I can
run the formatter on a whole source folder straight from the Eclipse
GUI. So I don’t even need to run a command-line tool. I would just
carefully configure the formatter and run it once on src/java and once
on test/java, and that would be it. How does that sound?


<snip/>
> Can you provide a breakdown of the new warnings identified by Glenn by rule
> type? I do object to introducing so many new warnings and I'm not comfortable
> with using automated tools to correct the files, without understanding exactly
> which warnings will be fixed in an automated way.

Here is the list of rule violations that I get when running the new
Checkstyle file on the latest trunk with Checkstyle 5.5:
      1 FinalClassCheck
      1 GenericWhitespaceCheck
      1 NoWhitespaceBeforeCheck
      2 DefaultComesLastCheck
      4 RedundantModifierCheck
      4 RightCurlyCheck
      5 OneStatementPerLineCheck
      8 RedundantImportCheck
      8 RegexpSinglelineCheck
     33 ConstantNameCheck
     37 MultipleVariableDeclarationsCheck
     47 UnusedImportsCheck
     71 EmptyBlockCheck
    113 NewlineAtEndOfFileCheck
    128 NoWhitespaceAfterCheck
    182 LineLengthCheck
    249 ImportOrderCheck
    321 ParenPadCheck
    392 MethodParamPadCheck
    806 ExplicitInitializationCheck
   2231 WhitespaceAfterCheck

A description of the rules sorted by alphabetic order can be found here:
http://checkstyle.sourceforge.net/availablechecks.html

ImportOrderCheck and UnusedImportsCheck are easily fixed by bulk-running
Eclipse’s import organizer.

ConstantNameCheck and MultipleVariableDeclarationsCheck will have to be
fixed by hand but the number remains reasonable.

ExplicitInitializationCheck can’t be automatically fixed by Eclipse
AFAICT. We may have to drop this rule as fixing it manually would be too
much work.

For the rest, either they are automatically fixed by the code formatter,
or the number of occurrences is small enough to be manageable by hand.


Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: general-help@xmlgraphics.apache.org


Mime
View raw message