Skip to content

Commit

Permalink
Version 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
malaporte committed Aug 23, 2021
1 parent a844430 commit 0c5f8dc
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 38 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -22,7 +22,7 @@ To have your sources automatically formatted on each build, add to your pom.xml:
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand All @@ -43,7 +43,7 @@ If you prefer, you can only check formatting at build time using the `check` goa
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -81,7 +81,7 @@ example:
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<sourceDirectory>some/source/directory</sourceDirectory>
<testSourceDirectory>some/test/directory</testSourceDirectory>
Expand Down Expand Up @@ -124,7 +124,7 @@ example to not display the non-compliant files:
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<displayFiles>false</displayFiles>
</configuration>
Expand All @@ -147,7 +147,7 @@ example to limit the display up to 10 files
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<displayLimit>10</displayLimit>
</configuration>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -4,7 +4,7 @@

<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<packaging>maven-plugin</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -141,7 +141,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
19 changes: 7 additions & 12 deletions src/main/java/com/coveo/AbstractFMT.java
Expand Up @@ -3,7 +3,6 @@
import com.google.common.base.Charsets;
import com.google.common.io.CharSource;
import com.google.googlejavaformat.java.*;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
Expand All @@ -23,17 +22,15 @@
public abstract class AbstractFMT extends AbstractMojo {

@Parameter(
defaultValue = "${project.build.sourceDirectory}",
property = "sourceDirectory",
required = true
)
defaultValue = "${project.build.sourceDirectory}",
property = "sourceDirectory",
required = true)
private File sourceDirectory;

@Parameter(
defaultValue = "${project.build.testSourceDirectory}",
property = "testSourceDirectory",
required = true
)
defaultValue = "${project.build.testSourceDirectory}",
property = "testSourceDirectory",
required = true)
private File testSourceDirectory;

@Parameter(defaultValue = "${project.packaging}", required = true)
Expand Down Expand Up @@ -147,9 +144,7 @@ public void formatSourceFilesInDirectory(
FileFilter fileNameFilter = getFileNameFilter();
FileFilter pathFilter = getPathFilter();
long failures =
paths
.collect(Collectors.toList())
.parallelStream()
paths.collect(Collectors.toList()).parallelStream()
.filter(p -> p.toFile().exists())
.map(Path::toFile)
.filter(fileNameFilter::accept)
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/additionalfolders/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<additionalSourceDirectories>
<directory>${project.basedir}/src/additionalfolder</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/check_formatted/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/check_notformatted/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/check_notformatted_ignored/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<filesPathPattern>^((?!\Wignored\W).)*\.java$</filesPathPattern>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/failed_formatting/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/failonerrormissingsources/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<failOnUnknownFolder>true</failOnUnknownFolder>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/failonerrorwithsources/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<failOnUnknownFolder>true</failOnUnknownFolder>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/failonunknownstyle/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<style>nope</style>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/importunsorted/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/importunused/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/nosource/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/notestsource/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/onlyavajsources/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<additionalSourceDirectories>
<directory>${project.basedir}/src/additionalfolder</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/onlytestsources/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/simple/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/simple_aosp/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<style>aosp</style>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/simple_google/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<configuration>
<style>google</style>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/validateonly_formatted/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/validateonly_notformatted/pom.xml
Expand Up @@ -23,7 +23,7 @@
<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.11</version>
<version>2.12</version>
<executions>
<execution>
<goals>
Expand Down

0 comments on commit 0c5f8dc

Please sign in to comment.