Commit Graph

712 Commits

Author SHA1 Message Date
Zsolt Dollenstein
bd0ab3cba2
Reraise exception in skip_if_exception decorator 2019-08-05 10:07:43 +01:00
Joe Antonakakis
154b98579d Fix async blackd tests which won't fail currently (#966) 2019-08-05 10:06:12 +01:00
Joe Antonakakis
c7495b9aa0 Fix unstable format involving backslash + whitespace at beginning of file (#948) 2019-08-04 10:03:19 +01:00
Joe Antonakakis
65ea568e33 Remove unnecessary if-statement in maybe_make_parens_invisible_in_atom (#964) 2019-08-03 16:33:23 -07:00
Zsolt Dollenstein
e66451761f appease flake8... 2019-07-28 16:40:04 +01:00
Zsolt Dollenstein
6b5eb7d465 skip tests touching aiohttp when known exception occurs 2019-07-28 16:35:10 +01:00
Zsolt Dollenstein
720dd415f7 add change log entry 2019-07-28 16:22:17 +01:00
Zsolt Dollenstein
2848e2e1d6
Support PEP-570 (positional only arguments) (#946)
Code using positional only arguments is considered >= 3.8
2019-07-28 16:17:33 +01: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
Abdur-Rahmaan Janhangeer
cad4138050 CONTRIBUTING.md - update Python version (#942) 2019-07-25 08:19:30 +01:00
Mariatta
eb5f84eb8c Fix Travis CI badge (#939)
It should point to travis-ci.com instead of .org
2019-07-24 18:09:55 -07:00
Asger Hautop Drewsen
235a0b5bcb Change repo name to psf/black in README (#938) 2019-07-24 17:54:05 +01:00
Zsolt Dollenstein
18654bb52a update Pipfile.lock to work with Py3.[78]
Note: had to pin `docutils==0.15` because of https://github.com/pypa/pipenv/issues/3865
2019-07-24 10:12:05 +01:00
Hugo van Kemenade
ffa676cd7d python/black -> psf/black (#936) 2019-07-23 09:50:50 +01:00
Zsolt Dollenstein
77b6ed1b70 Hello github.com/psf! 2019-07-22 21:41:45 +01:00
Yurii Karabas
90d205d1f5 Use nullcontext in case when lock is None. Shutdown pool after code formatting. (#928) 2019-07-16 18:45:56 +01:00
Min ho Kim
f3bb22a828 Fix typo (#916) 2019-07-01 07:42:30 -07:00
Brandt Bucher
b073c9a4e9 Force parentheses between unary op and binary power. (#909) 2019-06-29 09:35:16 -07:00
Zsolt Dollenstein
7d213c6d43
Fix docstring of schedule_formatting
Fixes #914.
2019-06-28 17:31:54 +01:00
Brandt Bucher
9d9f96a7b4 Fix mypy errors. (#911) 2019-06-25 09:44:12 -07:00
Juan Luis Cano Rodríguez
7c556faf5f Ignore broken E203 (#910)
See https://github.com/python/black/issues/565
2019-06-25 07:27:02 -07:00
Adam Johnson
1fbf7251cc Add W503 to default flake8 ignore list (#894)
W503 and W504 are mutually exclusive, to do with splitting binary operators across lines. Black reformats code according to W504, putting the operator on the start of the newline, therefore W503 needs to be ignored in the suggested Flake8 config to use with Black.
2019-06-16 08:39:03 -07:00
Zsolt Dollenstein
5206560946
add change log entry 2019-06-15 07:36:34 +01:00
Zsolt Dollenstein
8f380911e0
Pin comment to single leaf in invisible parens (#872) 2019-06-15 07:29:09 +01:00
dylanjblack
9394de150e Fix trailing comma for function with one arg (#880) (#891)
Modified maybe_remove_trailing_comma to remove trailing commas for
typedarglists (in addition to arglists), and updated line split logic
to ensure that all lines in a function definition that contain only one
arg have a trailing comma.
2019-06-14 21:49:49 -07:00
Ofek Lev
1bbb01b854 Add Datadog to list of users (#876) 2019-06-06 08:34:58 +01:00
Aviskar KC
d410763d8d Add link to the pyproject.toml for setting up pre-commit hook (#885) 2019-06-06 08:33:09 +01:00
Mike
7ce3894f23 [blib2to3] Fixed a typo and removed an unused import. (#848) 2019-05-26 12:10:14 +02:00
Jelle Zijlstra
1c43252aa3 fix some out-of-date docstrings; other cleanup (#865) 2019-05-26 12:09:11 +02:00
Yngve Høiseth
bc7a4b2391 Document cache location configuration (#866) 2019-05-26 12:08:22 +02:00
Yngve Høiseth
340d87b47c Document the need to enter the virtual environment shell (#868) 2019-05-26 11:58:29 +02:00
Zsolt Dollenstein
519c06a8cc
Don't introduce quotes to f-string sub-expressions on string boundaries (#871) 2019-05-26 11:58:00 +02:00
Zsolt Dollenstein
5b01a8e3b0
bump Pipfile.lock 2019-05-26 11:45:47 +02:00
Michael Flaxman
cbe455ad66 minor performance improvement (~2% speedup in unit tests) (#858) 2019-05-21 20:02:17 -07:00
Stephen Rosen
a4399f3054 Add doc clarifying that there is no blackd client (#859)
Resolves #854

The first sentence of this is pretty uncontroversial. (Though I wasn't
sure exactly where in the text to put it.)
I thought it would also be nice to show the `curl` test with a tiny
statement that actually reformats.
2019-05-20 18:57:09 +01:00
Katie McLaughlin
b85c345dbc Remove happiness of error message (#852) 2019-05-16 13:02:17 +01:00
Jelle Zijlstra
957ba24bb6
remove obviously unnecessary parentheses (#850)
Fixes #548
2019-05-15 21:11:04 -07:00
Łukasz Langa
188c31db7c
Mention support for async generators 2019-05-09 18:19:33 +02:00
Łukasz Langa
189520bff1
Change log wording and ordering 2019-05-09 18:18:10 +02:00
Łukasz Langa
bc36e95966
acks += bgw 2019-05-09 18:04:09 +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
Benjamin Woodruff
f8617f975d
Add support for always tokenizing async/await as keywords
Fixes #593

I looked into this bug with @ambv and @carljm, and we reached the
conclusion was that it's not possible for the tokenizer to determine if
async/await is a keyword inside all possible generators without breaking
the grammar for older versions of Python.

Instead, we introduce a new tokenizer mode for Python 3.7+ that will
cause all async/await instances to get parsed as a reserved keyword,
which should fix async/await inside generators.
2019-05-09 17:59:29 +02:00
Łukasz Langa
8c8adedc2a
acks += revfried 2019-05-09 17:08:31 +02:00
Łukasz Langa
0aa21af9e1
Mention fix for backslashes before standalone comments 2019-05-09 17:07:06 +02:00
Łukasz Langa
2227e6b1cd
Remove spurious prints 2019-05-09 04:49:48 +02:00
Łukasz Langa
6bb90f22ed
Use to handle legacy async/await handling in assert_equivalent 2019-05-08 23:33:39 +02:00
Carol Willing
f5381c7c5f Add PyCon talk link to README (#844) 2019-05-08 14:52:41 -04:00
Jason Fried
866be06646 Make --safe work for Python2.7 syntax, by using typed_ast for safe validation (#840) 2019-05-08 07:45:59 -07:00
Carl Meyer
6fdbdb4ee3
Avoid unstable formatting when comment follows escaped newline. (#839). Fixes #767. 2019-05-08 09:53:20 -04:00
Hugo
f50ba078b3 Minor README updates (#842)
* Header in sentence case, for consistency

* Black in italics
2019-05-08 09:06:19 -04:00