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
Mike
7ce3894f23 [blib2to3] Fixed a typo and removed an unused import. (#848) 2019-05-26 12:10:14 +02: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
c891c65b6b Store grammar pickle caches in CACHE_DIR
Fixes #192

Fixes #203
2018-05-19 14:06:27 -07:00
Łukasz Langa
82198030ee Remove nonsensical grammar from blib2to3 2018-04-23 14:24:14 -07:00
Łukasz Langa
6316e293ac Automatic detection of deprecated Python 2 forms of print and exec
Note: if those are handled, you can't use --safe because this check is using
Python 3.6+ builtin AST.

Fixes #49
2018-03-22 23:19:23 -07:00
Łukasz Langa
f5cc3e3556 Actually use the bundled Grammar.txt 2018-03-14 14:20:16 -07:00
Łukasz Langa
e74117f172 Initial commit 2018-03-14 12:55:32 -07:00