Skip to content

Commit e7e122e

Browse files
authored
docs: Move fmt: off docs (#4090)
1 parent 432d905 commit e7e122e

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

docs/the_black_code_style/current_style.md

+3-12
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@ deliberately limited and rarely added. Previous formatting is taken into account
88
little as possible, with rare exceptions like the magic trailing comma. The coding style
99
used by _Black_ can be viewed as a strict subset of PEP 8.
1010

11-
_Black_ reformats entire files in place. It doesn't reformat lines that contain
12-
`# fmt: skip` or blocks that start with `# fmt: off` and end with `# fmt: on`.
13-
`# fmt: skip` can be mixed with other pragmas/comments either with multiple comments
14-
(e.g. `# fmt: skip # pylint # noqa`) or as a semicolon separated list (e.g.
15-
`# fmt: skip; pylint; noqa`). `# fmt: on/off` must be on the same level of indentation
16-
and in the same block, meaning no unindents beyond the initial indentation level between
17-
them. It also recognizes [YAPF](https://github.com/google/yapf)'s block comments to the
18-
same effect, as a courtesy for straddling code.
19-
20-
The rest of this document describes the current formatting style. If you're interested
21-
in trying out where the style is heading, see [future style](./future_style.md) and try
22-
running `black --preview`.
11+
This document describes the current formatting style. If you're interested in trying out
12+
where the style is heading, see [future style](./future_style.md) and try running
13+
`black --preview`.
2314

2415
### How _Black_ wraps lines
2516

docs/usage_and_configuration/the_basics.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ _Black_ is a well-behaved Unix-style command-line tool:
1212

1313
## Usage
1414

15-
To get started right away with sensible defaults:
15+
_Black_ will reformat entire files in place. To get started right away with sensible
16+
defaults:
1617

1718
```sh
1819
black {source_file_or_directory}
@@ -24,6 +25,17 @@ You can run _Black_ as a package if running it as a script doesn't work:
2425
python -m black {source_file_or_directory}
2526
```
2627

28+
### Ignoring sections
29+
30+
Black will not reformat lines that contain `# fmt: skip` or blocks that start with
31+
`# fmt: off` and end with `# fmt: on`. `# fmt: skip` can be mixed with other
32+
pragmas/comments either with multiple comments (e.g. `# fmt: skip # pylint # noqa`) or
33+
as a semicolon separated list (e.g. `# fmt: skip; pylint; noqa`). `# fmt: on/off` must
34+
be on the same level of indentation and in the same block, meaning no unindents beyond
35+
the initial indentation level between them. Black also recognizes
36+
[YAPF](https://github.com/google/yapf)'s block comments to the same effect, as a
37+
courtesy for straddling code.
38+
2739
### Command line options
2840

2941
The CLI options of _Black_ can be displayed by running `black --help`. All options are
@@ -191,7 +203,7 @@ All done! ✨ 🍰 ✨
191203

192204
Show (or do not show) colored diff. Only applies when `--diff` is given.
193205

194-
### `--line-ranges`
206+
#### `--line-ranges`
195207

196208
When specified, _Black_ will try its best to only format these lines.
197209

0 commit comments

Comments
 (0)