Skip to content

Commit 19a7a5e

Browse files
refactor: Operator wrapping on end of line
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.OperatorWrap?organizationId=T3BlblJld3JpdGU%3D#defaults=W3sidmFsdWUiOiJFT0wiLCJuYW1lIjoid3JhcE9wdGlvbiJ9XQ== Co-authored-by: Moderne <team@moderne.io>
1 parent 98c7cd7 commit 19a7a5e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plugin/src/main/java/org/openrewrite/gradle/isolated/DefaultProjectParser.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ public void run(ResultsContainer results, ExecutionContext ctx) {
488488
Path afterLocation = results.getProjectRoot().resolve(result.getAfter().getSourcePath());
489489
File afterParentDir = afterLocation.toFile().getParentFile();
490490
// Rename the directory if its name case has been changed, e.g. camel case to lower case.
491-
if (afterParentDir.exists()
492-
&& afterParentDir.getAbsolutePath().equalsIgnoreCase((originalParentDir.getAbsolutePath()))
493-
&& !afterParentDir.getAbsolutePath().equals(originalParentDir.getAbsolutePath())) {
491+
if (afterParentDir.exists() &&
492+
afterParentDir.getAbsolutePath().equalsIgnoreCase((originalParentDir.getAbsolutePath())) &&
493+
!afterParentDir.getAbsolutePath().equals(originalParentDir.getAbsolutePath())) {
494494
if (!originalParentDir.renameTo(afterParentDir)) {
495495
throw new RuntimeException("Unable to rename directory from " + originalParentDir.getAbsolutePath() + " To: " + afterParentDir.getAbsolutePath());
496496
}
@@ -1101,14 +1101,14 @@ private SourceFileStream parseGradleFiles(
11011101
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
11021102
Path dirFromRoot = baseDir.relativize(dir);
11031103
String name = dirFromRoot.toString();
1104-
if (subproject.getLayout().getBuildDirectory().getAsFile().get().toPath().equals(dir)
1105-
|| name.startsWith(".") // Skip .gradle, .idea, .moderne, etc.
1104+
if (subproject.getLayout().getBuildDirectory().getAsFile().get().toPath().equals(dir) ||
1105+
name.startsWith(".") // Skip .gradle, .idea, .moderne, etc.
11061106
|| name.equals("out") // IntelliJ standard output directory
11071107
|| subproject.getSubprojects().stream()
1108-
.anyMatch(sp -> dir.equals(sp.getProjectDir().toPath()))
1109-
|| subproject.getGradle().getIncludedBuilds().stream()
1110-
.anyMatch(ib -> dir.equals(ib.getProjectDir().toPath()))
1111-
|| isExcluded(exclusions, baseDir.relativize(dir))) {
1108+
.anyMatch(sp -> dir.equals(sp.getProjectDir().toPath())) ||
1109+
subproject.getGradle().getIncludedBuilds().stream()
1110+
.anyMatch(ib -> dir.equals(ib.getProjectDir().toPath())) ||
1111+
isExcluded(exclusions, baseDir.relativize(dir))) {
11121112
return FileVisitResult.SKIP_SUBTREE;
11131113
}
11141114

0 commit comments

Comments
 (0)