[Biojava-dev] Biojava3-Core

Michael Heuer heuermh at acm.org
Thu May 13 05:06:30 UTC 2010


Sorry to come into this conversation late.  I have gone through this in
several different FOSS and in-house projects, and have found that the best
way to do it is

1)  Configure Checkstyle plugin (supported via ant, maven, eclipse, maybe
others) to a standard that most developers are comfortable with and that
doesn't result in 10000s of errors per class in the existing source tree

http://checkstyle.sf.net


2)  Configure the Eclipse formatter (or similar tool in another IDE) to
match the Checkstyle configuration as closely as possible and run it on
the existing source tree


3)  Tweak both configurations until you have a reasonable result (say 100
or fewer errors per class) and check those in to revision control


4)  Include Checkstyle reports in continuous integration builds, and make
sure the number of Checkstyle errors goes down over time


If developers use the IDE of choice, then they should use the formatter
before check in, if not, then they are otherwise responsible for making
sure they check in code that doesn't increase the number of Checkstyle
errors significantly.

Also, developers should try to commit style-fix-only changes in commits
separate from feature-or-bug-fix changes.

   michael



On Wed, 12 May 2010, Andreas Prlic wrote:

> Eclipse has code style templates. Are they based on a standard that
> can be shared between IDEs? if yes the easiest would be to define such
> a template and make everybody use it....
>
> Andreas
>
>
>
> On Wed, May 12, 2010 at 4:11 PM, Spencer Bliven <sbliven at ucsd.edu> wrote:
> > Regarding diff tools, I think all the major tools ignore whitespace if you
> > set up the options right. In eclipse, this can be changed by right clicking.
> > For diff, use 'diff -b'. for svn, use 'svn diff -x -b'. Meld (linux) and
> > FileMerge (mac) also can easily switch back and forth. I assume the same is
> > true in netbeans, although I've never used it.
> >
> > That said, a good diff tool won't prevent the annoyance of trying to read
> > code with inconsistent whitespace. Lets set a standard (I like 4 spaces too)
> > and all agree to stick to it. Setting up pre-commit hooks in SVN seems like
> > it's usually more trouble than its worth (
> > http://stackoverflow.com/questions/1017953?tab=votes#tab-top).
> >
> > -Spencer
> >
> >
> > On Wed, May 12, 2010 at 4:56 AM, Andy Yates <ayates at ebi.ac.uk> wrote:
> >
> >> I can say that the Eclipse diff tool does care about whitespace and I'm
> >> quite sure that the Unix diff cares about it as well. I can't say anything
> >> about Netbeans since I haven't used it in years.
> >>
> >> With all the best respect if the formatting rules say 4 spaces per
> >> indentation & code comes in not behaving in that manner then it'll be
> >> reformatted. This is nothing against the person who does the commits just
> >> they should be aware that it _could_ happen. I should say my personal
> >> preference is 2 spaces per indentation; I am flexible about this & will go
> >> with what the majority agree. That said if I'm being flexible about it I
> >> hope others will be as well.
> >>
> >> Andy
> >>
> >> On 12 May 2010, at 12:41, LAW Andrew wrote:
> >>
> >> > I think the main thing should be for each of us to find a diff tool that
> >> doesn't care about whitespace. The other stuff (camelCase, use of braces
> >> [ALWAYS!!!], splitting lines) are more important and can/should be defined
> >> but if you tell me that we must use 2 spaces to indent and my editor of
> >> choice uses a tab then I'm probably not going to listen to you in all
> >> practical situations.
> >> >
> >> > Not being awkward, just pragmatic.
> >> >
> >> >
> >> > On 12 May 2010, at 12:26, Andy Yates wrote:
> >> >
> >> >> So long as they are documented then developers shouldn't complain when
> >> their formatting changes. I just want to avoid a situation like now with
> >> Scooter's check-in which has a lot of formatting changes so the code changes
> >> are quite hard to pick out.
> >> >>
> >> >> I've gone and started a page about conventions and have started a
> >> discussion. Once we are agreed on what should go into the conventions then
> >> they will migrate to the wiki page.
> >> >>
> >> >> Andy
> >> >>
> >> >> On 12 May 2010, at 12:09, LAW Andrew wrote:
> >> >>
> >> >>>
> >> >>> On 12 May 2010, at 11:52, Richard Holland wrote:
> >> >>>
> >> >>>> I see a need for a formal coding style here, regardless of what
> >> platform people are using. Taking Netbeans as a basis is a good start but it
> >> needs to be documented for contributors to read and follow, then enforced
> >> across the whole project.
> >> >>>
> >> >>> Absolutely. But the pain in making <insert favourite tool name here>
> >> use those conventions can be numbing.
> >> >>>
> >> >>>
> >> >>>
> >> >>> Later,
> >> >>>
> >> >>> Andy
> >> >>> --------
> >> >>> Yada, yada, yada...
> >> >>>
> >> >>> The University of Edinburgh is a charitable body, registered in
> >> Scotland, with registration number SC005336
> >> >>> Disclaimer: This e-mail and any attachments are confidential and
> >> intended solely for the use of the recipient(s) to whom they are addressed.
> >> If you have received it in error, please destroy all copies and inform the
> >> sender.
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> The University of Edinburgh is a charitable body, registered in
> >> >>> Scotland, with registration number SC005336.
> >> >>>
> >> >>
> >> >> --
> >> >> Andrew Yates                   Ensembl Genomes Engineer
> >> >> EMBL-EBI                       Tel: +44-(0)1223-492538
> >> >> Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
> >> >> Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/
> >> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> > Later,
> >> >
> >> > Andy
> >> > --------
> >> > Yada, yada, yada...
> >> >
> >> > The University of Edinburgh is a charitable body, registered in Scotland,
> >> with registration number SC005336
> >> > Disclaimer: This e-mail and any attachments are confidential and intended
> >> solely for the use of the recipient(s) to whom they are addressed. If you
> >> have received it in error, please destroy all copies and inform the sender.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > The University of Edinburgh is a charitable body, registered in
> >> > Scotland, with registration number SC005336.
> >> >
> >>
> >> --
> >> Andrew Yates                   Ensembl Genomes Engineer
> >> EMBL-EBI                       Tel: +44-(0)1223-492538
> >> Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
> >> Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> 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
> >
>
>
>
> --
> -----------------------------------------------------------------------
> Dr. Andreas Prlic
> Senior Scientist, RCSB PDB Protein Data Bank
> University of California, San Diego
> (+1) 858.246.0526
> -----------------------------------------------------------------------
>
> _______________________________________________
> 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