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

Skip packages

crittje050 opened this issue · comments

Hi,

In our project we have auto generated files (for example created by wsd2java). We prefer not to format auto generated files. Based on the README and a quick look at the code I believe there is no option to skip certain packages (or files) to apply the formatting to, corrrect?

In my opinion it would be helpful to add something like this to the configuration:

<configuration>
    <skipPackages>
        <skipPackage>[Path of package]</skipPackage>
        <skipPackage>[Path of package]</skipPackage>
    </skipPackages>
</configuration>

As I like to apply the plugin to our project I would be very happy with this feature.
What is your opinion?

Hi,

The plugin only formats source files (e.g. src/main/java ).
Your generated files are expected to reside in the maven output directory (e.g. target ). That's the standard and best practice.
If you use wsd2java maven plugin, that should be implicitly the case.

If you need this nonetheless, you can use globPattern property in the plugin configuration section.
Its usage is partially described in https://github.com/Cosium/git-code-format-maven-plugin#manual-code-formatting .

Hi @reda-alaoui

Thanks for your quick answers. We are not (or actually partially) using the maven plugin for wsdl2java. I will play around with the globPattern today and see whether it works as suitable for us.

Thanks!