HubSpot / prettier-maven-plugin

Apache License 2.0
116 stars 23 forks source link

Format files in /src/integration-test/java #34

Closed fabian-froehlich closed 2 years ago

fabian-froehlich commented 3 years ago

We format our code with maven mvn prettier:write

Unfortunetly the maven plugin does not work in our gitlab-ci pipeline hence we use the npm package with prettier --check --config ./.prettierrc.yml --no-editorconfig "**/*.java" in gitlab-ci.

That way we figured out, that the npm package does find issues within the folder /src/integration-test/java. Those files seems to be not formatted with the maven plugin. The integration-test folder is created with build-helper-maven-plugin.

Snipped from pom.xml

<!-- Prettier Formatter -->
<plugin>
    <groupId>com.hubspot.maven.plugins</groupId>
    <artifactId>prettier-maven-plugin</artifactId>
    <version>0.11</version>
    <configuration>
        <ignoreEditorConfig>true</ignoreEditorConfig>
        <nodeVersion>12.13.0</nodeVersion>
        <prettierJavaVersion>0.8.3</prettierJavaVersion>
    </configuration>
</plugin>
jhaber commented 2 years ago

You should be able to add custom directories via the inputGlobs configuration parameter. For example:

<inputGlobs>
    <inputGlob>src/main/java/**/*.java</inputGlob>
    <inputGlob>src/test/java/**/*.java</inputGlob>
    <inputGlob>src/integration-test/java/**/*.java</inputGlob>
</inputGlobs>