@@ -12,7 +12,7 @@ output = [
1212 ].join('\n')
1313-->
1414
15- [ ![ SpotlessCLI Version] ( https://img.shields.io/badge/latest--version-0.1.0 -blue.svg )] ( CHANGES.md )
15+ [ ![ SpotlessCLI Version] ( https://img.shields.io/badge/latest--version-0.1.1 -blue.svg )] ( CHANGES.md )
1616
1717[ ![ OS Win] ( https://img.shields.io/badge/OS-Windows-blueviolet.svg )] ( #installation-on-windows )
1818[ ![ OS Linux] ( https://img.shields.io/badge/OS-Linux-blueviolet.svg )] ( #installation-on-macos-and-linux )
@@ -106,74 +106,7 @@ output =
106106-->
107107
108108```
109- __ __
110- _________ ____ / /_/ /__ __________
111- / ___/ __ \/ __ \/ __/ / _ \/ ___/ ___/
112- (__ ) /_/ / /_/ / /_/ / __(__ |__ )
113- /____/ .___/\____/\__/_/\___/____/____/ Spotless CLI
114- /_/
115-
116-
117- Usage: spotless [-hV] [-e=<encoding>] [-l=<lineEnding>] [--log-file=<logFile>]
118- [-m=<spotlessMode>] [-p=N] [-t=<targets>]... [-q | -v [-v]...]
119- [FORMATTING_STEPS]
120-
121- spotless is a command line interface (CLI) for the spotless code formatter.
122- It can either check if your files are formatted according to your configuration
123- or apply the formatting to the files.
124-
125- -e, --encoding=<encoding> The encoding of the files to format.
126- (default: UTF-8)
127- -h, --help Show this help message and exit.
128- -l, --line-ending=<lineEnding>
129- The line ending of the files to format.
130- One of: GIT_ATTRIBUTES,
131- GIT_ATTRIBUTES_FAST_ALLSAME, PLATFORM_NATIVE,
132- WINDOWS, UNIX, MAC_CLASSIC, PRESERVE
133- (default: UNIX)
134- --log-file=<logFile> The log file to write the output to.
135- -m, --mode=<spotlessMode> The mode to run spotless in.
136- One of: CHECK, APPLY
137- (default: APPLY)
138- APPLY: Apply the correct formatting where needed
139- (replace file contents with formatted content).
140- CHECK: Check if the files are formatted or show
141- the diff of the formatting.
142- -p, --parallelity=N The number of parallel formatter threads to run.
143- (default: #cores * 0.5)
144- -q, --quiet Disable as much output as possible.
145- -t, --target=<targets> The target files to format. Blobs are supported.
146- Examples:
147- -t 'src/**/*.java'
148- -t 'src/**/*.kt'
149- -t 'README.md'
150- -v Enable verbose output. Multiple -v options
151- increase the verbosity (max 5).
152- -V, --version Print version information and exit.
153-
154- Available formatting steps:
155- clang-format Runs clang-format
156- format-annotations Corrects line break formatting of type annotations in
157- java files.
158- google-java-format Runs google java format
159- license-header Runs license header
160- palantir-java-format Runs palantir java format
161- prettier Runs prettier, the opinionated code formatter.
162-
163- Possible exit codes:
164- 0 Successful formatting.
165- In APPLY mode, this means all files were formatted successfully.
166- In CHECK mode, this means all files were already formatted properly.
167- 1 Some files need to be formatted.
168- In APPLY mode, this means some files failed to be formatted (see output
169- for details).
170- In CHECK mode, this means some files are currently not formatted
171- properly (and might be fixed in APPLY mode).
172- -1 Some files did not converge. This can happen when one formatter does not
173- converge on the file content.
174- You can find more about this special case here:
175- <https://github.com/diffplug/spotless/blob/main/PADDEDCELL.md>
176- -2 An exception occurred during execution.
109+
177110```
178111
179112<!-- -freshmark /usage_main -->
@@ -203,30 +136,7 @@ output =
203136-->
204137
205138```
206- Usage: spotless clang-format [-hV] [-c=<pathToExec>] [-s=<style>] [-v=<version>]
207- Runs clang-format
208- -c, --clang-format-exec=<pathToExec>
209- The path to the clang-format executable.
210- (default: looks on your PATH)
211- -h, --help Show this help message and exit.
212- -s, --style=<style> The style to use for clang-format.
213- -v, --clang-version=<version>
214- The version of clang-format to use.
215- (default: 10.0.1)
216- -V, --version Print version information and exit.
217-
218- ✅ This step supports the following file types:
219- * C
220- * C++
221- * Java
222- * JavaScript
223- * JSON
224- * Objective-C
225- * Protobuf
226- * C#
227-
228- 🌎 Additional info:
229- https://clang.llvm.org/docs/ClangFormat.html
139+
230140```
231141
232142<!-- -freshmark /usage_clang_format -->
@@ -254,23 +164,7 @@ output =
254164-->
255165
256166```
257- Usage: spotless format-annotations [-hV] [-a[=annotation[,
258- annotation...]...]]... [-r[=annotation[,
259- annotation...]...]]...
260- Corrects line break formatting of type annotations in java files.
261- -a, --add-type-annotation[=annotation[,annotation...]...]
262- Add annotations to the list of type annotations to keep on
263- the same line as the type.
264- -h, --help Show this help message and exit.
265- -r, --remove-type-annotation[=annotation[,annotation...]...]
266- Remove annotations from the list of type annotations to keep
267- on the same line as the type.
268- -V, --version Print version information and exit.
269-
270- ✅ This step supports the following file type: Java
271-
272- 🌎 Additional info:
273- https://github.com/diffplug/spotless/tree/main/plugin-gradle#formatAnnotations
167+
274168```
275169
276170<!-- -freshmark /usage_format_annotations -->
@@ -317,25 +211,7 @@ output =
317211-->
318212
319213```
320- Usage: spotless google-java-format [-hijrV] [-s=<style>]
321- Runs google java format
322- -h, --help Show this help message and exit.
323- -i, --reorder-imports Reorder imports.
324- (default: false)
325- -j, --format-javadoc Format javadoc.
326- (default: true)
327- -r, --reflow-long-strings
328- Reflow long strings.
329- (default: false)
330- -s, --style=<style> The style to use for the google java format.
331- One of: AOSP, GOOGLE
332- (default: GOOGLE)
333- -V, --version Print version information and exit.
334-
335- ✅ This step supports the following file type: Java
336-
337- 🌎 Additional info:
338- https://github.com/google/google-java-format
214+
339215```
340216
341217<!-- -freshmark /usage_google_java_format -->
@@ -360,45 +236,7 @@ output =
360236-->
361237
362238```
363- Usage: spotless license-header [-hV] [-c=<contentPattern>] [-d=<delimiter>]
364- [-m=<yearMode>] [-s=<skipLinesMatching>]
365- [-Y=<yearSeparator>] (-H=<header> |
366- -f=<headerFile>)
367- Runs license header
368- -c, --content-pattern=<contentPattern>
369- The pattern to match the content of the file before
370- inserting the licence header. (If the file content
371- does not match the pattern, the header will not be
372- inserted/updated.)
373- -d, --delimiter=<delimiter>
374- The delimiter to use for the license header. If not
375- provided, the delimiter will be guessed based on
376- the first few files we find. Otherwise, 'java' will
377- be assumed.
378- -f, --header-file=<headerFile>
379- The license header content in a file to apply.
380- May contain $YEAR as placeholder.
381- -h, --help Show this help message and exit.
382- -H, --header=<header> The license header content to apply. May contain
383- $YEAR as placeholder.
384- -m, --year-mode=<yearMode>
385- How and if the year in the copyright header should be
386- updated.
387- One of: PRESERVE, UPDATE_TO_TODAY, SET_FROM_GIT
388- (default: PRESERVE)
389- -s, --skip-lines-matching=<skipLinesMatching>
390- Skip lines matching the given regex pattern before
391- inserting the licence header.
392- -V, --version Print version information and exit.
393- -Y, --year-separator=<yearSeparator>
394- The separator to use for the year range in the
395- license header.
396- (default: -)
397-
398- ✅ This step supports the following file type: any
399-
400- 🌎 Additional info:
401- https://github.com/diffplug/spotless/tree/main/plugin-gradle#license-header
239+
402240```
403241
404242<!-- -freshmark /usage_license_header -->
@@ -434,20 +272,7 @@ output =
434272-->
435273
436274```
437- Usage: spotless palantir-java-format [-hjV] [-s=<style>]
438- Runs palantir java format
439- -h, --help Show this help message and exit.
440- -j, --format-javadoc Format javadoc.
441- (default: false)
442- -s, --style=<style> The style to use for the palantir java format.
443- One of: PALANTIR, AOSP, GOOGLE
444- (default: PALANTIR)
445- -V, --version Print version information and exit.
446-
447- ✅ This step supports the following file type: Java
448-
449- 🌎 Additional info:
450- https://github.com/palantir/palantir-java-format
275+
451276```
452277
453278<!-- -freshmark /usage_palantir_java_format -->
@@ -488,59 +313,7 @@ output =
488313-->
489314
490315```
491- Usage: spotless prettier [-hV] [-C=<npmInstallCacheDir>]
492- [-n=<explicitNpmExecutable>]
493- [-N=<explicitNodeExecutable>]
494- [-P=<prettierConfigPath>] [-R=<explicitNpmrcFile>]
495- [-A=<additionalNpmrcLocations>]...
496- [-c='OPTION=VALUE']... [-D='PACKAGE=VERSION']...
497- Runs prettier, the opinionated code formatter.
498- -A, --additional-npmrc-location=<additionalNpmrcLocations>
499- Additional locations to search for .npmrc files.
500- -c, --prettier-config-option='OPTION=VALUE'
501- A prettier configuration options.
502- The format is 'OPTION=VALUE'.
503- example: 'printWidth=80'
504- -C, --npm-install-cache-dir=<npmInstallCacheDir>
505- The directory to use for caching libraries retrieved by 'npm
506- install'.
507- -D, --dev-dependency='PACKAGE=VERSION'
508- An entry to add to the package.json for running prettier.
509- The format is 'PACKAGE=VERSION'.
510- example: 'prettier=2.8.7'
511- -h, --help Show this help message and exit.
512- -n, --npm-exec=<explicitNpmExecutable>
513- The explicit path to the npm executable.
514- -N, --node-exec=<explicitNodeExecutable>
515- The explicit path to the node executable.
516- -P, --prettier-config-path=<prettierConfigPath>
517- The path to the prettier configuration file.
518- -R, --npmrc-file=<explicitNpmrcFile>
519- The explicit path to the .npmrc file.
520- -V, --version Print version information and exit.
521-
522- ✅ This step supports the following file types:
523- * JavaScript
524- * JSX
525- * Angular
526- * Vue
527- * Flow
528- * TypeScript
529- * CSS
530- * Less
531- * SCSS
532- * HTML
533- * Ember/Handlebars
534- * JSON
535- * GraphQL
536- * Markdown
537- * YAML
538- * Java (only with plugins)
539- * and more (using plugins)
540-
541- 🌎 Additional info:
542- * https://prettier.io/
543- * 🧩 Find plugins at https://prettier.io/docs/plugins.html#official-plugins
316+
544317```
545318
546319<!-- -freshmark /usage_prettier -->
0 commit comments