Question about code style ...

42 views
Skip to first unread message

Johan Lindquist

unread,
May 27, 2012, 12:39:06 PM5/27/12
to maven-androi...@googlegroups.com
Hi All,

First of all, not a major, critical issue & at the risk of being called
a 'stickler for details' and all ;) I just want to make sure I haven't
missed anything - has the code style has changed recently? I see some
hard-tabs in the code here and there and want to make sure we've not
changed it.

Cheers,

Johan

--
you too?

Hugo Josefson (Jayway)

unread,
May 27, 2012, 4:45:46 PM5/27/12
to maven-androi...@googlegroups.com
I don't believe we have a set code style. When we started up the project, I specifically wanted to have an as low-as-possible barrier of entry for contributors, so I let anyone contribute in any style they wanted. That's because I value community over my personal preferences :)

However I think this may be a good time to decide what code style feels best for the majority of recurring contributors.

What to you guys think? 4 spaces indent, no tabs, the one true brace style, and as long lines as humanly readable on a good screen?

/Hugo

Shane Isbell

unread,
May 27, 2012, 4:57:19 PM5/27/12
to maven-androi...@googlegroups.com
You could try using the maven code style so it's consistent with the core maven project.

http://maven.apache.org/developers/maven-eclipse-codestyle.xml
http://maven.apache.org/developers/maven-idea-codestyle.xml

Thanks,
Shane

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maven-android-developers/-/C7gNB_tF2DQJ.

To post to this group, send email to maven-androi...@googlegroups.com.
To unsubscribe from this group, send email to maven-android-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-android-developers?hl=en.

Johan Lindquist

unread,
May 27, 2012, 5:39:19 PM5/27/12
to maven-androi...@googlegroups.com
I think i asked cause I have a special 'profile' for the plugin setup
in IntelliJ :)

In any case, I don't mind what it is but would be good to keep it
consistent - what you suggest works for me.

Johan

On 2012-05-27 15:45, Hugo Josefson (Jayway) wrote:
> I don't believe we have a set code style. When we started up the
> project, I specifically wanted to have an as low-as-possible barrier
> of entry for contributors, so I let anyone contribute in any style
> they wanted. That's because I value community over my personal
> preferences :)
>
> However I think this may be a good time to decide what code style
> feels best for the majority of recurring contributors.
>
> What to you guys think? 4 spaces indent, no tabs, the one true brace
> style [2], and as long lines as humanly readable on a good screen?
>
> /Hugo
>
> On Sunday, May 27, 2012 6:39:06 PM UTC+2, Johan Lindquist wrote:
>
>> Hi All,
>>
>> First of all, not a major, critical issue & at the risk of being
>> called
>> a 'stickler for details' and all ;) I just want to make sure I
>> haven't
>> missed anything - has the code style has changed recently? I see
>> some
>> hard-tabs in the code here and there and want to make sure we've not
>> changed it.
>>
>> Cheers,
>>
>> Johan
>>
>> --
>> you too?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Maven Android Developers" group.
> To view this discussion on the web visit
>
> https://groups.google.com/d/msg/maven-android-developers/-/C7gNB_tF2DQJ
> [3].
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.
>
>
> Links:
> ------
> [1] http://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS
> [2]
> https://groups.google.com/d/msg/maven-android-developers/-/C7gNB_tF2DQJ

--
you too?

Johan Lindquist

unread,
May 27, 2012, 5:41:40 PM5/27/12
to maven-androi...@googlegroups.com
This works too :) In fact, this would make it a lot easier for people
to tune their IDE's (and a lot easier for us to define it!) - I'd say
+1.

Johan

