You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Maczka Michal <mi...@imtf.ch> on 2004/05/19 10:58:25 UTC

RE: cvs commit: maven-components/maven-project/src/test/java/org/ apache/maven/project AbstractProjectTestCase.java

Jason!

I have a question regarding the coding style you are using.
 
I thought that you are consequently using this style of putting braces:
"( expression )"
But to my surprise I can see that you are doing:

>   -        artifactResolver = ( ArtifactResolver ) lookup(
ArtifactResolver.ROLE ); (me)
>   +        artifactResolver = (ArtifactResolver) lookup(
ArtifactResolver.ROLE );   (you)



With IDEA 4 it is possible to export your coding style to the file. The same
can be done with Eclipse.
Will it be possible to put your coding style definition file into some
location which is publicly available. 
I can do the same thing for eclipse and then we can try to make them as
similar as possible and share those
definitions among all developers.


Michal

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


RE: cvs commit: maven-components/maven-project/src/test/java/org/ apache/maven/project AbstractProjectTestCase.java

Posted by Jerome Lacoste <je...@coffeebreaks.org>.
On Wed, 2004-05-19 at 04:58, Maczka Michal wrote:
> Jason!
> 
> I have a question regarding the coding style you are using.
>  
> I thought that you are consequently using this style of putting braces:
> "( expression )"
> But to my surprise I can see that you are doing:
> 
> >   -        artifactResolver = ( ArtifactResolver ) lookup(
> ArtifactResolver.ROLE ); (me)
> >   +        artifactResolver = (ArtifactResolver) lookup(
> ArtifactResolver.ROLE );   (you)
> 
> 
> 
> With IDEA 4 it is possible to export your coding style to the file. The same
> can be done with Eclipse.
> Will it be possible to put your coding style definition file into some
> location which is publicly available. 
> I can do the same thing for eclipse and then we can try to make them as
> similar as possible and share those
> definitions among all developers.

And there's checkstyle as well. I wonder if one will one day try to make
all these configs uniform or at least provide a common coding style
format that one can export to the different tool's config....

That would really help the community.

Jerome


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


maintaining correct style

Posted by Jerome Lacoste <je...@coffeebreaks.org>.
> An other approach is to change automatically the code on the server with a
> cron like this every day:
> - checkout the code
> - run jalopy or other code formatter
> - checkin all changes with [Maven formatter] in message.
> 
> With this process, we'll have only files checkin in the day that will be
> reformating.

Problem I see with that is: if I work on a branch where the code is not clean, this automatic process may introduce merge conflicts. 
Of course these conflicts can appear by manual style changes, but they are less likely to.

I think I would rather provide the option to the developers to clean their code before checkin, and make it sure that it is a required practice.
People here should be smart enough to run checkstyle task/goal before submitting a patch!

I just don't trust automatic code changes...

But after all, that's just my humble opinion, and as I don't have code in the tree yet, you can just discard it :)

Jerome


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


Re: cvs commit:maven-components/maven-project/src/test/java/org/apache/maven/projectAbstractProjectTestCase.java

Posted by Emmanuel Venisse <em...@venisse.net>.
----- Original Message ----- 
From: "Jerome Lacoste" <je...@coffeebreaks.org>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Wednesday, May 19, 2004 5:30 PM
Subject: Re: cvs
commit:maven-components/maven-project/src/test/java/org/apache/maven/project
AbstractProjectTestCase.java


>
> > Perhaps we can run Jalopy in cvs when we commit some modifications. With
> > this method, our code will be always well formatted.
> > I'll try to do this for all my business projects.
>
> Just as a note: the cruisecontrol project adopted a pretty drastic
approach: checkstyle is ran before the build.
> Meaning that a incorrect style will prevent you from developping.
>
> I wonder what the cruisecontrol developers think about this enforcement.
>
> I guess that's something one can adopt at the start of a project but not
when the project has many files and probably many inconsistencies.
> On the other side, one could always use his own style while developing,
and reformat before checkin. That would be less restrictive.
>
>
> And instead of changing automatically the code on the server, I'd rather
have an error thrown at commit (rejected commit).
>
> Might be too costly though with CVS (better with a transaction based SCM
tool).

