@@ -35,6 +35,10 @@ are deliberately limited and rarely added.
3535Note that all command-line options listed above can also be configured using a
3636` pyproject.toml ` file (more on that below).
3737
38+ #### ` -h ` , ` --help `
39+
40+ Show available command-line options and exit.
41+
3842#### ` -c ` , ` --code `
3943
4044Format the code passed in as a string.
@@ -109,6 +113,10 @@ useful when piping source on standard input.
109113When processing Jupyter Notebooks, add the given magic to the list of known python-
110114magics. Useful for formatting cells with custom python magics.
111115
116+ #### ` -x, --skip-source-first-line `
117+
118+ Skip the first line of the source code.
119+
112120#### ` -S, --skip-string-normalization `
113121
114122By default, _ Black_ uses double quotes for all strings and normalizes string prefixes,
@@ -132,7 +140,7 @@ functionality in the next major release. Read more about
132140
133141#### ` --check `
134142
135- Passing ` --check ` will make _ Black_ exit with:
143+ Don't write the files back, just return the status. _ Black_ will exit with:
136144
137145- code 0 if nothing would change;
138146- code 1 if some files would be reformatted; or
@@ -162,8 +170,8 @@ $ echo $?
162170
163171#### ` --diff `
164172
165- Passing ` --diff ` will make _ Black _ print out diffs that indicate what changes _ Black_
166- would've made. They are printed to stdout so capturing them is simple.
173+ Don't write the files back, just output a diff to indicate what changes _ Black_ would've
174+ made. They are printed to stdout so capturing them is simple.
167175
168176If you'd like colored diffs, you can enable them with ` --color ` .
169177
@@ -179,6 +187,10 @@ All done! ✨ 🍰 ✨
1791871 file would be reformatted.
180188```
181189
190+ #### ` --color ` / ` --no-color `
191+
192+ Show (or do not show) colored diff. Only applies when ` --diff ` is given.
193+
182194### ` --line-ranges `
183195
184196When specified, _ Black_ will try its best to only format these lines.
@@ -202,10 +214,6 @@ extra lines outside of the ranges when ther are unformatted lines with the exact
202214content. It also disables _Black_'s formatting stability check in `--safe` mode.
203215```
204216
205- #### ` --color ` / ` --no-color `
206-
207- Show (or do not show) colored diff. Only applies when ` --diff ` is given.
208-
209217#### ` --fast ` / ` --safe `
210218
211219By default, _ Black_ performs [ an AST safety check] ( labels/ast-changes ) after formatting
@@ -256,7 +264,7 @@ instead of overriding them.
256264#### ` --force-exclude `
257265
258266Like ` --exclude ` , but files and directories matching this regex will be excluded even
259- when they are passed explicitly as arguments. This is useful when invoking _ Black _
267+ when they are passed explicitly as arguments. This is useful when invoking Black
260268programmatically on changed files, such as in a pre-commit hook or editor plugin.
261269
262270#### ` --stdin-filename `
@@ -275,12 +283,12 @@ exclusions, including from `.gitignore` and command line options.
275283
276284When _ Black_ formats multiple files, it may use a process pool to speed up formatting.
277285This option controls the number of parallel workers. This can also be specified via the
278- ` BLACK_NUM_WORKERS ` environment variable.
286+ ` BLACK_NUM_WORKERS ` environment variable. Defaults to the number of CPUs in the system.
279287
280288#### ` -q ` , ` --quiet `
281289
282- Passing ` -q ` / ` --quiet ` will cause _ Black _ to stop emitting all non-critical output.
283- Error messages will still be emitted (which can silenced by ` 2>/dev/null ` ).
290+ Stop emitting all non-critical output. Error messages will still be emitted (which can
291+ silenced by ` 2>/dev/null ` ).
284292
285293``` console
286294$ black src/ -q
@@ -289,9 +297,9 @@ error: cannot format src/black_primer/cli.py: Cannot parse: 5:6: mport asyncio
289297
290298#### ` -v ` , ` --verbose `
291299
292- Passing ` -v ` / ` --verbose ` will cause _ Black _ to also emit messages about files that
293- were not changed or were ignored due to exclusion patterns. If _ Black _ is using a
294- configuration file, a blue message detailing which one it is using will be emitted.
300+ Emit messages about files that were not changed or were ignored due to exclusion
301+ patterns. If _ Black _ is using a configuration file, a message detailing which one it is
302+ using will be emitted.
295303
296304``` console
297305$ black src/ -v
@@ -321,10 +329,6 @@ black, 23.11.0
321329Read configuration options from a configuration file. See
322330[ below] ( #configuration-via-a-file ) for more details on the configuration file.
323331
324- #### ` -h ` , ` --help `
325-
326- Show available command-line options and exit.
327-
328332### Environment variable options
329333
330334_ Black_ supports the following configuration via environment variables.
@@ -355,7 +359,7 @@ All done! ✨ 🍰 ✨
355359use ` --stdin-filename ` . Useful to make sure _ Black_ will respect the ` --force-exclude `
356360option on some editors that rely on using stdin.
357361
358- You can also pass code as a string using the ` -c ` / ` - -code` option.
362+ You can also pass code as a string using the ` --code ` option.
359363
360364### Writeback and reporting
361365
@@ -435,8 +439,7 @@ refers to the path to your home directory. On Windows, this will be something li
435439You can also explicitly specify the path to a particular file that you want with
436440` --config ` . In this situation _ Black_ will not look for any other file.
437441
438- If you're running with ` --verbose ` , you will see a blue message if a file was found and
439- used.
442+ If you're running with ` --verbose ` , you will see a message if a file was found and used.
440443
441444Please note ` blackd ` will not use ` pyproject.toml ` configuration.
442445
0 commit comments