On 2012-05-27 15:57, Shane Isbell wrote:
> You could try using the maven code style so it's consistent with the
> core maven project.
>
> http://maven.apache.org/developers/maven-eclipse-codestyle.xml [5]
> http://maven.apache.org/developers/maven-idea-codestyle.xml [6]
>
> Thanks,
> Shane
>
> On Sun, May 27, 2012 at 1:45 PM, Hugo Josefson (Jayway)
> <hu...@josefson.org> wrote:
>
>> I don't believe we have a set code style. When we started up the
>> project, I specifically wanted to have an as low-as-possible barrier
>> of entry for contributors, so I let anyone contribute in any style
>> they wanted. That's because I value community over my personal
>> preferences :)
>>
>> However I think this may be a good time to decide what code style
>> feels best for the majority of recurring contributors.
>>
>> What to you guys think? 4 spaces indent, no tabs, the one true brace
>> style [2], and as long lines as humanly readable on a good screen?
>>
>> /Hugo
>>
>> On Sunday, May 27, 2012 6:39:06 PM UTC+2, Johan Lindquist wrote:
>>
>>> Hi All,
>>>
>>> First of all, not a major, critical issue & at the risk of being
>>> called
>>> a 'stickler for details' and all ;)  I just want to make sure I
>>> haven't
>>> missed anything - has the code style has changed recently?  I see
>>> some
>>> hard-tabs in the code here and there and want to make sure we've
>>> not
>>> changed it.
>>>
>>> Cheers,
>>>
>>> Johan
>>>
>>> --
>>> you too?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Maven Android Developers" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/maven-android-developers/-/C7gNB_tF2DQJ
>> [3].
>>
>> To post to this group, send email to
>> maven-androi...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> maven-android-deve...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/maven-android-developers?hl=en [4].
>
> --
> You received this message because you are subscribed to the Google
> Groups "Maven Android Developers" group.
> To post to this group, send email to
> maven-androi...@googlegroups.com.
> To unsubscribe from this group, send email to
> maven-android-deve...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/maven-android-developers?hl=en.
>
>
> [3] http://groups.google.com/group/maven-android-developers?hl=en
> [4] http://maven.apache.org/developers/maven-eclipse-codestyle.xml
> [5] http://maven.apache.org/developers/maven-idea-codestyle.xml

--
you too?

Manfred Moser

unread,
May 28, 2012, 1:30:55 PM5/28/12
to maven-androi...@googlegroups.com
I recently introduced a limited approach along these lines in the
ksoap2-android project that I am managing and I totally agree that this
would be a great thing to do.

The main thing I would suggest to do is to enforce it with the checkstyle
plugin at build time.

I am happy to introduce that... so my main question would be

1. Are we ok to do this now or do we want to cut a release and do it
afterwards?

2. Is there a checkstyle file for the maven style we can use (I will ask
on the maven dev list as well)

3. Do we want to phase this in slowly or do a brute force cleanup of all
the code and check it in..

manfred

Johan Lindquist

unread,
May 28, 2012, 1:51:30 PM5/28/12
to maven-androi...@googlegroups.com
Hi,

I think that checkstyle + a brute force would be the ideal to get
everything aligned - any new checkings would then be warned.

But, having said that, I also think it needs to wait until people with
pending changes has had a chance to create their appropriate pull
requests - for the simple reason that when we apply the style, there
will be *a lot* of changes (bracket location being a mojor one if I am
not missreading the code style). And a blatantly selfish request too of
course considering I have plenty pending code ;)

Cheers,

Johan
--
you too?

Manfred Moser

unread,
May 28, 2012, 1:54:31 PM5/28/12
to maven-androi...@googlegroups.com
Thats exactly why I am asking.

We should probably do this

- get all pending stuff implemented e.g. in the next say 3 weeks

- cut a new release

- brute force update the style and implement the enforcement

- go about happily again


Sounds good?

manfred

Johan Lindquist

unread,
May 28, 2012, 2:03:46 PM5/28/12
to maven-androi...@googlegroups.com
+1 from me at least

Johan
--
you too?

Manfred Moser

unread,
May 28, 2012, 3:06:24 PM5/28/12
to maven-androi...@googlegroups.com
Ok.. I know how to get the checkstyle correctly from the Maven dev list so
we are good to go in that aspect.

Once we hear from Hugo and a few others I think we are good to roll with it..

manfred

Mykola Nikishov

unread,
May 29, 2012, 9:08:55 AM5/29/12
to maven-androi...@googlegroups.com
On 05/28/2012 08:54 PM, Manfred Moser wrote:

> Thats exactly why I am asking.
>
> We should probably do this
>
> - get all pending stuff implemented e.g. in the next say 3 weeks
>
> - cut a new release
>
> - brute force update the style and implement the enforcement

So it will make little harder to track down authorship/reason for change
via 'git blame'. Unfortunately, I'm not aware of any incremental way to
do this.

> - go about happily again
>
> Sounds good?

+1

--
Mykola

http://ua.linkedin.com/in/manandbytes
https://github.com/manandbytes/
Reply all
Reply to author
Forward
0 new messages