Update discussion of AST safety check in README (#2159)

This commit is contained in:
Jelle Zijlstra 2021-04-27 14:00:17 -07:00 committed by GitHub
parent 76e1602d60
commit 807a65f9d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -2,6 +2,11 @@
### Unreleased ### Unreleased
#### _Black_
- Clarify that _Black_ may change the AST, especially when cleaning up docstrings.
(#2159)
#### _Packaging_ #### _Packaging_
- Install `primer.json` (used by `black-primer` by default) with black. (#2154) - Install `primer.json` (used by `black-primer` by default) with black. (#2154)

View File

@ -238,8 +238,10 @@ change in the future**. That being said, no drastic stylistic changes are planne
mostly responses to bug reports. mostly responses to bug reports.
Also, as a temporary safety measure, _Black_ will check that the reformatted code still Also, as a temporary safety measure, _Black_ will check that the reformatted code still
produces a valid AST that is equivalent to the original. This slows it down. If you're produces a valid AST that is mostly equivalent to the original. This slows it down. If
feeling confident, use `--fast`. you're feeling confident, use `--fast`. In a few contexts, Black does make changes to
the AST: it cleans up whitespace in docstrings, adds or removes parentheses in some
`del` statements, and may move around type comments.
## The _Black_ code style ## The _Black_ code style