accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-3771) Configure automatic java code style formatting
Date Tue, 05 May 2015 15:42:01 GMT


ASF GitHub Bot commented on ACCUMULO-3771:

Github user ctubbsii commented on the pull request:
    There are two main problems with the Eclipse formatter:
     1. It doesn't strictly adhere to the line length restrictions.
     2. It adds a trailing space to indent empty javadoc lines.
    We've already accounted for the line length in the checkstyle rules by making it much
larger than the Eclipse formatter. With this patch, I think we could probably just ignore
trailing whitespace (and drop the corresponding checkstyle enforcement), since the formatter
will remove the ones we mainly care about anyway (the javadoc ones are annoying, but there's
not a lot of good options so long as Eclipse fails to fix that issue). We could just strip
whitespace with `sed` after the formatter executes.
    One thing I'd like to see, though (for the purposes of a review) is just the pom changes,
separate from any resulting formatting changes (I'm sure I can do this with some command-line
Git Fu, though, so it's no big deal).
    I did see that the formatting significantly changed some lines that looked deliberately
formatted to make it more readable. For those lines, we may wish to add the `@formatter:off`
/ `@formatter:on` tags to retain existing formatting.
    I'm also curious what happens with the `-Pthrift` profile activated. Will this plugin
reformat the generated thrift code? Maybe that's okay, but it might be annoying. If the generated
thrift code were in a separate package, it could be avoided more easily, though.
    I'm overall +1 to the idea, but it might need some tweaking.
    I especially like the idea that we could focus our style choices on readability, because
writing to conform to a particular style doesn't matter any more (write in whatever style
you like and the build will fix it).

> Configure automatic java code style formatting 
> -----------------------------------------------
>                 Key: ACCUMULO-3771
>                 URL:
>             Project: Accumulo
>          Issue Type: Task
>    Affects Versions: 1.8.0
>            Reporter: Mike Walch
>            Assignee: Mike Walch
>            Priority: Minor
>             Fix For: 1.8.0
> I configured automatic Java style formatting for Fluo in [FLUO-479|].
 This was done using the maven-java-formatter-plugin which formats all Java classes on every
build according to a specified Eclipse style configuration file.  This has worked well for
Fluo so Christopher Tubbs asked me to create a patch for Accumulo.  
> This patch will be composed of two commits.  The first commit will be the configuration
for the plugin.   The second commit will be all changes to Java classes after the plugin is
> While auto-formatting has been a nice addition for Fluo, it does require a lot of changes
to the code initially.  If you are unhappy with this change, feel free to object...

This message was sent by Atlassian JIRA

View raw message