Skip to content

Commit 6097668

Browse files
author
TheSnoozer
committed
make checkstyle happy
1 parent 76696dc commit 6097668

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

src/main/java/pl/project13/maven/git/GitDirLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ private File processGitDirFile(@Nonnull File file) {
152152
/**
153153
* Attempts to resolve the actual location of the .git folder for a given
154154
* worktree.
155-
* For example for a worktree like {@code a/.git/worktrees/X} structure would return {@code a/.git}.
155+
* For example for a worktree like {@code a/.git/worktrees/X} structure would
156+
* return {@code a/.git}.
156157
*
157158
* If the conditions for a git worktree like file structure are met simply return the provided
158159
* argument as is.

src/test/java/pl/project13/maven/git/GitDirLocatorTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ public void shouldResolveRelativeSubmodule() throws Exception {
7070

7171
// and a .git dir in submodule that points to the main's project .git/modules/submodule
7272
File dotGitDir = folder.getRoot().toPath()
73-
.resolve("main-project")
74-
.resolve("sub-module")
75-
.resolve(".git")
76-
.toFile();
73+
.resolve("main-project")
74+
.resolve("sub-module")
75+
.resolve(".git")
76+
.toFile();
7777
Files.write(
78-
dotGitDir.toPath(),
79-
"gitdir: ../.git/modules/sub-module".getBytes()
78+
dotGitDir.toPath(),
79+
"gitdir: ../.git/modules/sub-module".getBytes()
8080
);
8181

8282
try {
@@ -87,9 +87,9 @@ public void shouldResolveRelativeSubmodule() throws Exception {
8787
// then
8888
assertThat(foundDirectory).isNotNull();
8989
assertThat(
90-
foundDirectory.getCanonicalFile()
90+
foundDirectory.getCanonicalFile()
9191
).isEqualTo(
92-
folder.getRoot().toPath()
92+
folder.getRoot().toPath()
9393
.resolve("main-project")
9494
.resolve(".git")
9595
.resolve("modules")

src/test/java/pl/project13/maven/git/GitIntegrationTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@
2626

2727
import java.io.File;
2828
import java.io.IOException;
29-
import java.util.*;
29+
import java.util.ArrayList;
30+
import java.util.Collection;
31+
import java.util.List;
32+
import java.util.Optional;
33+
import java.util.Properties;
3034
import java.util.concurrent.ThreadLocalRandom;
3135
import javax.annotation.Nonnull;
3236
import org.apache.commons.io.FileUtils;
@@ -164,7 +168,7 @@ private static List<MavenProject> getReactorProjects(@Nonnull MavenProject proje
164168
}
165169

166170
public static void assertPropertyPresentAndEqual(
167-
Properties properties, String key, String expected) {
171+
Properties properties, String key, String expected) {
168172
assertThat(properties.stringPropertyNames()).contains(key);
169173
assertThat(properties.getProperty(key)).isEqualTo(expected);
170174
}

src/test/java/pl/project13/maven/git/GitSubmodulesTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
package pl.project13.maven.git;
2020

2121
import java.nio.file.Files;
22-
2322
import junitparams.JUnitParamsRunner;
2423
import junitparams.Parameters;
2524
import org.apache.maven.project.MavenProject;
@@ -34,7 +33,8 @@ public class GitSubmodulesTest extends GitIntegrationTest {
3433

3534
@Test
3635
@Parameters(method = "useNativeGit")
37-
public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(boolean useNativeGit) throws Exception {
36+
public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(
37+
boolean useNativeGit) throws Exception {
3838
mavenSandbox
3939
.withParentProject("my-jar-project", "jar")
4040
.withGitRepoInParent(AvailableGitTestRepo.WITH_SUBMODULES)
@@ -57,18 +57,19 @@ public void shouldResolvePropertiesOnDefaultSettingsForNonPomProject(boolean use
5757
public void shouldGeneratePropertiesWithSubmodules(boolean useNativeGit) throws Exception {
5858
// given
5959
mavenSandbox
60-
.withParentProject("my-pom-project", "pom")
61-
.withGitRepoInParent(AvailableGitTestRepo.WITH_REMOTE_SUBMODULES)
62-
.withChildProject("remote-module", "jar")
63-
.create();
60+
.withParentProject("my-pom-project", "pom")
61+
.withGitRepoInParent(AvailableGitTestRepo.WITH_REMOTE_SUBMODULES)
62+
.withChildProject("remote-module", "jar")
63+
.create();
6464
MavenProject targetProject = mavenSandbox.getChildProject();
6565
setProjectToExecuteMojoIn(targetProject);
6666

67-
// create a relative pointer to trigger the relative path logic in GitDirLocator#lookupGitDirectory
67+
// create a relative pointer to trigger the relative path logic in
68+
// GitDirLocator#lookupGitDirectory
6869
// makes the dotGitDirectory look like "my-pom-project/.git/modules/remote-module"
6970
Files.write(
70-
mavenSandbox.getChildProject().getBasedir().toPath().resolve(".git"),
71-
"gitdir: ../.git/modules/remote-module".getBytes()
71+
mavenSandbox.getChildProject().getBasedir().toPath().resolve(".git"),
72+
"gitdir: ../.git/modules/remote-module".getBytes()
7273
);
7374

7475
mojo.useNativeGit = useNativeGit;
@@ -77,6 +78,7 @@ public void shouldGeneratePropertiesWithSubmodules(boolean useNativeGit) throws
7778
mojo.execute();
7879

7980
// then
80-
assertPropertyPresentAndEqual(targetProject.getProperties(), "git.commit.id.abbrev", "945bfe6");
81+
assertPropertyPresentAndEqual(
82+
targetProject.getProperties(), "git.commit.id.abbrev", "945bfe6");
8183
}
8284
}

0 commit comments

Comments
 (0)