-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature flag: com.palantir.baseline-format.palantir-java-format=t…
…rue (#936) Users can opt-in to format their files using our fork of google-java-format (palantir-java-format)
- Loading branch information
1 parent
a7f4778
commit 1afd60b
Showing
12 changed files
with
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: feature | ||
feature: | ||
description: Users can opt-in to format their files using our fork of google-java-format | ||
(palantir-java-format) | ||
links: | ||
- https://github.com/palantir/gradle-baseline/pull/936 |
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
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
18 changes: 18 additions & 0 deletions
18
...java/src/test/resources/com/palantir/baseline/palantirjavaformat-expected/BlankLines.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,18 @@ | ||
package test; | ||
|
||
public class Test { | ||
/** | ||
* Docstring that looks like a list: | ||
* | ||
* <p>1. hey 2. there | ||
* | ||
* <p>with blank line. | ||
*/ | ||
Void test() { | ||
/* | ||
Normal comment | ||
with blank line. | ||
*/ | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ne-java/src/test/resources/com/palantir/baseline/palantirjavaformat-expected/Correct.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,11 @@ | ||
package test; | ||
|
||
public class Test { | ||
void test() { | ||
int x = 1; | ||
System.out.println("Hello"); | ||
Optional.of("hello").orElseGet(() -> { | ||
return "Hello World"; | ||
}); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ne-java/src/test/resources/com/palantir/baseline/palantirjavaformat-expected/Invalid.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,11 @@ | ||
package test; | ||
|
||
public class Test { | ||
void test() { | ||
int x = 1; | ||
System.out.println("Hello"); | ||
Optional.of("hello").orElseGet(() -> { | ||
return "Hello World"; | ||
}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...java/src/test/resources/com/palantir/baseline/palantirjavaformat-expected/Multicatch.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,15 @@ | ||
package test; | ||
|
||
class Multicatch { | ||
void test() { | ||
try { | ||
// whatever | ||
} catch (ClassNotFoundException | ||
| ClassCastException | ||
| NoSuchMethodException | ||
| IllegalAccessException | ||
| InvocationTargetException e) { | ||
// ignore | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../resources/com/palantir/baseline/palantirjavaformat-expected/MultilineStringConstant.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,18 @@ | ||
package test; | ||
|
||
class MultilineStringConstant { | ||
|
||
// NON-NLS comments are required for i18n, it's important they are kept with their strings. | ||
private static final String MULTIPLE_LINE_NON_NLS = "field_0," | ||
+ //$NON-NLS-1$ | ||
"field_1," | ||
+ //$NON-NLS-1$ | ||
"field_2," | ||
+ //$NON-NLS-1$ | ||
"field_3," | ||
+ //$NON-NLS-1$ | ||
"field_4"; //$NON-NLS-1$ | ||
|
||
private static final String MULTIPLE_LINE_NO_COMMENT = | ||
"field_0," + "field_1," + "field_2," + "field_3," + "field_4"; | ||
} |
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