-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update `Formatter` so that line endings are now detected based on the contents of the file. This mirrors the behavior of the Eclipse plugin when used in the IDE, specifically the `nextDelimiterInfo` method in `org.eclipse.jface.text.DefaultLineTracker`. See gh-340
- Loading branch information
Showing
12 changed files
with
86 additions
and
5 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
2 changes: 2 additions & 0 deletions
2
spring-javaformat-maven/spring-javaformat-maven-plugin/src/it/.gitattributes
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,2 @@ | ||
# Test resources that need a predictable eol | ||
apply*/src/main/java/simple/Simple.java eol=lf |
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
4 changes: 4 additions & 0 deletions
4
spring-javaformat/spring-javaformat-formatter-tests/src/test/resources/.gitattributes
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,4 @@ | ||
# Test resources that need specific eol | ||
**/correct-crlf.txt eol=crlf | ||
**/correct-cr.txt eol=cr | ||
**/correct-lf.txt eol=lf |
1 change: 1 addition & 0 deletions
1
...g-javaformat/spring-javaformat-formatter-tests/src/test/resources/expected/correct-cr.txt
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 @@ | ||
package correct;public class CorrectCr { public static void main(String[] args) throws Exception { // FIXME }} | ||
|
9 changes: 9 additions & 0 deletions
9
...javaformat/spring-javaformat-formatter-tests/src/test/resources/expected/correct-crlf.txt
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,9 @@ | ||
package correct; | ||
|
||
public class CorrectCrlf { | ||
|
||
public static void main(String[] args) throws Exception { | ||
// FIXME | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
...g-javaformat/spring-javaformat-formatter-tests/src/test/resources/expected/correct-lf.txt
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,9 @@ | ||
package correct; | ||
|
||
public class CorrectLf { | ||
|
||
public static void main(String[] args) throws Exception { | ||
// FIXME | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
spring-javaformat/spring-javaformat-formatter-tests/src/test/resources/source/correct-cr.txt
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 @@ | ||
package correct;public class CorrectCr { public static void main(String[] args) throws Exception { // FIXME }} | ||
|
9 changes: 9 additions & 0 deletions
9
...g-javaformat/spring-javaformat-formatter-tests/src/test/resources/source/correct-crlf.txt
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,9 @@ | ||
package correct; | ||
|
||
public class CorrectCrlf { | ||
|
||
public static void main(String[] args) throws Exception { | ||
// FIXME | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
spring-javaformat/spring-javaformat-formatter-tests/src/test/resources/source/correct-lf.txt
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,9 @@ | ||
package correct; | ||
|
||
public class CorrectLf { | ||
|
||
public static void main(String[] args) throws Exception { | ||
// FIXME | ||
} | ||
|
||
} |
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