Skip to content

Commit b59c522

Browse files
committed
Rename style from palantir to ojf
1 parent 7398c9a commit b59c522

17 files changed

Lines changed: 50 additions & 50 deletions

File tree

‎gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/spotless/NativePalantirJavaFormatStep.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ String format(ProcessRunner runner, String input) throws IOException, Interrupte
6262
logger.info("Using native-image at {}", execFile);
6363
execSignature = FileSignature.signAsSet(execFile);
6464
List<String> argumentsWithPathToExe =
65-
List.of(execSignature.getOnlyFile().getAbsolutePath(), "--palantir", "-");
65+
List.of(execSignature.getOnlyFile().getAbsolutePath(), "--ojf", "-");
6666
return runner.exec(input.getBytes(StandardCharsets.UTF_8), argumentsWithPathToExe)
6767
.assertExitZero(StandardCharsets.UTF_8);
6868
}

‎gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/ConfigureJavaFormatterXmlTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ConfigureJavaFormatterXmlTest {
5454
private static final String MISSING_CLASS_PATH = """
5555
<root>
5656
<component name="PalantirJavaFormatSettings">
57-
<option name="style" value="PALANTIR"/>
57+
<option name="style" value="OJF"/>
5858
</component>
5959
</root>
6060
""";
@@ -120,7 +120,7 @@ void configure_missingClassPath_added() {
120120
String expected = """
121121
<root>
122122
<component name="PalantirJavaFormatSettings">
123-
<option name="style" value="PALANTIR"/>
123+
<option name="style" value="OJF"/>
124124
<option name="enabled" value="true"/>
125125
<option name="implementationClassPath">
126126
<list>

‎open-java-format-benchmarks/src/jmh/java/com/palantir/javaformat/BenchmarkMultiFiles.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public final void runNativeImage(BenchmarkState state) throws InterruptedExcepti
8686
ProcessBuilder p = new ProcessBuilder();
8787
p.command(Stream.concat(
8888
Stream.of(
89-
Path.of(System.getenv("NATIVE_IMAGE_CLASSPATH")).toString(), "-i", "--palantir"),
89+
Path.of(System.getenv("NATIVE_IMAGE_CLASSPATH")).toString(), "-i", "--ojf"),
9090
state.filesToFormat.stream())
9191
.collect(Collectors.toList()));
9292
Process process = p.inheritIO().start();
@@ -99,7 +99,7 @@ public final void runNativeImage(BenchmarkState state) throws InterruptedExcepti
9999
public final void runNestedLevel(MultiLevelStates state) throws InterruptedException, IOException {
100100
ProcessBuilder p = new ProcessBuilder();
101101
p.command(List.of(
102-
Path.of(System.getenv("NATIVE_IMAGE_CLASSPATH")).toString(), "-i", "--palantir", state.fileToFormat));
102+
Path.of(System.getenv("NATIVE_IMAGE_CLASSPATH")).toString(), "-i", "--ojf", state.fileToFormat));
103103
Process process = p.inheritIO().start();
104104
assertThat(process.waitFor()).isEqualTo(0);
105105
}
@@ -121,7 +121,7 @@ public final void runJar(BenchmarkState state) throws InterruptedException, IOEx
121121
"--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
122122
"com.palantir.javaformat.java.Main",
123123
"-i",
124-
"--palantir"),
124+
"--ojf"),
125125
state.filesToFormat.stream())
126126
.collect(Collectors.toList()));
127127
Process process = p.inheritIO().start();

‎open-java-format-eclipse-plugin/src/main/java/com/palantir/javaformat/java/SnippetFormatter.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void closeBraces(int initialIndent) {
6262

6363
private static final int INDENTATION_SIZE = 4;
6464
private final Formatter formatter = Formatter.createFormatter(
65-
JavaFormatterOptions.builder().style(Style.PALANTIR).build());
65+
JavaFormatterOptions.builder().style(Style.OJF).build());
6666
private static final CharMatcher NOT_WHITESPACE = CharMatcher.whitespace().negate();
6767

6868
public String createIndentationString(int indentationLevel) {

‎open-java-format-idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirJavaFormatSettings.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static class State {
148148
private Optional<List<URI>> implementationClassPath = Optional.empty();
149149
private Optional<URI> nativeImageClassPath = Optional.empty();
150150

151-
public JavaFormatterOptions.Style style = JavaFormatterOptions.Style.PALANTIR;
151+
public JavaFormatterOptions.Style style = JavaFormatterOptions.Style.OJF;
152152

153153
public void setImplementationClassPath(@Nullable List<String> value) {
154154
implementationClassPath = Optional.ofNullable(value)

‎open-java-format-idea-plugin/src/main/java/com/palantir/javaformat/intellij/UiFormatterStyle.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/** Configuration options for the formatting style. */
2525
enum UiFormatterStyle {
26-
PALANTIR("Default Palantir Java style", Style.PALANTIR),
26+
OJF("Default Open Java Format style", Style.OJF),
2727
;
2828

2929
private final String description;

‎open-java-format-jdk-bootstrap/src/main/java/com/palantir/javaformat/bootstrap/BootstrappingFormatterService.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ default List<String> toArgs() {
139139
}
140140

141141
return args
142-
// Use palantir style
143-
.add("--palantir")
142+
// Use the open-java-format style
143+
.add("--ojf")
144144
// Trailing "-" enables formatting stdin -> stdout
145145
.add("-")
146146
.build();

‎open-java-format-jdk-bootstrap/src/main/java/com/palantir/javaformat/bootstrap/NativeImageFormatterService.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ default List<String> toArgs() {
115115
}
116116

117117
return args
118-
// Use palantir style
119-
.add("--palantir")
118+
// Use the open-java-format style
119+
.add("--ojf")
120120
// Trailing "-" enables formatting stdin -> stdout
121121
.add("-")
122122
.build();

‎open-java-format-spi/src/main/java/com/palantir/javaformat/java/JavaFormatterOptions.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
public final class JavaFormatterOptions {
3030

3131
public enum Style {
32-
/** The default Palantir Java Style configuration. */
33-
PALANTIR(2, 120),
32+
/** The default Open Java Format Style configuration. */
33+
OJF(2, 120),
3434

3535
/** The default Google Java Style configuration. */
3636
GOOGLE(1, 100),

‎open-java-format/src/main/java/com/palantir/javaformat/java/CommandLineOptions.java‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ final class CommandLineOptions {
3232
private final ImmutableRangeSet<Integer> characterRanges;
3333
private final ImmutableList<Integer> offsets;
3434
private final ImmutableList<Integer> lengths;
35-
private final boolean aosp;
36-
private final boolean palantirStyle;
35+
private final boolean aospStyle;
36+
private final boolean ojfStyle;
3737
private final boolean version;
3838
private final boolean help;
3939
private final boolean stdin;
@@ -53,8 +53,8 @@ final class CommandLineOptions {
5353
ImmutableRangeSet<Integer> characterRanges,
5454
ImmutableList<Integer> offsets,
5555
ImmutableList<Integer> lengths,
56-
boolean aosp,
57-
boolean palantirStyle,
56+
boolean aospStyle,
57+
boolean ojfStyle,
5858
boolean version,
5959
boolean help,
6060
boolean stdin,
@@ -72,8 +72,8 @@ final class CommandLineOptions {
7272
this.characterRanges = characterRanges;
7373
this.offsets = offsets;
7474
this.lengths = lengths;
75-
this.aosp = aosp;
76-
this.palantirStyle = palantirStyle;
75+
this.aospStyle = aospStyle;
76+
this.ojfStyle = ojfStyle;
7777
this.version = version;
7878
this.help = help;
7979
this.stdin = stdin;
@@ -118,13 +118,13 @@ ImmutableList<Integer> lengths() {
118118
}
119119

120120
/** Use AOSP style instead of Google Style (4-space indentation). */
121-
boolean aosp() {
122-
return aosp;
121+
boolean aospStyle() {
122+
return aospStyle;
123123
}
124124

125-
/** Use Palantir style instead of Google Style. */
126-
boolean palantirStyle() {
127-
return palantirStyle;
125+
/** Use Open Java Format style instead of Google Style. */
126+
boolean ojfStyle() {
127+
return ojfStyle;
128128
}
129129

130130
/** Print the version. */
@@ -197,8 +197,8 @@ static final class Builder {
197197
private final ImmutableList.Builder<Integer> offsets = ImmutableList.builder();
198198
private final ImmutableList.Builder<Integer> lengths = ImmutableList.builder();
199199
private boolean inPlace = false;
200-
private boolean aosp = false;
201-
private boolean palantirStyle = false;
200+
private boolean aospStyle = false;
201+
private boolean ojfStyle = false;
202202
private boolean version = false;
203203
private boolean help = false;
204204
private boolean stdin = false;
@@ -240,13 +240,13 @@ Builder addLength(Integer length) {
240240
return this;
241241
}
242242

243-
Builder aosp(boolean aosp) {
244-
this.aosp = aosp;
243+
Builder aospStyle(boolean aosp) {
244+
this.aospStyle = aosp;
245245
return this;
246246
}
247247

248-
Builder palantirStyle(boolean palantirStyle) {
249-
this.palantirStyle = palantirStyle;
248+
Builder ojfStyle(boolean ojfStyle) {
249+
this.ojfStyle = ojfStyle;
250250
return this;
251251
}
252252

@@ -306,16 +306,16 @@ Builder outputReplacements(boolean outputReplacements) {
306306
}
307307

308308
CommandLineOptions build() {
309-
Preconditions.checkArgument(!aosp || !palantirStyle, "Cannot use both aosp and palantir style");
309+
Preconditions.checkArgument(!aospStyle || !ojfStyle, "Cannot use both aosp and palantir style");
310310
return new CommandLineOptions(
311311
files.build(),
312312
inPlace,
313313
lines.build(),
314314
characterRanges.build(),
315315
offsets.build(),
316316
lengths.build(),
317-
aosp,
318-
palantirStyle,
317+
aospStyle,
318+
ojfStyle,
319319
version,
320320
help,
321321
stdin,

0 commit comments

Comments
 (0)