Skip to content

Commit fb4480c

Browse files
committed
Number versions after the Java version, not after palantir's
Up to 2.98.0.6 the version was palantir-java-format's with a build number appended. The bug fixes made the output differ from upstream, so following its numbers lost its meaning. From here a version is <java>.<minor>.<build>: the Java version the formatter is built for, then a number that moves with every change to the output, then one that moves with builds that leave the output alone. The README gets a Versions section that says so, and the palantir section stops promising a 2.x line and changes waiting for 3.0.
1 parent c452d3f commit fb4480c

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,14 @@ private static void configureResolvedVersionsWithVersionMapping(Project project)
8585

8686
## Coming from palantir-java-format
8787

88-
- **Same output, except for bug fixes.** 2.98.0.x is the code of palantir-java-format 2.98.0, renamed
89-
and rebuilt in the open. Its output is the same except where it fixes a bug, and
90-
[Migrate](https://openjavaformat.dev/migrate/) lists those fixes. The fourth number counts builds of
91-
an upstream version.
92-
- **Identical Java packages.** `com.palantir.javaformat.*` stays for the whole 2.x line, so your code
93-
and the SPI keep working.
88+
- **Same output, except for bug fixes.** The formatter is the code of palantir-java-format 2.98.0,
89+
renamed and rebuilt in the open. Its output is the same except where it fixes a bug, and
90+
[Migrate](https://openjavaformat.dev/migrate/) lists those fixes. Any later change to the output
91+
comes with a new minor version, see [Versions](#versions).
92+
- **Identical Java packages.** `com.palantir.javaformat.*` stays, so your code and the SPI keep
93+
working.
9494
- **One-line migration.** Change the coordinates below. Nothing else.
9595

96-
Other changes to the formatter's output wait for 3.0.
97-
9896
| | palantir-java-format | open-java-format |
9997
|---|---|---|
10098
| Maven group | `com.palantir.javaformat` | `dev.openjavaformat` |
@@ -109,8 +107,22 @@ Other changes to the formatter's output wait for 3.0.
109107
| CLI style flag | `--palantir`, `-palantir` | none: there is one style |
110108
| Formatter style | `PALANTIR` | `OJF` |
111109
| Native formatter Gradle property | `palantir.native.formatter` | `openjavaformat.native.formatter` |
112-
| Java packages | `com.palantir.javaformat.*` | **unchanged in 2.x** |
113-
| Version numbers | `2.98.0` | `2.98.0.1` |
110+
| Java packages | `com.palantir.javaformat.*` | **unchanged** |
111+
| Version numbers | `2.98.0` | `21.<minor>.<build>`, see [Versions](#versions) |
112+
113+
## Versions
114+
115+
A version is three numbers, `<java>.<minor>.<build>`, and each one answers a question of its own.
116+
117+
- **The first is the Java version the formatter is built for**, 21 today. It moves when the minimum
118+
Java version moves.
119+
- **The second counts changes to the output**: a fix in wrapping or alignment, a new rule, a new
120+
feature. A newer minor version can reformat code that the previous one left alone.
121+
- **The third counts builds that leave the output alone**: regressions, internal bugs, dependency
122+
and build updates. A newer build formats every file exactly as the previous one did.
123+
124+
Up to 2.98.0.6 the version was palantir-java-format's with a build number appended. Once the bug
125+
fixes made the output differ from upstream, that numbering lost its meaning.
114126

115127
## Building and testing locally
116128

0 commit comments

Comments
 (0)