You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds CLI usage documentation to the README covering installation via
SDKMAN, the apply and check commands, and available options.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.adoc
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,53 @@ springJavaFormat {
211
211
212
212
213
213
214
+
=== CLI
215
+
The CLI provides formatting and checking support without requiring Maven or Gradle integration.
216
+
217
+
WARNING: The CLI is experimental and not yet considered a stable interface.
218
+
219
+
==== Download
220
+
Native binaries for Linux, Windows, and macOS are published as assets on the corresponding https://github.com/spring-io/spring-javaformat/releases[GitHub release].
221
+
222
+
==== Usage
223
+
[source,shell]
224
+
----
225
+
spring-javaformat --help
226
+
----
227
+
228
+
The CLI provides the following commands:
229
+
230
+
* `apply` formats Java source files in place
231
+
* `validate` checks formatting without modifying files
232
+
* `check` runs Spring style checks
233
+
234
+
==== Examples
235
+
Format sources in the current project:
236
+
237
+
[source,shell]
238
+
----
239
+
spring-javaformat apply .
240
+
----
241
+
242
+
Validate formatting:
243
+
244
+
[source,shell]
245
+
----
246
+
spring-javaformat validate .
247
+
----
248
+
249
+
Run style checks:
250
+
251
+
[source,shell]
252
+
----
253
+
spring-javaformat check .
254
+
----
255
+
256
+
==== Configuration
257
+
The `apply` and `validate` commands honor `.springjavaformatconfig`.
258
+
259
+
260
+
214
261
=== Java 8 Support
215
262
By default, the formatter requires Java 17.
216
263
If you are working on an older project, you can use a variation of the formatter based off Eclipse 2021-03 (the latest Eclipse JDT version built with Java 8).
0 commit comments