Skip to content

Commit

Permalink
refactor: Operator wrapping on end of line
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne committed Sep 21, 2024
1 parent 98c7cd7 commit 19a7a5e
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ public void run(ResultsContainer results, ExecutionContext ctx) {
Path afterLocation = results.getProjectRoot().resolve(result.getAfter().getSourcePath());
File afterParentDir = afterLocation.toFile().getParentFile();
// Rename the directory if its name case has been changed, e.g. camel case to lower case.
if (afterParentDir.exists()
&& afterParentDir.getAbsolutePath().equalsIgnoreCase((originalParentDir.getAbsolutePath()))
&& !afterParentDir.getAbsolutePath().equals(originalParentDir.getAbsolutePath())) {
if (afterParentDir.exists() &&
afterParentDir.getAbsolutePath().equalsIgnoreCase((originalParentDir.getAbsolutePath())) &&
!afterParentDir.getAbsolutePath().equals(originalParentDir.getAbsolutePath())) {
if (!originalParentDir.renameTo(afterParentDir)) {
throw new RuntimeException("Unable to rename directory from " + originalParentDir.getAbsolutePath() + " To: " + afterParentDir.getAbsolutePath());
}
Expand Down Expand Up @@ -1101,14 +1101,14 @@ private SourceFileStream parseGradleFiles(
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
Path dirFromRoot = baseDir.relativize(dir);
String name = dirFromRoot.toString();
if (subproject.getLayout().getBuildDirectory().getAsFile().get().toPath().equals(dir)
|| name.startsWith(".") // Skip .gradle, .idea, .moderne, etc.
if (subproject.getLayout().getBuildDirectory().getAsFile().get().toPath().equals(dir) ||
name.startsWith(".") // Skip .gradle, .idea, .moderne, etc.
|| name.equals("out") // IntelliJ standard output directory
|| subproject.getSubprojects().stream()
.anyMatch(sp -> dir.equals(sp.getProjectDir().toPath()))
|| subproject.getGradle().getIncludedBuilds().stream()
.anyMatch(ib -> dir.equals(ib.getProjectDir().toPath()))
|| isExcluded(exclusions, baseDir.relativize(dir))) {
.anyMatch(sp -> dir.equals(sp.getProjectDir().toPath())) ||
subproject.getGradle().getIncludedBuilds().stream()
.anyMatch(ib -> dir.equals(ib.getProjectDir().toPath())) ||
isExcluded(exclusions, baseDir.relativize(dir))) {
return FileVisitResult.SKIP_SUBTREE;
}

Expand Down

0 comments on commit 19a7a5e

Please sign in to comment.