Cosium / git-code-format-maven-plugin

A maven plugin that automatically deploys code formatters as pre-commit git hook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unaable to exclude a particular folder

parthasaradhie opened this issue · comments

How to exclude one folder and execute on remaining folders ?
what is the globPatter for that
is glob pattern will support this ?

You can use the glob pattern or exclude specific modules by name.
Here is an example:

<plugin>
   <groupId>com.cosium.code</groupId>
   <artifactId>git-code-format-maven-plugin</artifactId>
   <version>${git-code-format-maven-plugin.version}</version>
   <configuration>
      <excludedModules>
         <module>module-foo</module>
      </excludedModules>
   </configuration>
   <executions>
      <execution>
         <id>install-formatter-hook</id>
         <goals>
            <goal>install-hooks</goal>
         </goals>
      </execution>
      <execution>
         <id>validate-code-format</id>
         <goals>
            <goal>validate-code-format</goal>
         </goals>
      </execution>
   </executions>
</plugin>

Hi I understand to exclude some modules can be excluded the and match with glob patterns

but my problem is i want to exclude only one folder for example:
com.test.controller.impl
com.test.generated.api
com.test.rest.documentaion

out of above packages only "/generated/" should be excluded and rest everything should format
my glob patterns
*/!(generated)/
*!(generated)/
*/!(generated)
/!(generated)/

above patterns are not working
colud kindly check why its not ?
if my glob patterns is wrong, could you kindly suggest which should be correct one
i'm trying from 3 days and couldn't able to make it work

I am not a glob pattern specialist (this plugin uses a library for that).
You will have to figure it out yourself. You should run maven in verbose and debug mode to ease the task.