Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _A modern, lambda-friendly, 120 character Java formatter._
- [IntelliJ plugin](https://plugins.jetbrains.com/plugin/13180-palantir-java-format)
- [Gradle plugin](#palantir-java-format-gradle-plugin)
- [Spotless](#spotless)
- [JHarmonizer](#jharmonizer)

It is based on the excellent [google-java-format](https://github.com/google/google-java-format), and benefits from the work of all the [original authors](https://github.com/google/google-java-format/graphs/contributors). palantir-java-format is available under the same [Apache 2.0 License](./LICENSE).

Expand Down Expand Up @@ -150,6 +151,30 @@ when formatting java code.
- See [integration in Spotless Gradle plugin](https://github.com/diffplug/spotless/tree/main/plugin-gradle#palantir-java-format).
- See [integration in Spotless Maven plugin](https://github.com/diffplug/spotless/tree/main/plugin-maven#palantir-java-format).

## JHarmonizer

> This is a community-maintained third-party tool and is not officially supported by Palantir Technologies.

[JHarmonizer](https://github.com/lemon-ant/JHarmonizer) sorts and formats
Java source files. It reorders class members — fields, constructors,
methods, nested types, and initializer blocks — according to configurable
rules, then formats the result using `palantir-java-format`. Before
reordering, JHarmonizer analyses the relationships between class members
(for example, which fields are read by which initializers) to ensure the
reordered source still compiles and behaves correctly.

JHarmonizer works in two modes:

- **Reorder and format** – automatically reorder and format sources during the build or from the command line.
- **Check** – verify that sources are already correctly ordered and formatted; fail the build (or report all violations) if they are not. Useful for enforcing standards in CI.

It is available as:

- **CLI tool** – a standalone fat JAR for use outside of Maven; sort and format Java source files directly from the command line.
- **Maven plugin** – a build-lifecycle plugin that binds reordering and checking goals to standard Maven phases (`process-sources`, `validate`, etc.).

See the [JHarmonizer repository](https://github.com/lemon-ant/JHarmonizer) for installation instructions and configuration options.

## IntelliJ plugin

A
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-1661.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Add JHarmonizer into the README as a third-party integration
links:
- https://github.com/palantir/palantir-java-format/pull/1661