Commit Graph

8 Commits

Author SHA1 Message Date
Michael J. Sullivan
0ff718e1e2 Blacken .py files in blib2to3 (#1011)
* Blacken .py files in blib2to3

This is in preparation for adding type annotations to blib2to3 in
order to compiling it with mypyc (#1009, which I can rebase on top of
this).

To enforce that it stays blackened, I just cargo-culted the existing
test code used for validating formatting. It feels pretty clunky now,
though, so I can abstract the common logic out into a helper if that
seems better. (But error messages might be less clear then?)

* Tidy up the tests
2019-10-20 15:55:31 +02:00
Zsolt Dollenstein
d8fa8df052
Add support for walrus operator (#935)
* Parse `:=` properly
* never unwrap parenthesis around `:=`
* When checking for AST-equivalence, use `ast` instead of `typed-ast` when running on python >=3.8
* Assume code that uses `:=` is at least 3.8
2019-07-28 16:03:23 +01:00
Benjamin Woodruff
448885b256
Move tokenizer config onto grammar, rename flag
Based on the feedback in
https://github.com/python/black/pull/845#issuecomment-490622711

- Remove TokenizerConfig, and add a field to Grammar instead.
- Pass the Grammar to the tokenizer.
- Rename `ASYNC_IS_RESERVED_KEYWORD` to `ASYNC_KEYWORDS` and
  `ASYNC_IS_VALID_IDENTIFIER` to `ASYNC_IDENTIFIERS`.
2019-05-09 17:59:29 +02:00
Łukasz Langa
ee7151e50f
Mention atomic cache creation in the change log 2019-03-14 17:17:50 +01:00
Anthony Sottile
4d3107233f Atomically write cache files (#674) 2019-01-18 20:59:17 -08:00
Łukasz Langa
63da5d088c 3.6.5 grammar pickles 2018-04-04 09:55:56 -07:00
Łukasz Langa
2d80366ac1 [blib2to3] Make the grammar pickles faster 2018-04-02 18:28:24 -07:00
Łukasz Langa
e74117f172 Initial commit 2018-03-14 12:55:32 -07:00