[Biojava-dev] review/feedback: code style

Hannes Brandstätter-Müller biojava at hannes.oib.com
Sun Apr 7 18:31:30 UTC 2013


The formatter is a copy of the default settings with some minor
modifications (e.g. spaces instead of tabs) that are very helpful in my
experience.

Line length has been set to 120, which turned out to be a nice number in
the huge java project I work on in my day-job.

Hannes


On Sun, Apr 7, 2013 at 5:49 PM, Andreas Prlic <andreas at sdsc.edu> wrote:

> Hi Hannes,
>
> I took a look at your templates and they work fine for me. In terms of
> source code formatting, I'd say let's stick as close as possible to the
> eclipse default templates and only add things like LGPL header, since we
> don't want to have too many style conflicts in case somebody does not have
> the templates installed.
>
> Did anybody try automated source-code formatting upon commit?
>
> On a related note, I added the checkstyle and findbug plugins to our main
> pom.xml.
>
> Andreas
>
>
>
> On Sat, Apr 6, 2013 at 3:06 AM, Hannes Brandstätter-Müller <
> biojava at hannes.oib.com> wrote:
>
>> Thanks for the feedback.
>>
>> I originally chose tab indentation because that seemed to be the most
>> widely used one. The arguments for space indentation are mentioned in the
>> sun java styleguide (on which the checkstyle configuration is based).
>> I changed it back to space indentation and submitted it as pull request,
>> so
>> please continue the discussion there :)
>> https://github.com/biojava/biojava/pull/3
>>
>> I would also like to discuss a round of existing source file formatting.
>>
>> Hannes
>>
>>
>> On Sat, Apr 6, 2013 at 4:41 AM, Michael Heuer <heuermh at gmail.com> wrote:
>>
>> > Hello Hannes,
>> >
>> > I'm not an IDE user but what you have there looks pretty reasonable.
>> > If given a choice I would prefer
>> >
>> > spaces not tabs
>> > 4 spaces per indent for java files
>> > 2 spaces per indent for xml files e.g. pom.xml
>> > 120 character line length
>> > use final by default
>> > make classes immutable by default
>> >
>> > I don't think adding those Eclipse formatting files and using them
>> > going forward will be controversial; wanting to reformat all the
>> > existing source code might be.
>> >
>> >    michael
>> >
>> >
>> > On Fri, Apr 5, 2013 at 4:57 PM, Spencer Bliven <sbliven at ucsd.edu>
>> wrote:
>> > > Hannes-
>> > >
>> > > If you submit a pull request now then we can comment directly on the
>> code
>> > > on github. Then all the discussion will be in one place, plus any
>> future
>> > > code you submit on that branch will get pulled into the discussion.
>> Pull
>> > > requests don't need to be resolved right away for potentially
>> > controversial
>> > > changes like this.
>> > >
>> > >
>> > > On Fri, Apr 5, 2013 at 12:01 PM, Hannes Brandstätter-Müller <
>> > > biojava at hannes.oib.com> wrote:
>> > >
>> > >> I put together some instructions and configurations that I think
>> could
>> > >> greatly benefit the project code style.
>> > >>
>> > >> Please check them out at
>> > >>
>> > >>
>> >
>> https://github.com/brandstaetter/biojava/commit/0b11b10a051cbcc1d667ed253da7fa9be11e9d59
>> > >> and give me feedback please (ideally, download the configurations and
>> > try
>> > >> them out)
>> > >>
>> > >> If there are no objections, I will submit a pull request or directly
>> > merge
>> > >> it.
>> > >>
>> > >> Hannes
>> > >>
>> > >> p.s. what in my git config is misconfigured so that the name is not
>> > matched
>> > >> to my github account? do I need to use my github account name in my
>> > config?
>> > >> _______________________________________________
>> > >> biojava-dev mailing list
>> > >> biojava-dev at lists.open-bio.org
>> > >> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>> > >>
>> > >
>> > > _______________________________________________
>> > > biojava-dev mailing list
>> > > biojava-dev at lists.open-bio.org
>> > > http://lists.open-bio.org/mailman/listinfo/biojava-dev
>> >
>> > _______________________________________________
>> > biojava-dev mailing list
>> > biojava-dev at lists.open-bio.org
>> > http://lists.open-bio.org/mailman/listinfo/biojava-dev
>> >
>>
>> _______________________________________________
>> biojava-dev mailing list
>> biojava-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>>
>
>
>
>




More information about the biojava-dev mailing list