Hi Romain,

There is  a maven plugin to execute walkmod during the build process. This
is a good option to allow people execute walkmod without any installation.

Moreover, if  you run "walkmod check", the tool shows in the command line
the modified files if there is any modification *at syntactic level* (eg,
remove an import).

However, the tomee conventions, don't change the AST, just rewrite the
files to ensure an specific EOL. Design a checking process at this level
implies to compare the contents of the file before writing with the
originals and this could be time consuming. However, if you are interested
I can offer an "option" to activate in order to apply this comparison.

Let me know if you need I create a new PR with the maven plugin
configuration.

Regards,


2015-11-30 0:27 GMT+01:00 Romain Manni-Bucau <[email protected]>:

> Hi Raquel,
>
> added walkmod.xml, apply is quite interesting and nice. We still need to
> use win EOL for few files - discovered it thanks to your work!:
>
> modified:
> assembly/openejb-standalone/src/main/resources/service.readme.txt
> modified:   tomee/apache-tomee/src/main/resources/service.readme.txt
>
> But other ones uses unix one which is respected by walkmod :).
>
>
> Execution on the whole master makes  INFO [main] - Total time: 59.304
> seconds. I would be interested to get a maven integration (mvn package
> would execute it by module and would make the build failing if something is
> not respected but wouldnt apply anything by default). Is that something
> existing?
>
> @others: anyone else to test?
>
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-11-27 17:21 GMT+01:00 Raquel Pau Fernández <[email protected]>:
>
> > Hi,
> >
> > According the discussion, I have improved walkmod to allow the
> > specification of the endline char according a platform.
> >
> > I have created a PR with the required configuration for walkmod. You juts
> > need to download and execute the 2.1.0 version from walkmod.com.
> >
> > Here my PR:
> > https://github.com/apache/tomee/pull/28
> >
> > Have a good weekend.
> >
> > 2015-11-19 21:36 GMT+01:00 Raquel Pau Fernández <[email protected]>:
> >
> > > ok! :-)
> > > yes, walkmod allows to validate the results locally
> > > El 19/11/2015 21:34, "Romain Manni-Bucau" <[email protected]>
> > > escribió:
> > >
> > >> @Raquel: happy to have a go with walkmod while it matches the
> > >> "validate locally" constraint
> > >>
> > >> Romain Manni-Bucau
> > >> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> > >>
> > >>
> > >> 2015-11-19 12:24 GMT-08:00 Raquel Pau Fernández <[email protected]
> >:
> > >> > Romain,
> > >> >
> > >> > Sorry, but I don't know the final conclusions, then :).Do you prefer
> > to
> > >> try
> > >> > other tools first to just format or are you interested in adapting
> > >> walkmod
> > >> > to include your conventions?
> > >> >
> > >> > In the second case, I would try to find time for it because for my
> > >> project,
> > >> > this is an opportunity. Finally, just one thing to remind, walkmod
> > would
> > >> > allow not just to format conventions, but also any good programming
> > >> > practices that you would to apply (eg. force final variables)
> without
> > >> > reformatting ;)
> > >> >
> > >> > Please, let me know the final conclusions :)
> > >> > Hi Raquel,
> > >> >
> > >> > kind of true. Said otherwise: re-formatting is most of the time
> > >> > considered as noise so it should only be applied to the changed code
> > >> > and not the code around or the files not modified at all and it
> should
> > >> > be done before the commit IMO.
> > >> >
> > >> > Starting from scratch it means you can enforce rules easily with any
> > >> > of the tools we spoke about but starting from a big codebase it
> needs
> > >> > some more precautions.
> > >> >
> > >> >
> > >> > Romain Manni-Bucau
> > >> > @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> > >> >
> > >> >
> > >> > 2015-11-19 10:34 GMT-08:00 Raquel Pau Fernández <
> [email protected]
> > >:
> > >> >> Hi,
> > >> >>
> > >> >> Walkmod allows to use a formatter, but I think that the problems
> that
> > >> >> people find are as follows:
> > >> >>
> > >> >> - We don't want a big commit with all the source files reformatted.
> > >> >>
> > >> >> - We don't want to apply the formatter incrementally to avoid a set
> > of
> > >> >> commits just for formatting issues.
> > >> >>
> > >> >> In fact i have found the same problems in Guava. Google is not
> > >> following
> > >> >> its own formatter style.
> > >> >>
> > >> >> Let me know if I am wrong,
> > >> >>
> > >> >> Regards
> > >> >> El 19/11/2015 18:45, "cchacin" <[email protected]> escribió:
> > >> >>
> > >> >>> I use the  Google Style Guide
> > >> >>> <http://google.github.io/styleguide/javaguide.html>   (with some
> > >> >>> modification like 4 spaces) in this way:
> > >> >>>
> > >> >>> For Eclipse:
> > >> >>> You can configure the formatter with this file:
> > >> >>>
> > >> >>>
> > >> >
> > >>
> >
> https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml
> > >> >>>
> > >> >>> For IntelliJ:
> > >> >>> You can configure the formatter with this file
> > >> >>>
> > >> >>>
> > >> >
> > >>
> >
> https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml
> > >> >>> Or use the eclipse formatter plugin
> > >> >>>
> > >> >>> For Netbeans: use the eclipse formatter plugin
> > >> >>>
> > >> >>> And there is a maven plugin
> > >> >>>
> > >> >>>
> > >> >
> > >>
> >
> https://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/format-mojo.html
> > >> >>>
> > >> >>> One suggestion can be to use a pre-commit hook or a webhook in
> your
> > >> VCS,
> > >> > I
> > >> >>> never use walkmod before but probably we can configure a hook with
> > >> > walkmod
> > >> >>> also. I think the most important part is to have the common
> > >> configuration
> > >> >>> file wih the desired styles.
> > >> >>>
> > >> >>>
> > >> >>>
> > >> >>> -----
> > >> >>> Carlos Chacin
> > >> >>> http://github.com/cchacin
> > >> >>> --
> > >> >>> View this message in context:
> > >> >>>
> > >> >
> > >>
> >
> http://tomee-openejb.979440.n4.nabble.com/PMD-Formatting-tp4676866p4676884.html
> > >> >>> Sent from the TomEE Dev mailing list archive at Nabble.com.
> > >> >>>
> > >>
> > >
> >
> >
> > --
> > Raquel Pau
> >
> > *"Education is the most powerful weapon which you can use to change the
> > world**"*
> >
> > Nelson Mandela
> >
> > personal page:
> > http://sites.google.com/site/raquelpau/
> >
>



-- 
Raquel Pau

*"Education is the most powerful weapon which you can use to change the
world**"*

Nelson Mandela

personal page:
http://sites.google.com/site/raquelpau/

Reply via email to