JCR patch for pretty printing

0 views
Skip to first unread message

Jason Thrasher

unread,
Aug 11, 2009, 2:05:55 AM8/11/09
to spring-mo...@googlegroups.com
Okay, so I was on the fence about applying this, however I forked
spring-modules-jcr in my own private repository long ago, and applied
my own code formatting (just default Eclipse formating). It's
(nearly) impossible to merge codebases without the code being in the
same format, so here's a pretty printing patch that needs applying
before my primary bug fixes.

I have no problem inheriting any other standard code layout as well.
But I do think there should be some consistency across modules.

thoughts?
-Jason

0003-Applied-pretty-printing-to-all-java-files-according.patch

Thomas Einwaller

unread,
Aug 19, 2009, 4:04:58 AM8/19/09
to spring-mo...@googlegroups.com

This is a good idea ... I think we should all use the same Eclipse format and cleanup settings and activate the Save Actions in Eclipse to avoid formatting differences make merging harder. I attached my settings as a proposal - we should create our own based on them, link them in the wiki and every developer should import our settings.

 

@Jason I think we have done a lot similar things on our forks ... merging will get difficult, but before we begin to work again we should do that.

 

Greets

tOM

 

>>> http://timr.com - the time tracking revolution

format.xml
cleanup.xml

Toolman

unread,
Aug 19, 2009, 4:54:30 PM8/19/09
to spring-modules-fork
Yep agreed; I don't care which standard, but will reformat all of the
validation module when we have an agreed standard :)

On Aug 19, 8:04 pm, Thomas Einwaller <thomas.einwal...@gmail.com>
wrote:
>  format.xml
> 37KViewDownload
>
>  cleanup.xml
> 4KViewDownload

Jason Thrasher

unread,
Aug 20, 2009, 1:50:28 PM8/20/09
to spring-modules-fork
Great. I'm on the same page as you guys. I'm not so concerned about
what standard, as long as there is one. It'd be a bonus to apply to
all modules, and if there's a way to apply it automatically, well bonus
++.

Is there a code format plugin for Maven that could be triggered on pre-
compile or similar?
Jason

On Aug 19, 1:54 pm, Toolman <thetool...@gmail.com> wrote:
> Yep agreed; I don't care which standard, but will reformat all of the
> validation module when we have an agreed standard :)
>
> On Aug 19, 8:04 pm, Thomas Einwaller <thomas.einwal...@gmail.com>
> wrote:
>
> > This is a good idea ... I think we should all use the same Eclipse format
> > and cleanup settings and activate the Save Actions in Eclipse to avoid
> > formatting differences make merging harder. I attached my settings as a
> > proposal - we should create our own based on them, link them in the wiki and
> > every developer should import our settings.
>
> > @Jason I think we have done a lot similar things on our forks ... merging
> > will get difficult, but before we begin to work again we should do that.
>
> > Greets
>
> > tOM
>
> > >>>http://timr.com-the time tracking revolution
>
> >  format.xml
> > 37KViewDownload
>
> >  cleanup.xml
> > 4KViewDownload

Isidoro Trevino

unread,
Aug 20, 2009, 2:00:29 PM8/20/09
to spring-mo...@googlegroups.com
We could try the Jalopy Plugin for formatting the code:

http://mojo.codehaus.org/jalopy-maven-plugin/howto.html
--
Ing. Isidoro Treviño

Dmitry Sklyut

unread,
Aug 20, 2009, 2:22:21 PM8/20/09
to Jason Thrasher, spring-modules-fork
Is template available for IntelliJ users?  I can try to create one if there are no takers.

Does git allow pre-commit hooks? 

Dmitry

Antony Stubbs

unread,
Sep 29, 2009, 8:13:23 PM9/29/09
to Jason Thrasher, spring-modules-fork
Thomas, Jason and Toolman - did you guys agree on the code formatting
template?

I'm going through the fork queue on github and am concerned that
different formats have been applied.
I'm also concerned about the mix of fixes and formatting changes being
applied within the same patch - especially when it's very large - as
some are.

I plan on merging the patches that look the most coherent (in terms of
what they change) and simplest. Before I merge the big changes though,
we need to decide on this issue and potentially clean up some of the
commits.

Jason Thrasher

unread,
Sep 29, 2009, 8:25:58 PM9/29/09
to spring-modules-fork
No, we left the discussion open. But I'm generally comfortable with
any format, as long as we're consistent across the board. What do you
want to use in the rest of the project?

My personal favorite is the Eclipse default. So if you don't care
either way, I'd say go with that. If you don't use Eclipse, it's moot
though.

-Jason

Thomas Einwaller

unread,
Sep 30, 2009, 5:25:37 AM9/30/09
to spring-modules-fork
I am happy with the Ecipse defaults too ... the only thing I normally
change is the line length to 120 instead of 80, but I can live with 80
too ;-)
> >>>>>>>http://timr.com-thetime tracking revolution
>
> >>>> format.xml
> >>>> 37KViewDownload
>
> >>>> cleanup.xml
> >>>> 4KViewDownload

Dmitry Sklyut

unread,
Sep 30, 2009, 8:51:03 AM9/30/09
to Thomas Einwaller, spring-modules-fork
Trying not to be a religious zealot :).

My preference would be:
1. Spaces vs. tabs for indentation (I prefer 4 but can live with 3)
2. Line length 120 to 132

Placement of {} is unimportant as long as it is consistent. 

I am an intellij user, if you guys come up with an eclipse template, I can convert that to intellij. 

Dmitry

Thomas Einwaller

unread,
Sep 30, 2009, 9:10:34 AM9/30/09
to spring-modules-fork
I uploaded my "default" Eclipse template to

http://troii.com/spring-modules-eclipse-format.xml

On Sep 30, 2:51 pm, Dmitry Sklyut <dskl...@gmail.com> wrote:
> Trying not to be a religious zealot :).
>
> My preference would be:
> 1. Spaces vs. tabs for indentation (I prefer 4 but can live with 3)
> 2. Line length 120 to 132
>
> Placement of {} is unimportant as long as it is consistent.
>
> I am an intellij user, if you guys come up with an eclipse template, I can
> convert that to intellij.
>
> Dmitry
>
> On Wed, Sep 30, 2009 at 5:25 AM, Thomas Einwaller <
>
> > > >>>>>>>http://timr.com-thetimetracking revolution
>
> > > >>>> format.xml
> > > >>>> 37KViewDownload
>
> > > >>>> cleanup.xml
> > > >>>> 4KViewDownload
Reply all
Reply to author
Forward
0 new messages