-
Notifications
You must be signed in to change notification settings - Fork 79
Don't insert space around either side of range operator #48
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
Conversation
Motivation: `1...5` gets reformatted into `1 ... 5`. Modifications: Add swiftformat rule `--ranges no-space`. Result: swiftformat doesn't insert space around either side of the range operator.
yim-lee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| --comments ignore | ||
| --ifdef no-indent | ||
| --patternlet inline | ||
| --ranges no-space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this.
The rest I put in alphabetical order.
```
/Users/ylee/apple/swift-distributed-actors/Samples/SampleMetrics/main.swift:83:23: error: ambiguous reference to member 'collect'
print(prom.collect())
^~~~
Prometheus.PrometheusClient:3:17: note: found this candidate
public func collect(_ succeed: (String) -> ())
^
Prometheus.PrometheusClient:4:17: note: found this candidate
public func collect(into promise: NIO.EventLoopPromise<String>)
^
Prometheus.PrometheusClient:5:17: note: found this candidate
public func collect(_ succeed: (NIO.ByteBuffer) -> ())
^
Prometheus.PrometheusClient:6:17: note: found this candidate
public func collect(into promise: NIO.EventLoopPromise<NIO.ByteBuffer>)
```
Copied from ac32225
|
Same build failure as mentioned in #40 (comment). Copied fix from ac32225 in the same PR. |
|
I like this 👍 and evenmore so if it aligns with the google style guide, which supposedly is basically the stdlib guide. |
|
Let's check with the others if we want to ensure we all use the same style or not etc. |
ktoso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I'm concerned this is nice 👍
let's see if others take issue with formatting ¯_(ツ)_/¯
|
I prefer it with spaces, especially when using variables. Another thing that doesn't work without spaces is |
|
Yep, let's not make this change. |

Motivation:
1...5gets reformatted into1 ... 5.Modifications:
Add swiftformat rule
--ranges no-space.Result:
swiftformat doesn't insert space around either side of the range operator.