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-12782] Trailing comma on single-element array causes non-zero exit #328

Closed
tcldr opened this issue May 11, 2020 · 1 comment
Closed
Labels
bug Something isn't working swift-format

Comments

@tcldr
Copy link

tcldr commented May 11, 2020

Previous ID SR-12782
Radar None
Original Reporter @tcldr
Type Bug
Status Resolved
Resolution Done
Environment

swift-format swift-5.2-branch
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0

Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee dylansturg (JIRA)
Priority Medium

md5: cd15c52cf061747e90bea8cc3162cbdf

Issue Description:

A trailing comma on a single-element Array will cause the lint phase to fail with a non-zero exit code:

ExampleBug.swift:

var strings: [String] { ["just me",] }
$ swift-format -m lint ExampleBug.swift
/Users/tcldr/Desktop/ExampleBug.swift:1:36: warning: [Spacing]: add 1 space
/Users/tcldr/Desktop/ExampleBug.swift:1:37: warning: [AddLines]: add 1 line breaks
[1]    27222 illegal hardware instruction  swift-format -m lint ExampleBug.swift
@swift-ci
Copy link

swift-ci commented Sep 2, 2020

Comment by Dylan Sturgeon (JIRA)

Fixed by #228.

@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