lunes, 3 de enero de 2011

Every programmer working as only one.

Content:
CheckStyle Eclipse plugin. Installation
Tunning your CheckStyle and Formatter
Every programmer working as only one
What if... I get a "Fileset from project [projectname] has no valid check configuration" Error?
CheckStyle configuration distribution


You had paid a huge amount of money to have your house built within three months, and you got it. It has roof, kitchen and perfect thermal isolation.

You had asked for the nice brick facade in the picture but... what the f*cking hell, every damn square meter of the wall has its own colour! All right, all right,it is a house, it will keep me safe and healthy; but, for Christ's sake, there are twenty shades of "red" and it is horrible! It is a sort of Scottish skirt for a colour-blind person, weird and not exactly homogeneous.

The upset owner of this house spent all the following afternoon seeking for an answer, and he could merely complain because every labourer said more or less the same: they did their square meter as perfect as they could, but they had their own style and they will not ever work exactly as the folk to the left (and, as it is impossible, they assumed they could do whatever they liked instead), so it is pretty much the sign of the artist.


Picasso 1)
if(){
sencence;
}


picasso B)
if()
{
sencence;
}


Picasso the third)
if() sencence;


Picasso delta)
if()
    sencence;


So here you are, your house is not your home, and twenty Picassos are happily being transported to their next crime.

We have to do something...


Our imaginary brand new IT department had SpringSource, did some work with Maven, but it is high time to moderate the creativity of the guys. So review how to set up and customize CheckStyle, and let's export it to the team.

The manual way, fair enough for today, is to export both files (CheckStyle and Formatter) and send them out via mail or shared folder. My "q" is not a capital letter this evening.

Export your CheckStyle configuration:
Window menu -> preferences -> CheckStyle -> Select your configuration and click Export. Select the desired target folder and new file name.

Export your Java Formatter configuration:
Window menu -> preferences -> Java -> Code Style -> Formatter -> Select your configuration -> Edit -> Export. Select the desired target folder and new file name.


Now you have your red brick, the same red for every brick. Every artist could still put the bricks in the wrong way, but the colour of the wall would be
uniform anyway. Fire that labour if he did so as a revenge and keep working meanwhile.

Every developer in the team must now import both xml files, in the reverse most simple way.

Import your CheckStyle configuration: (Yes, I have just copy/pasted myself)
Window menu -> preferences -> CheckStyle -> type: External Configuration File, location: path+filename, name: the same name for everyone, whatever -> Ok and... Set as Default.

Import your Java Formatter configuration: (Ups, I did it again... )
Window menu -> preferences -> Java -> Code Style -> Formatter -> Import -> Select your file and it is done. Just select the new profile as the active one.


To activate CheckStyle and use Formatter, please check previous posts. Congratulations, you can truly start enjoying teamwork.

Damn artists...

pd: Thanks Javier del Palacio for your corrections. I owe you a "worker of the month". :)

No hay comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.