@@ -115,20 +115,24 @@ Usage: spotless [-hV] [-e=<encoding>] [-l=<lineEnding>] [--log-file=<logFile>]
115115 [FORMATTING_STEPS]
116116Runs spotless
117117 -e, --encoding=<encoding> The encoding of the files to format.
118- (default: UTF-8)
118+ (default: UTF-8)
119119 -h, --help Show this help message and exit.
120120 -l, --line-ending=<lineEnding>
121121 The line ending of the files to format.
122- One of: GIT_ATTRIBUTES,
122+ One of: GIT_ATTRIBUTES,
123123 GIT_ATTRIBUTES_FAST_ALLSAME, PLATFORM_NATIVE,
124124 WINDOWS, UNIX, MAC_CLASSIC, PRESERVE
125- (default: UNIX)
125+ (default: UNIX)
126126 --log-file=<logFile> The log file to write the output to.
127127 -m, --mode=<spotlessMode> The mode to run spotless in.
128- One of: CHECK, APPLY
129- (default: APPLY)
128+ One of: CHECK, APPLY
129+ (default: APPLY)
130+ APPLY: Apply the correct formatting where needed
131+ (replace file contents with formatted content).
132+ CHECK: Check if the files are formatted or show
133+ the diff of the formatting.
130134 -p, --parallelity=N The number of parallel formatter threads to run.
131- (default: #cores * 0.5)
135+ (default: #cores * 0.5)
132136 -q, --quiet Disable as much output as possible.
133137 -t, --target=<targets> The target files to format.
134138 -v Enable verbose output. Multiple -v options
@@ -139,6 +143,19 @@ Available formatting steps:
139143 license-header Runs license header
140144 google-java-format Runs google java format
141145 prettier Runs prettier, the opinionated code formatter.
146+
147+ Possible exit codes:
148+ 0 Successful formatting.
149+ In APPLY mode, this means all files were formatted.
150+ In CHECK mode, this means all files are already formatted properly.
151+ 1 Some files need formatting.
152+ In APPLY mode, this means some files failed to be formatted (see output
153+ for details).
154+ In CHECK mode, this means some files are not formatted properly (and
155+ might be fixed in APPLY mode).
156+ -1 Some files did not converge. This can happen in APPLY mode when the
157+ formatter does not converge on the file content.
158+ -2 An exception occurred during execution.
142159```
143160
144161<!-- -freshmark /usage_main -->
@@ -179,15 +196,15 @@ Usage: spotless google-java-format [-hijrV] [-s=<style>]
179196Runs google java format
180197 -h, --help Show this help message and exit.
181198 -i, --reorder-imports Reorder imports.
182- (default: false)
199+ (default: false)
183200 -j, --format-javadoc Format javadoc.
184- (default: true)
201+ (default: true)
185202 -r, --reflow-long-strings
186203 Reflow long strings.
187- (default: false)
204+ (default: false)
188205 -s, --style=<style> The style to use for the google java format.
189- One of: AOSP, GOOGLE
190- (default: GOOGLE)
206+ One of: AOSP, GOOGLE
207+ (default: GOOGLE)
191208 -V, --version Print version information and exit.
192209```
193210
@@ -237,16 +254,16 @@ Runs license header
237254 -m, --year-mode=<yearMode>
238255 How and if the year in the copyright header should be
239256 updated.
240- One of: PRESERVE, UPDATE_TO_TODAY, SET_FROM_GIT
241- (default: PRESERVE)
257+ One of: PRESERVE, UPDATE_TO_TODAY, SET_FROM_GIT
258+ (default: PRESERVE)
242259 -s, --skip-lines-matching=<skipLinesMatching>
243260 Skip lines matching the given regex pattern before
244261 inserting the licence header.
245262 -V, --version Print version information and exit.
246263 -Y, --year-separator=<yearSeparator>
247264 The separator to use for the year range in the
248265 license header.
249- (default: -)
266+ (default: -)
250267```
251268
252269<!-- -freshmark /usage_license_header -->
@@ -295,15 +312,15 @@ Runs prettier, the opinionated code formatter.
295312 Additional locations to search for .npmrc files.
296313 -c, --prettier-config-option='OPTION=VALUE'
297314 A prettier configuration options.
298- The format is 'OPTION=VALUE'.
299- example: 'printWidth=80'
315+ The format is 'OPTION=VALUE'.
316+ example: 'printWidth=80'
300317 -C, --npm-install-cache-dir=<npmInstallCacheDir>
301318 The directory to use for caching libraries retrieved by 'npm
302319 install'.
303320 -D, --dev-dependency='PACKAGE=VERSION'
304321 An entry to add to the package.json for running prettier.
305- The format is 'PACKAGE=VERSION'.
306- example: 'prettier=2.8.7'
322+ The format is 'PACKAGE=VERSION'.
323+ example: 'prettier=2.8.7'
307324 -h, --help Show this help message and exit.
308325 -n, --npm-exec=<explicitNpmExecutable>
309326 The explicit path to the npm executable.
0 commit comments