xref: /aosp_15_r20/external/cldr/tools/README.md (revision 912701f9769bb47905792267661f0baf2b85bed5)
1*912701f9SAndroid Build Coastguard Worker# CLDR Tools
2*912701f9SAndroid Build Coastguard Worker
3*912701f9SAndroid Build Coastguard WorkerThis is a stub page, for further details see the top [README](../README.md#contributing) or <https://cldr.unicode.org>.
4*912701f9SAndroid Build Coastguard Worker
5*912701f9SAndroid Build Coastguard Worker## Spotless
6*912701f9SAndroid Build Coastguard Worker
7*912701f9SAndroid Build Coastguard WorkerLike other projects, CLDR uses a source formatter to ensure a consistent code style automatically, and it uses a single common formatter to avoid spurious diff noise in code reviews.  This is now enforced via a [formatter](https://github.com/google/google-java-format) that is [configured in the Maven build](../.github/workflows/maven.yml) via a [Maven plugin](https://github.com/diffplug/spotless/tree/main/plugin-maven) and checked by continuous integration on pull requests.
8*912701f9SAndroid Build Coastguard Worker
9*912701f9SAndroid Build Coastguard WorkerWhen creating pull requests, you can check the formatting locally using the command `mvn --file=tools/pom.xml spotless:check`.  You can apply the formatter's changes using the command `mvn --file=tools/pom.xml spotless:apply`.  Continuous integration errors for formatting can be fixed by committing the changes resulting from applying the formatter locally and pushing the new commit.
10*912701f9SAndroid Build Coastguard Worker
11*912701f9SAndroid Build Coastguard WorkerSome IDEs can integrate the formatter via plugins, which can minimize the need to manually run the formatter separately.  The following links for specific IDEs may work:
12*912701f9SAndroid Build Coastguard Worker
13*912701f9SAndroid Build Coastguard Worker* Eclipse: Follow the [instructions](https://source.android.com/devices/tech/test_infra/tradefed/development/eclipse#auto_format) in the "Auto format" section. You can alternatively use this link for [`android-formatting.xml`](https://raw.githubusercontent.com/aosp-mirror/platform_development/master/ide/eclipse/android-formatting.xml).
14*912701f9SAndroid Build Coastguard Worker* VSCode: Follow the [instructions](https://code.visualstudio.com/docs/java/java-linting#_formatter) in "Applying formatter settings", but use the same `android-formatting.xml` link mentioned for Eclipse (ex: `"java.format.settings.url": "https://raw.githubusercontent.com/aosp-mirror/platform_development/master/ide/eclipse/android-formatting.xml",`).  Also use the profile name corresponding to that XML file: (ex: `"java.format.settings.profile": "Android",`).
15*912701f9SAndroid Build Coastguard Worker* IntelliJ: Use the [official plugin](https://plugins.jetbrains.com/plugin/8527-google-java-format/) for the formatter.
16*912701f9SAndroid Build Coastguard Worker
17*912701f9SAndroid Build Coastguard Worker(This documentation is from the Unicode project [https://github.com/unicode-org/unicodetools](unicodetools))
18