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

[SR-12110] swift-format needs two iterations to format case statement #336

Closed
ahoppen opened this issue Jan 29, 2020 · 1 comment
Closed
Labels
bug Something isn't working swift-format

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jan 29, 2020

Previous ID SR-12110
Radar None
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee dylansturg (JIRA)
Priority Medium

md5: bee69ca008e81899123860c15bee660f

Issue Description:

The following code needs two runs of swift-format to converge at a stable state

switch stmt.item {
case let guardStmt as GuardStmtSyntax
where true && guardStmt.body
  .statements.first!.item is ContinueStmtSyntax:
  break
} 

The first run of swift-format outputs

switch stmt.item {
case let guardStmt as GuardStmtSyntax
where true
  && guardStmt.body
    .statements.first!.item is ContinueStmtSyntax
  :
  break
} 

A second run adjusts the indentation of : to

switch stmt.item {
case let guardStmt as GuardStmtSyntax
where true
  && guardStmt.body
    .statements.first!.item is ContinueStmtSyntax
:
  break
} 
@allevato
Copy link
Collaborator

allevato commented Feb 6, 2020

This was fixed by #141.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swift-format
Projects
None yet
Development

No branches or pull requests

2 participants