A basic StmtAssign formatter and better dummies for expressions (#4938)

* A basic StmtAssign formatter and better dummies for expressions

The goal of this PR was formatting StmtAssign since many nodes in the black tests (and in python in general) are after an assignment. This caused unstable formatting: The spacing of power op spacing depends on the type of the two involved expressions, but each expression was formatted as dummy string and re-parsed as a ExprName, so in the second round the different rules of ExprName were applied, causing unstable formatting.

This PR does not necessarily bring us closer to black's style, but it unlocks a good porting of black's test suite and is a basis for implementing the Expr nodes.

* fmt

* Review
This commit is contained in:
konstin 2023-06-08 12:20:25 +02:00 committed by GitHub
parent 651d89794c
commit 23abad0bd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 1291 additions and 1023 deletions

View file

@ -0,0 +1,10 @@
# break left hand side
a1akjdshflkjahdslkfjlasfdahjlfds = bakjdshflkjahdslkfjlasfdahjlfds = cakjdshflkjahdslkfjlasfdahjlfds = kjaödkjaföjfahlfdalfhaöfaöfhaöfha = fkjaödkjaföjfahlfdalfhaöfaöfhaöfha = g = 3
# join left hand side
a2 = (
b2
) = 2
# Break the last element
a = asdf = fjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfalflaflapamsakjsdhflakjdslfjhalsdljfal = 1