You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Kristian Rosenvold <kr...@apache.org> on 2016/06/27 08:09:29 UTC

Reformatting commons-io to single code style ?

This has probably been discussed a million times before, so I'll keep
it short. commons-io has wonderfully inconsistent code style even
within individual code files.

Once the move to git completes, I'd like to reformat the entire code
base (including javadoc) to a single style. I don't really care which
style, my OCD is about consistency, not about which particular style
is in use :)

(Is there any kind of intelliJ code style file for commons ?)

Sorry for disturbing the hornets :)

Kristian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by Gary Gregory <ga...@gmail.com>.
On Jun 27, 2016 1:09 AM, "Kristian Rosenvold" <kr...@apache.org> wrote:
>
> This has probably been discussed a million times before, so I'll keep
> it short. commons-io has wonderfully inconsistent code style even
> within individual code files.
>
> Once the move to git completes, I'd like to reformat the entire code
> base (including javadoc) to a single style. I don't really care which
> style, my OCD is about consistency, not about which particular style
> is in use :)
>
> (Is there any kind of intelliJ code style file for commons ?)
>
> Sorry for disturbing the hornets :)

I like consistency. Sadly, this is likely a hornets issue for some ;-) if
it were just my code base, I just do it when convenient, regardless of when
we move the repository since history should be moved as well.

Gary
>
> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

Re: Reformatting commons-io to single code style?

Posted by Gilles <gi...@harfang.homelinux.org>.
On Mon, 27 Jun 2016 11:18:19 +0100, sebb wrote:
> On 27 June 2016 at 09:09, Kristian Rosenvold <kr...@apache.org> 
> wrote:
>> This has probably been discussed a million times before, so I'll 
>> keep
>> it short. commons-io has wonderfully inconsistent code style even
>> within individual code files.
>>
>> Once the move to git completes, I'd like to reformat the entire code
>> base (including javadoc) to a single style. I don't really care 
>> which
>> style, my OCD is about consistency, not about which particular style
>> is in use :)
>>
>> (Is there any kind of intelliJ code style file for commons ?)
>>
>> Sorry for disturbing the hornets :)
>
> -1
>
> This causes lots of grief when trying to track where a particular
> section of code was introduced.
>
> Likewise so does reorganising methods alphabetically.
>
> If the code in a particular source file is really badly mangled then
> it's worth standardising it internally, but IMO it's
> counter-productive to reformat everything.

Both viewpoints have their advantages and drawbacks.
[E.g. one could argue that inconsistent formatting gives a bad
impression to would-be contributors.]

I'd favour more stringent filtering at the time where a piece of
code is first introduced.
[I.e. we should -1 mangled code, even it does the job.]


Gilles

>> Kristian


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by Matt Sicker <bo...@gmail.com>.
We reformat and reorganize all the time in log4j and we've never lost track
of where things came from. Maybe git is smarter than svn about this?

On 27 June 2016 at 05:18, sebb <se...@gmail.com> wrote:

> On 27 June 2016 at 09:09, Kristian Rosenvold <kr...@apache.org>
> wrote:
> > This has probably been discussed a million times before, so I'll keep
> > it short. commons-io has wonderfully inconsistent code style even
> > within individual code files.
> >
> > Once the move to git completes, I'd like to reformat the entire code
> > base (including javadoc) to a single style. I don't really care which
> > style, my OCD is about consistency, not about which particular style
> > is in use :)
> >
> > (Is there any kind of intelliJ code style file for commons ?)
> >
> > Sorry for disturbing the hornets :)
>
> -1
>
> This causes lots of grief when trying to track where a particular
> section of code was introduced.
>
> Likewise so does reorganising methods alphabetically.
>
> If the code in a particular source file is really badly mangled then
> it's worth standardising it internally, but IMO it's
> counter-productive to reformat everything.
>
> > Kristian
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

回复:Re: Reformatting commons-io to single code style ?

Posted by 仓央杰克 <lq...@126.com>.
hi,


i am interested in the refactor the code , i want to know what can i do you for you ,expect your reply . 
thanks a lot .



