From 40bcab26dfdbf59f41b6e7ba9dd747e711b4d2c6 Mon Sep 17 00:00:00 2001 From: Maximilian Cosmo Sitter <48606431+mcsitter@users.noreply.github.com> Date: Wed, 9 Nov 2022 10:58:40 +0100 Subject: [PATCH 1/2] Clarify that black runs with --safe by default fixes #3375 --- docs/the_black_code_style/current_style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/the_black_code_style/current_style.md b/docs/the_black_code_style/current_style.md index 59d79c4cd0e..078e6dbbdec 100644 --- a/docs/the_black_code_style/current_style.md +++ b/docs/the_black_code_style/current_style.md @@ -457,7 +457,7 @@ the latter are treated as true raw strings with no special semantics. ### AST before and after formatting -When run with `--safe`, _Black_ checks that the code before and after is semantically +When run with `--safe` (the default), _Black_ checks that the code before and after is semantically equivalent. This check is done by comparing the AST of the source with the AST of the target. There are three limited cases in which the AST does differ: From d500d7b13e3d256063547ef17cd6e69fedf91547 Mon Sep 17 00:00:00 2001 From: Maximilian Cosmo Sitter <48606431+mcsitter@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:01:41 +0000 Subject: [PATCH 2/2] Fix line breaks --- docs/the_black_code_style/current_style.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/the_black_code_style/current_style.md b/docs/the_black_code_style/current_style.md index 078e6dbbdec..0f166fe2bd4 100644 --- a/docs/the_black_code_style/current_style.md +++ b/docs/the_black_code_style/current_style.md @@ -457,9 +457,9 @@ the latter are treated as true raw strings with no special semantics. ### AST before and after formatting -When run with `--safe` (the default), _Black_ checks that the code before and after is semantically -equivalent. This check is done by comparing the AST of the source with the AST of the -target. There are three limited cases in which the AST does differ: +When run with `--safe` (the default), _Black_ checks that the code before and after is +semantically equivalent. This check is done by comparing the AST of the source with the +AST of the target. There are three limited cases in which the AST does differ: 1. _Black_ cleans up leading and trailing whitespace of docstrings, re-indenting them if needed. It's been one of the most popular user-reported features for the formatter to