-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Black crashes #1155
Comments
Thanks for the report! This is probably a result of #826. Could you give more details on the NameError you see when running the tests though? |
Here's full log:
I opened try:
import blackd
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
from aiohttp import web
except ImportError:
has_blackd_deps = False
else:
has_blackd_deps = True |
I am working on this, I also had this issue. |
Fixed in my PR |
This has been fixed in the latest release, version R:\Programming>type black\temp.py
foo = (1, 2, 3,)
bar = (
(
1,
2,
3,
)
)
R:\Programming>black black/temp.py --diff --color
--- black\temp.py 2020-09-04 21:27:53.309225 +0000
+++ black\temp.py 2020-09-04 21:30:38.473714 +0000
@@ -1,8 +1,10 @@
-foo = (1, 2, 3,)
+foo = (
+ 1,
+ 2,
+ 3,
+)
bar = (
- (
- 1,
- 2,
- 3,
- )
+ 1,
+ 2,
+ 3,
)
would reformat black\temp.py
All done! ✨ 🍰 ✨
1 file would be reformatted. My environment
The reason why the collection literals are still exploded is the "magic trailing comma" feature. This feature was introduced in Thank you @hallazzang for reporting this bug! |
Describe the bug
Black crashes with an error message.
To Reproduce
Expected behavior
Black should reformat the code like this:
Environment (please complete the following information):
Does this bug also happen on master?
Yes. It happens when I clone this repository(master branch) and install it manually(
python setup.py test
fails with aNameError
though).But in online version, it doesn't crash but this time it produces weird result.
Given the same source input, output looks like this:
Then if I use this output as input again, this output pops out:
Additional context Add any other context about the problem here.
Log message(from
/tmp/blk_7zvxucd6.log
):The text was updated successfully, but these errors were encountered: