Skip to content

Commit

Permalink
Document shebang comment behaviour (#3787)
Browse files Browse the repository at this point in the history
  • Loading branch information
kotnen committed Jul 11, 2023
1 parent 37895f8 commit 6123b4a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docs/the_black_code_style/current_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@ required due to an inner function starting immediately after.

_Black_ does not format comment contents, but it enforces two spaces between code and a
comment on the same line, and a space before the comment text begins. Some types of
comments that require specific spacing rules are respected: doc comments (`#: comment`),
section comments with long runs of hashes, and Spyder cells. Non-breaking spaces after
hashes are also preserved. Comments may sometimes be moved because of formatting
changes, which can break tools that assign special meaning to them. See
[AST before and after formatting](#ast-before-and-after-formatting) for more discussion.
comments that require specific spacing rules are respected: shebangs (`#! comment`), doc
comments (`#: comment`), section comments with long runs of hashes, and Spyder cells.
Non-breaking spaces after hashes are also preserved. Comments may sometimes be moved
because of formatting changes, which can break tools that assign special meaning to
them. See [AST before and after formatting](#ast-before-and-after-formatting) for more
discussion.

### Trailing commas

Expand Down

0 comments on commit 6123b4a

Please sign in to comment.