Welcome to this Blog. I am Software Engineer and work for Zühlke Engineering AG in Bern. This is my private blog, in which I will post mainly about technical stuff like Software Engineering or IT related topics. The views expressed herein do not necessarily represent those of my employer.

 

 
 

 

Ever wondered, how you can force a team to use same code style and same code convention?

If you use Eclipse,  there is a simple solution. Just install these two plug-ins und the live will be easier ;-)

  • Checkstyle
    Used to check the layout of the code. Do all methods have it’s Javadoc? Has the file the company header? Can be easily used in Eclipse and with Ant. 
     
    enable Checkstyle on a project:
     Checkstyle Property Window  
     
    run Checkstyle (could also be done by ANT):
     Checkstyle - check code  
     
    check out the warnings on the left border:
     Checkstyle - warning 
     
     
     
  • FormatOnSave
    Eclipse plug-in, which formats the code on every save. Simply install this plug-in on the Eclipse installation of every team member and the code is now always in correct format. Just don’t forget to define the right format template on each installation.
     
    FormatOnSave
    OI = Organize Imports (on save)
    SM = Sort Members (on save)
    CI = Correct Identation (on save)
    F = Format (on save)

 

 

 

 

 
Leave a comment