On Tue, Oct 9, 2012 at 9:53 PM, David M. Lloyd <david.lloyd(a)redhat.com>wrote:
On 10/09/2012 11:55 AM, Jeff Mesnil wrote:
> Is there an agreement on the order of import statements in our codebase?
> I'm using eclipse which, by default, organize imports in the following
> but we have some files with a different order *cough*intellij*cough* :)
> That makes for some noise in the commits when I modify a class and
eclipse changes the imports order.
> If we agree with this default order, I can add a checkstyle rule for
We tried this before but it didn't work out because checkstyle gets
confused about imports which are only used in Javadoc, and because
regardless of checkstyle rules everyone cannot agree on an order, and
anyway changes to existing code should NEVER EVER EVER EVER include
import "cleanups", "reorgs", or anything of the sort (no matter how
you think it is) along with "real" changes because it just obscures what
has changed and causes trouble. The same goes for whitespace fixes. If
a file is very offensively formatted, I could see considering a
specific, dedicated commit whose sole purpose and content is to clean up
the whitespace (i.e. absolutely no functional changes), but other than
Jeff, i generally agree with you and can share my idea code-style settings
you, but David has a point :|
I just enabled "only text changed to vcs" when reformatting code, so you it
will be reformatting just changed code and noting else.
For new code I can't imagine it really matters as long as you
star imports (though using star with static import for certain classes
is just fine).
checkstyle checks for this during build, so no worries about abusing this.
jboss-as7-dev mailing list