[ 
https://issues.apache.org/jira/browse/PDFBOX-2820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14578418#comment-14578418
 ] 

Glenn Adams commented on PDFBOX-2820:
-------------------------------------


* remove boilerplate comments
* remove commented out lines

As an incremental step forward towards using Checkstyle, I just modified the 
existing fontbox-checkstyle.xml configuration file, leaving existing 
boilerplate in place and commenting out a few rules that produced many warnings.

My thought was to enable Checkstyle with the minimum changes needed, and then 
post incremental patches to clean it up further (and fix existing warnings).

* why is Type1Lexer.java modified?

To fix a single warning (switch statement missing default clause) from the 
already existing Checkstyle rules. Fixing the other warnings would require more 
extensive edits, which I thought may be best handled in a subsequent patch once 
basic Checkstyle usage is in place.

* does this checkstyle file actually match our coding conventions, given that 
they've been updated?

Unknown. I haven't studied those conventions, considering that the existing 
Checkstyle rules were likely to be close to those conventions. Except for the 
one warning about missing default clause, the existing warnings all fell under 
javadoc warnings or missing EOL on last line warnings. So I surmise that the 
conventions in the existing (fontbox) code must correspond to the existing 
Checkstyle rules, which is to say, the checkstyle file does match existing 
coding conventions. Of course, there may be some warnings that are not enabled 
that could be enabled to catch deviations from those conventions. They could be 
added in a subsequent patch.




> Configure and enable checkstyle for fontbox.
> --------------------------------------------
>
>                 Key: PDFBOX-2820
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2820
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: FontBox
>            Reporter: Glenn Adams
>         Attachments: fontbox.checkstyle.patch
>
>
> The fontbox sub-tree contains an apparently old checkstyle configuration 
> file, which no longer works for checkstyle 5 or later. I'm not sure if it is 
> being used or not. In any case, it would be useful (IMO) to update this 
> configuration and enable the use of checkstyle:check in the validate phase 
> and checkstyle:checkstyle in the site phase. The former goal is useful for 
> inducing a fail at build time, while the latter is useful for report 
> generation.
> I will attach a patch to this issue that implements the above. For the time 
> being, I've temporarily disabled a few checks due to their producing a rather 
> large number of warnings. Once this initial patch is merged, I will post 
> another patch that re-enables the checks and fixes existing warnings.
> Note that the current checkstyle plugin (version 2.15) employs checkstyle 
> 6.1.1 by default.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to