At 2016-06-27 20:10:20, "Benedikt Ritter" <br...@apache.org> wrote:
>+1 go for it. I'm in the unified code style camp. That's why I reformatted
>the whole code base of BeanUtils2 a while back.
>
>Kristian Rosenvold <kr...@apache.org> schrieb am Mo., 27. Juni 2016 um
>13:21:
>
>> 2016-06-27 12:18 GMT+02:00 sebb <se...@gmail.com>:
>> > This causes lots of grief when trying to track where a particular
>> > section of code was introduced.
>>
>> Tooling has moved on, I'm really not sure this argument is
>> particularly relevant for a git repository.
>> If I want to track provenance I'd use git pickaxe or similar.
>>
>> > Likewise so does reorganising methods alphabetically.
>>
>> My OCD does not cover the order of the methods, this may be because I
>> think most of the applicable standards covering this are just plain
>> dumb.
>>
>> > If the code in a particular source file is really badly mangled then
>> > it's worth standardising it internally, but IMO it's
>> > counter-productive to reformat everything.
>>
>> I would not be writing this email if I thought it was just a minor few
>> hiccups. I think it's possible to define a code style for io that
>> causes a reasonable minimum changeset to the code.
>> As previously mentioned I really dont care about code style - as I've
>> grown older I even stopped rampaging against people that use tabs.
>>
>>
>> So the way I'm reading this I would probably get away by reformatting
>> the worst offenders, especially if I do not do too many files at once
>> (evil grin :)
>>
>> Kristian
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>

Re: Reformatting commons-io to single code style ?

Posted by Niall Pemberton <ni...@gmail.com>.
On Mon, Jun 27, 2016 at 1:10 PM, Benedikt Ritter <br...@apache.org> wrote:

> +1 go for it. I'm in the unified code style camp. That's why I reformatted
> the whole code base of BeanUtils2 a while back.
>

+1 from me too.

Niall



>
> Kristian Rosenvold <kr...@apache.org> schrieb am Mo., 27. Juni 2016
> um
> 13:21:
>
> > 2016-06-27 12:18 GMT+02:00 sebb <se...@gmail.com>:
> > > This causes lots of grief when trying to track where a particular
> > > section of code was introduced.
> >
> > Tooling has moved on, I'm really not sure this argument is
> > particularly relevant for a git repository.
> > If I want to track provenance I'd use git pickaxe or similar.
> >
> > > Likewise so does reorganising methods alphabetically.
> >
> > My OCD does not cover the order of the methods, this may be because I
> > think most of the applicable standards covering this are just plain
> > dumb.
> >
> > > If the code in a particular source file is really badly mangled then
> > > it's worth standardising it internally, but IMO it's
> > > counter-productive to reformat everything.
> >
> > I would not be writing this email if I thought it was just a minor few
> > hiccups. I think it's possible to define a code style for io that
> > causes a reasonable minimum changeset to the code.
> > As previously mentioned I really dont care about code style - as I've
> > grown older I even stopped rampaging against people that use tabs.
> >
> >
> > So the way I'm reading this I would probably get away by reformatting
> > the worst offenders, especially if I do not do too many files at once
> > (evil grin :)
> >
> > Kristian
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>

Re: Reformatting commons-io to single code style ?

Posted by Benedikt Ritter <br...@apache.org>.
+1 go for it. I'm in the unified code style camp. That's why I reformatted
the whole code base of BeanUtils2 a while back.

Kristian Rosenvold <kr...@apache.org> schrieb am Mo., 27. Juni 2016 um
13:21:

> 2016-06-27 12:18 GMT+02:00 sebb <se...@gmail.com>:
> > This causes lots of grief when trying to track where a particular
> > section of code was introduced.
>
> Tooling has moved on, I'm really not sure this argument is
> particularly relevant for a git repository.
> If I want to track provenance I'd use git pickaxe or similar.
>
> > Likewise so does reorganising methods alphabetically.
>
> My OCD does not cover the order of the methods, this may be because I
> think most of the applicable standards covering this are just plain
> dumb.
>
> > If the code in a particular source file is really badly mangled then
> > it's worth standardising it internally, but IMO it's
> > counter-productive to reformat everything.
>
> I would not be writing this email if I thought it was just a minor few
> hiccups. I think it's possible to define a code style for io that
> causes a reasonable minimum changeset to the code.
> As previously mentioned I really dont care about code style - as I've
> grown older I even stopped rampaging against people that use tabs.
>
>
> So the way I'm reading this I would probably get away by reformatting
> the worst offenders, especially if I do not do too many files at once
> (evil grin :)
>
> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: Reformatting commons-io to single code style ?

Posted by Kristian Rosenvold <kr...@apache.org>.
2016-06-27 12:18 GMT+02:00 sebb <se...@gmail.com>:
> This causes lots of grief when trying to track where a particular
> section of code was introduced.

Tooling has moved on, I'm really not sure this argument is
particularly relevant for a git repository.
If I want to track provenance I'd use git pickaxe or similar.

> Likewise so does reorganising methods alphabetically.

