HubSpot / prettier-maven-plugin

Apache License 2.0
116 stars 23 forks source link

Can we avoid formatting the generated sources ? #22

Closed zg2pro closed 2 years ago

zg2pro commented 3 years ago

Hi,

I embed maven-source-plugin to get a sources jar, it contains also the generated sources (I generate a bunch of java soap services from wsdl). The plugin parses them every time, which is a waste of time. Do you have any idea how I could avoid it ?

BR, Gregory

jhaber commented 3 years ago

Sorry for the delay, we use the source directory (normally src/main/java) and test source directory (normally src/test/java) as the inputs for formatting: https://github.com/HubSpot/prettier-maven-plugin/blob/41af5f47a4c3a72a373cb7fdc4105d1562bdc82a/src/main/java/com/hubspot/maven/plugins/prettier/AbstractPrettierMojo.java#L148-L149

Do these generated classes live inside one of these directories? You can also try using a .prettierignore file: https://prettier.io/docs/en/ignore.html#ignoring-files-prettierignore This file would go at the root of the Maven module containing these files