An other approach is to change automatically the code on the server with a
cron like this every day:
- checkout the code
- run jalopy or other code formatter
- checkin all changes with [Maven formatter] in message.

With this process, we'll have only files checkin in the day that will be
reformating.

Emmanuel


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


Re: cvs commit: maven-components/maven-project/src/test/java/org/apache/maven/project AbstractProjectTestCase.java

Posted by Jerome Lacoste <je...@coffeebreaks.org>.
> Perhaps we can run Jalopy in cvs when we commit some modifications. With
> this method, our code will be always well formatted.
> I'll try to do this for all my business projects.

Just as a note: the cruisecontrol project adopted a pretty drastic approach: checkstyle is ran before the build.
Meaning that a incorrect style will prevent you from developping.

I wonder what the cruisecontrol developers think about this enforcement.

I guess that's something one can adopt at the start of a project but not when the project has many files and probably many inconsistencies.
On the other side, one could always use his own style while developing, and reformat before checkin. That would be less restrictive.


And instead of changing automatically the code on the server, I'd rather have an error thrown at commit (rejected commit).

Might be too costly though with CVS (better with a transaction based SCM tool).

Jerome


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


Re: cvs commit: maven-components/maven-project/src/test/java/org/apache/maven/project AbstractProjectTestCase.java

Posted by Emmanuel Venisse <em...@venisse.net>.
----- Original Message ----- 
From: "Jason van Zyl" <jv...@maven.org>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Wednesday, May 19, 2004 2:26 PM
Subject: RE: cvs commit:
maven-components/maven-project/src/test/java/org/apache/maven/project
AbstractProjectTestCase.java


> On Wed, 2004-05-19 at 04:58, Maczka Michal wrote:
> > Jason!
> >
> > I have a question regarding the coding style you are using.
> >
> > I thought that you are consequently using this style of putting braces:
> > "( expression )"
> > But to my surprise I can see that you are doing:
> >
> > >   -        artifactResolver = ( ArtifactResolver ) lookup(
> > ArtifactResolver.ROLE ); (me)
> > >   +        artifactResolver = (ArtifactResolver) lookup(
> > ArtifactResolver.ROLE );   (you)
> >
> >
> >
> > With IDEA 4 it is possible to export your coding style to the file. The
same
> > can be done with Eclipse.
> > Will it be possible to put your coding style definition file into some
> > location which is publicly available.
>
> Sure, I'm using the same definitions I've been using for a long time. I
> haven't changed anything in the recent past.
>
> > I can do the same thing for eclipse and then we can try to make them as
> > similar as possible and share those
> > definitions among all developers.
>
> Cool, it would certainly be cool to make all tools obey a common format
> for source formatting, checking and styling.

Perhaps we can run Jalopy in cvs when we commit some modifications. With
this method, our code will be always well formatted.
I'll try to do this for all my business projects.

Emmanuel


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


RE: cvs commit: maven-components/maven-project/src/test/java/org/ apache/maven/project AbstractProjectTestCase.java

Posted by Jason van Zyl <jv...@maven.org>.
On Wed, 2004-05-19 at 04:58, Maczka Michal wrote:
> Jason!
> 
> I have a question regarding the coding style you are using.
>  
> I thought that you are consequently using this style of putting braces:
> "( expression )"
> But to my surprise I can see that you are doing:
> 
> >   -        artifactResolver = ( ArtifactResolver ) lookup(
> ArtifactResolver.ROLE ); (me)
> >   +        artifactResolver = (ArtifactResolver) lookup(
> ArtifactResolver.ROLE );   (you)
> 
> 
> 
> With IDEA 4 it is possible to export your coding style to the file. The same
> can be done with Eclipse.
> Will it be possible to put your coding style definition file into some
> location which is publicly available. 

Sure, I'm using the same definitions I've been using for a long time. I
haven't changed anything in the recent past.

> I can do the same thing for eclipse and then we can try to make them as
> similar as possible and share those
> definitions among all developers.

Cool, it would certainly be cool to make all tools obey a common format
for source formatting, checking and styling.

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

-- 
jvz.

Jason van Zyl
jason@maven.org
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


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