My OCD does not cover the order of the methods, this may be because I
think most of the applicable standards covering this are just plain
dumb.

> If the code in a particular source file is really badly mangled then
> it's worth standardising it internally, but IMO it's
> counter-productive to reformat everything.

I would not be writing this email if I thought it was just a minor few
hiccups. I think it's possible to define a code style for io that
causes a reasonable minimum changeset to the code.
As previously mentioned I really dont care about code style - as I've
grown older I even stopped rampaging against people that use tabs.


So the way I'm reading this I would probably get away by reformatting
the worst offenders, especially if I do not do too many files at once
(evil grin :)

Kristian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by Ralph Goers <ra...@dslextreme.com>.
> On Jun 27, 2016, at 3:18 AM, sebb <se...@gmail.com> wrote:
> 
> On 27 June 2016 at 09:09, Kristian Rosenvold <kr...@apache.org> wrote:
>> This has probably been discussed a million times before, so I'll keep
>> it short. commons-io has wonderfully inconsistent code style even
>> within individual code files.
>> 
>> Once the move to git completes, I'd like to reformat the entire code
>> base (including javadoc) to a single style. I don't really care which
>> style, my OCD is about consistency, not about which particular style
>> is in use :)
>> 
>> (Is there any kind of intelliJ code style file for commons ?)
>> 
>> Sorry for disturbing the hornets :)
> 
> -1

Really? You would veto the commit if it was done?

> 
> This causes lots of grief when trying to track where a particular
> section of code was introduced.

Why?  Just go through the history. No matter how the code has changed you can still tell when it was done.  I’ve done this many times in Intellij and never had a problem.

> 
> Likewise so does reorganising methods alphabetically.

Although some people are big fans of this, rarely have I seen a code style document that actually requires it.  

> 
> If the code in a particular source file is really badly mangled then
> it's worth standardising it internally, but IMO it's
> counter-productive to reformat everything.

I completely disagree and can sympathize with Kristian on this.  That said, since I haven’t worked on the code in question I’ll shut up now.

Ralph



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by sebb <se...@gmail.com>.
On 27 June 2016 at 09:09, Kristian Rosenvold <kr...@apache.org> wrote:
> This has probably been discussed a million times before, so I'll keep
> it short. commons-io has wonderfully inconsistent code style even
> within individual code files.
>
> Once the move to git completes, I'd like to reformat the entire code
> base (including javadoc) to a single style. I don't really care which
> style, my OCD is about consistency, not about which particular style
> is in use :)
>
> (Is there any kind of intelliJ code style file for commons ?)
>
> Sorry for disturbing the hornets :)

-1

This causes lots of grief when trying to track where a particular
section of code was introduced.

Likewise so does reorganising methods alphabetically.

If the code in a particular source file is really badly mangled then
it's worth standardising it internally, but IMO it's
counter-productive to reformat everything.

> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Tue, Jun 28, 2016 at 6:31 AM, Uwe Barthel <ba...@x-reizend.de> wrote:

> +1 for checkstyle, -1 for any IDE depending files.

Fully agreed, if IDE dependenant files are somehow required, or
important, for the build.

Apart from that: Let's not be overly dogmatic. If such files are out
of the way (say, located in src/main/ide/intellij, or the like), then
they shouldn't be bothering others.

Jochen

P.S: Eclipse really should have a configurable location for its files.




-- 
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: Reformatting commons-io to single code style ?

Posted by Stian Soiland-Reyes <st...@apache.org>.
+1 if the code is messy or inconsistent, -0 if it's already OK.

Personally I wouldn't do the whole code, just tidy in a separate
commit per file before editing it.

If you do all of them, then we should also add the agreed
checkstyle.xml or equivalent code style file, so that it's easy to
keep compliance. The code style should be minimal, e.g. mainly just
get decent indentation and have consistent line-breaks in the method
declaration, but not care too much about things like how if/else
blocks are done or the number of () in a && check.

On 27 June 2016 at 09:09, Kristian Rosenvold <kr...@apache.org> wrote:
> This has probably been discussed a million times before, so I'll keep
> it short. commons-io has wonderfully inconsistent code style even
> within individual code files.
>
> Once the move to git completes, I'd like to reformat the entire code
> base (including javadoc) to a single style. I don't really care which
> style, my OCD is about consistency, not about which particular style
> is in use :)
>
> (Is there any kind of intelliJ code style file for commons ?)
>
> Sorry for disturbing the hornets :)
>
> Kristian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>



-- 
Stian Soiland-Reyes
Apache Taverna (incubating), Apache Commons
http://orcid.org/0000-0001-9842-9718

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org