Format StmtFor (#5163)

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

format StmtFor

still trying to learn how to help out with the formatter. trying
something slightly more advanced than [break](#5158)

mostly copied form StmtWhile

## Test Plan

snapshots
This commit is contained in:
David Szotten 2023-06-21 22:00:31 +01:00 committed by GitHub
parent e71f044f0d
commit 1eccbbb60e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 392 additions and 134 deletions

View file

@ -0,0 +1,34 @@
for x in y: # trailing test comment
pass # trailing last statement comment
# trailing for body comment
# leading else comment
else: # trailing else comment
pass
# trailing else body comment
for aVeryLongNameThatSpillsOverToTheNextLineBecauseItIsExtremelyLongAndGoesOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOn in anotherVeryLongNameThatSpillsOverToTheNextLineBecauseItIsExtremelyLongAndGoesOnAndOnAndOnAndOnAndOnAndOnAndOnAndOnAndOn: # trailing comment
pass
else:
...
for (
x,
y,
) in z: # comment
...
# remove brackets around x,y but keep them around z,w
for (x, y) in (z, w):
...
# type comment
for x in (): # type: int
...