walkmod / walkmod-core

walkmod: an open source tool to fix coding style issues
http://www.walkmod.com
GNU Lesser General Public License v3.0
153 stars 23 forks source link

Maven sub projects not handled #66

Closed rgilles closed 7 years ago

rgilles commented 7 years ago

Hi, I'm testing walkmod on a maven project. I want to apply a refactoring action. Therefore I'm following the documentation of walkmod-refactor-plugin and execute the following sequence of command:

walkmod add -DrefactoringConfigFile="src/main/walkmod/refactor/refactoring-methods.json" refactor:classes
walkmod apply

After the execution of the first command I get a bunch of walkmod.xml file created under each sub project. What I notice is that only the root walkmod.xml contains the transform element. The others are just empty:

Root file

<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.1.dtd">
<walkmod>
    <modules>
        <module>parent</module>
        <module>lib</module>
        <module>feature</module>
        <module>itest</module>
    </modules>
    <transformation type="refactor:classes">
        <param name="refactoringConfigFile">src/main/walkmod/refactor/refactoring-methods.json</param>
    </transformation>
</walkmod>

sub projects file

<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD"  "http://www.walkmod.com/dtd/walkmod-1.1.dtd" >
<walkmod>
</walkmod>

When I run the apply command from the root project and nothing is transformed. In order to get the transformation applied I must run the first command add in all the sub projects and then run the apply command from the root one. It sounds like there is no transitivity of the root configuration. Is this a bug or should I proceed differently?

Thanks in advance, Romain

rpau commented 7 years ago

Hi Romain,

The transformation needs to be added (walkmod add) with the -R (recursively) flag, to add it into all the modules. Afterwards, you simply run walkmod apply. If you want to ask all the options of walkmod add (walkmod add --help)

Let me know if it has worked.

---- On mié, 10 may 2017 11:49:19 +0200 Romain Gilles <notifications@github.com> wrote ----

Hi,

I'm testing walkmod on a maven project. I want to apply a refactoring action. Therefore I'm following the documentation of walkmod-refactor-plugin and execute the following sequence of command:

walkmod add -DrefactoringConfigFile="src/main/walkmod/refactor/refactoring-methods.json" refactor:classes walkmod apply After the execution of the first command I get a bunch of walkmod.xml file created under each sub project.

What I notice is that only the root walkmod.xml contains the transform element. The others are just empty:

Root file

<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.1.dtd"&gt; <walkmod> <modules> <module>parent</module> <module>lib</module> <module>feature</module> <module>itest</module> </modules> <transformation type="refactor:classes"> <param name="refactoringConfigFile">src/main/walkmod/refactor/refactoring-methods.json</param> </transformation> </walkmod> sub projects file

<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.1.dtd" > <walkmod> </walkmod> When I run the apply command from the root project and nothing is transformed.

In order to get the transformation applied I must run the first command add in all the sub projects and then run the apply command from the root one.

It sounds like there is no transitivity of the root configuration.

Is this a bug or should I proceed differently?

Thanks in advance,

Romain

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rgilles commented 7 years ago

Sorry I did see it as it show the option is the reverse order that what I'm use to see:

--recursive, -R

Instead of

-R, --recursive

Again thank you and sorry to disturb you with this stupid issue.