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-12948] Spaces removed after argument labels in property wrapper constructors #323

Closed
swift-ci opened this issue Jun 7, 2020 · 1 comment
Labels
bug Something isn't working swift-format

Comments

@swift-ci
Copy link

swift-ci commented Jun 7, 2020

Previous ID SR-12948
Radar None
Original Reporter mplewis (JIRA User)
Type Bug
Status Resolved
Resolution Invalid
Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee None
Priority Medium

md5: 79158f393666f0e36ef55daa255abd3d

Issue Description:

swift-format indicates that the following code should have the space between the argument label and the value removed in the property wrapper constructor:

$ swift format lint
@propertyWrapper
struct Wrapper<Value> {
  var wrappedValue: Value

  enum Configuration {
    case first
    case second
  }

  let configuration: Configuration
}

struct Struct {
  @Wrapper(configuration: .first)
  var data: String = "data"
}

let test = Struct()
^D
<stdin>:14:26: warning: [Spacing]: remove 1 space

Applying the recommended formatting results in the following, which breaks from all other recommendations about spacing in argument labels:

@propertyWrapper
struct Wrapper<Value> {
  var wrappedValue: Value

  enum Configuration {
    case first
    case second
  }

  let configuration: Configuration
}

struct Struct {
  @Wrapper(configuration:.first)
  var data: String = "data"
}

let test = Struct()
@swift-ci
Copy link
Author

Comment by Mike Lewis (JIRA)

This is my bad; I was using the homebrew-provided version of swift-format, which was out of date. I've submitted a pull request to make sure others also don't run into the same issue I did.

@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

1 participant