Skip to content
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

Unstable formatting on subscripted assignment + string + comment #1598

Closed
JelleZijlstra opened this issue Aug 13, 2020 · 2 comments · Fixed by #1678
Closed

Unstable formatting on subscripted assignment + string + comment #1598

JelleZijlstra opened this issue Aug 13, 2020 · 2 comments · Fixed by #1678
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working

Comments

@JelleZijlstra
Copy link
Collaborator

$ cat test_ranking_store.py 
value.__dict__[
    key
] = "test"  # set some Thrift field to non-None in the struct aa bb cc dd ee
$ black -v test_ranking_store.py 
Using configuration from /Users/jelle/py/black/pyproject.toml.
error: cannot format test_ranking_store.py: INTERNAL ERROR: Black produced different code on the second pass of the formatter.  Please report a bug on https://github.com/psf/black/issues.  This diff might be helpful: /var/folders/wx/zkst6jdx1zg_s32d23gz4_0r0000gn/T/blk_mf5ru27i.log
Oh no! 💥 💔 💥
1 file failed to reformat.
$ cat  /var/folders/wx/zkst6jdx1zg_s32d23gz4_0r0000gn/T/blk_mf5ru27i.log
--- source
+++ first pass
@@ -1,3 +1,5 @@
 value.__dict__[
     key
-] = "test"  # set some Thrift field to non-None in the struct aa bb cc dd ee
+] = (  # set some Thrift field to non-None in the struct aa bb cc dd ee
+    "test"
+)
--- first pass
+++ second pass
@@ -1,5 +1,3 @@
 value.__dict__[
     key
-] = (  # set some Thrift field to non-None in the struct aa bb cc dd ee
-    "test"
-)
+] = "test"  # set some Thrift field to non-None in the struct aa bb cc dd ee
@JelleZijlstra JelleZijlstra added T: bug Something isn't working C: unstable formatting Formatting changed on the second pass labels Aug 13, 2020
@hugovk
Copy link
Contributor

hugovk commented Aug 13, 2020

git bisect points to 544ea9c as the first bad commit, from PR #1132 "Improve String Handling".

@hugovk
Copy link
Contributor

hugovk commented Aug 21, 2020

This is now working with master

$ black --check test_ranking_store.py
All done! ✨ 🍰 ✨
1 file would be left unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants