Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [papyrus-rt-dev] Code formatting and checkstyle rules

Hi,

 

It’s difficult to apply the formatting during build, because formatting doesn’t affect compiled artifacts: it affects the git repository. Hudson doesn’t have the permission to change the git repository

 

Pre-commit hooks could help, but they can be complex to set up. Eclipse allows “Save actions” to be configured, so that the formatter is applied automatically everytime you change a (java) file. Oomph could probably enforce it for all projects (Then once it is enforced by Oomph, all users will automatically have it enabled, even if they have not installed Oomph)

 

It can be manually enabled in Preferences > Java > Editor > Save actions, but it is not compatible with the Clean Up profile (Rather redundant with it)

 

Regards,
Camille

 

De : papyrus-rt-dev-bounces@xxxxxxxxxxx [mailto:papyrus-rt-dev-bounces@xxxxxxxxxxx] De la part de Ernesto Posse
Envoyé : mercredi 16 mars 2016 16:40
À : papyrus-rt developer discussions <papyrus-rt-dev@xxxxxxxxxxx>
Objet : Re: [papyrus-rt-dev] Code formatting and checkstyle rules

 

Thanks Céline and Christian. It is still unclear to me if the idea is to apply the formatting automatically, say, in each commit, or during the build? Or would the settings include the JDT's "Save Actions" preferences to format?

 

On Wed, Mar 16, 2016 at 11:33 AM, Céline JANSSENS <celine.janssens@xxxxxxxxxxx> wrote:

Ok thank you Christian,

I keep your offer in mind...

Do you thing we should define a specific clean up, formatter or code template for Papyrus RT ?
I would think it can be the same as Papyrus project... to keep an homogeneity  between projects.

As soon as I have a proper checkstyle, and it has been validated by the community, I let you know !

Thanks

Céline

 

Le 16/03/2016 16:22, Christian Damus a écrit :

BTW, if somebody would like to commit project-specific settings for these various tools:

  • JDT code clean-up
  • JDT formatter
  • JDT code templates (including the copyright header)
  • Checkstyle rules

to the org.eclipse.papyrusrt.umlrt.core project, I’d be happy to supply a Gerrit patch that

  • configures the project to specify which settings Oomph should propagate to other projects
  • does the initial propagation of those settings to all the other projects

Cheers,

Christian

 

On 16 March, 2016 at 11:09:57, Céline JANSSENS (celine.janssens@xxxxxxxxxxx) wrote:

Hello Christian,

For those clean up, formatter and Code Template, I agree with you. The size of the project doesn't matter . But we know that a few is not using Oomph installer. (which is a shame, you'd agree ;)

However, if we want to activate a checkstyle, it will be easier to update few plugins to fit those rules like in Papyrus RT than a huge number of plugins like Papyrus.
We would like to put checkstyle in place asap before it becomes a mess to apply those new constraints to the existing java files.
I guess if we apply a fully configurated checkstyle on Papyrus, 95 % of the java files will be in error ! (or at least with a huge number of warnings).

So let's start with this small project ;)

Earlier we put a checkstyle in place in a project, better it is ! Isn't it ?

Regards

Céline


Le 16/03/2016 15:26, Christian Damus a écrit :

Hi, Céline, Philip,

 

For what it’s worth, the size of the project doesn’t matter if you use the Oomph Project Configuration Management tooling to maintain settings like these in the project .settings/.  That is what we do in the Papyrus project:  the settings in the org.eclipse.papyrus.infra.core project are the “master” source of settings and are propagated automatically to all other projects in the same repository.

 

Cheers,

 

Christian

 

 

On 16 March, 2016 at 09:22:32, Céline JANSSENS (celine.janssens@xxxxxxxxxxx) wrote:

Hello Philip,

I completely agree with you, it must be done soon, as the project is not so big yet.

For your information, I'm working on this already. I  modified the pom file on the Papyrus RT project to manage a Sonar Job, which is running every day but still have some dependancies issues due to profile setting.
I asked Benoit to have a look, but he is quite busy until the end of the week.

In addition, Papyrus already has a formatter, a cleanup and a Code Template file.
Which is the one I use in Papyrus RT. You can find those templates here:



All4Tec is used to work with checkstyle. Which is quite efficient. I will adapt the one we use for Papyrus RT and once in place we could discuss about its content. And disable or enable rules accordingly.

The Checkstyle file is based on the Sonar standard rules.

A discussion has been started about the Development best practices here:
https://wiki.eclipse.org/Papyrus/Neon_Work_Description/Discussions/Development_rules

It could be a good starting point to our checkstyle.

Best regards
Céline




Le 16/03/2016 14:01, Philip Langer a écrit :

Hi Papyrus-RT-dev team,

 

we noticed that there don't seem to exist any central code formatting settings and checkstyle rules. Before the project gets too large, it may pay off to introduce and consistently use such settings and rules. Otherwise it may soon get too cumbersome to introduce them once the code base gets too large.

 

We think that they'd help to keep the project maintainable on the long run and avoid tedious git conflicts due to inconsistent formatting, etc.

 

What do you think? We'd volunteer to propose them in a new gerrit patch.

 

Thanks and best wishes,

 

Philip

 

--

Dr. Philip Langer

Senior Software Architect / General Manager
EclipseSource Services GmbH

 

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev
 

 

--

 

 

 

Céline JANSSENS
Software Engineer
+33 (0)2 44 47 23 23

 

Mail : cej@xxxxxxxxxxx


6 rue Léonard De Vinci - BP 0119 - 53001 LAVAL Cedex - FRANCE
www.all4tec.net

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev

 

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev

 

--

 

 

 

Céline JANSSENS
Software Engineer
+33 (0)2 44 47 23 23

 

Mail : cej@xxxxxxxxxxx


6 rue Léonard De Vinci - BP 0119 - 53001 LAVAL Cedex - FRANCE
www.all4tec.net

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev

 

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev

 

--

 

 

 

Céline JANSSENS
Software Engineer
+33 (0)2 44 47 23 23

 

Mail : cej@xxxxxxxxxxx


6 rue Léonard De Vinci - BP 0119 - 53001 LAVAL Cedex - FRANCE
www.all4tec.net


_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev



 

--

Ernesto Posse

Zeligsoft.com

 


Back to the top