Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Black produced different code on the second pass of the formatter: Explicit line join in the first line #922

Closed
dizzy57 opened this issue Jul 9, 2019 · 2 comments · Fixed by #948
Labels
C: unstable formatting Formatting changed on the second pass T: bug Something isn't working

Comments

@dizzy57
Copy link

dizzy57 commented Jul 9, 2019

Operating system: macOS Mojave 10.14.5 (18F132)
Python version: Python 3.7.3
Black version: 19.3b0 (f3bb22a)
Does also happen on master: yes

Minified reproducer:

\


pass

Black diff:

--- source
+++ first pass
@@ -1,5 +1,3 @@
-\
-

 pass

--- first pass
+++ second pass
@@ -1,3 +1,2 @@
-
 pass

Looks like some kind of boundary condition in EmptyLineTracker?

@zsol zsol added T: bug Something isn't working C: unstable formatting Formatting changed on the second pass labels Jul 9, 2019
@Jma353
Copy link
Contributor

Jma353 commented Jul 28, 2019

I have a proposed fix for this in #948 - open to review (cc: @zsol).

@AdamWill
Copy link
Contributor

AdamWill commented Jun 2, 2020

So, Python 3.9 actually considers the reproducer here to be invalid syntax, and that has broken the Black tests on Python 3.9. See #1441 (comment) .

# for free to join this conversation on GitHub. Already have an account? # 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.

4 participants