-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fail check task when there are failures in formatting (#58)
Co-authored-by: Guido Schreuder <[email protected]> Co-authored-by: Martin Laporte <[email protected]>
- Loading branch information
1 parent
685c712
commit ea4e29d
Showing
4 changed files
with
93 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.apache.maven.plugin.my.unit</groupId> | ||
<artifactId>project-to-test</artifactId> | ||
<version>1.0.0</version> | ||
<packaging>jar</packaging> | ||
<name>Test MyMojo</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>3.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.coveo</groupId> | ||
<artifactId>fmt-maven-plugin</artifactId> | ||
<version>1.0.0</version> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>format</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
25 changes: 25 additions & 0 deletions
25
src/test/resources/failed_formatting/src/main/java/HelloWorld1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package notestsource.src.main.java; | ||
|
||
import com.google.common.base.Preconditions; | ||
import java.util.List; | ||
// force non-contiguous imports | ||
import javax.annotations.Nullable; | ||
import static com.google.truth.Truth.assertThat; | ||
import static org.junit.Assert.fail; | ||
|
||
public class HelloWorld1 { | ||
|
||
<T> void check(@Nullable List<T> x) { | ||
Preconditions.checkNodeNull(x); | ||
} | ||
|
||
void f() { | ||
List<String> xs = null; | ||
assertThat(xs).isNull(); | ||
try { | ||
check(xs); | ||
fail(); | ||
} catch (NullPointerException e) { | ||
} | ||
} | ||
} |