Skip to content

Commit 7cbb611

Browse files
committed
Update spacesAroundRangeFormationOperators to false
1 parent 47e015e commit 7cbb611

15 files changed

+44
-44
lines changed

.github/workflows/pull_request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
linux_build_command: 'swift-format lint -s -r --configuration ./.swift-format . && swift test && swift test --disable-default-traits'
3232
windows_swift_versions: '["6.1", "nightly-main"]'
3333
windows_build_command: |
34-
Invoke-Program swift-format lint -s -r --configuration .\.swift-format .
3534
Invoke-Program swift test
3635
Invoke-Program swift test --disable-default-traits
3736
enable_macos_checks: true

.swift-format

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
]
2222
},
2323
"prioritizeKeepingFunctionOutputTogether": false,
24-
"reflowMultilineStringLiterals": "never",
2524
"respectsExistingLineBreaks": true,
2625
"rules": {
2726
"AllPublicDeclarationsHaveDocumentation": false,
@@ -68,7 +67,7 @@
6867
"UseWhereClausesInForLoops": false,
6968
"ValidateDocumentationComments": false
7069
},
71-
"spacesAroundRangeFormationOperators": true,
70+
"spacesAroundRangeFormationOperators": false,
7271
"spacesBeforeEndOfLineComments": 1,
7372
"tabWidth": 4,
7473
"version": 1

Sources/Subprocess/AsyncBufferSequence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ extension AsyncBufferSequence {
285285
continue
286286
}
287287
return yield()
288-
case lineFeed ..< carriageReturn, newLine1, lineSeparator1, paragraphSeparator1:
288+
case lineFeed..<carriageReturn, newLine1, lineSeparator1, paragraphSeparator1:
289289
return yield()
290290
default:
291291
continue

Sources/Subprocess/Buffer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extension AsyncBufferSequence.Buffer {
7777
}
7878

7979
#if SubprocessSpan
80+
// swift-format-ignore
8081
// Access the storage backing this Buffer
8182
public var bytes: RawSpan {
8283
@lifetime(borrow self)

Sources/Subprocess/Configuration.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ extension Environment: CustomStringConvertible, CustomDebugStringConvertible {
410410
continue
411411
}
412412

413-
let key = String(environmentString[environmentString.startIndex ..< delimiter])
413+
let key = String(environmentString[environmentString.startIndex..<delimiter])
414414
let value = String(
415-
environmentString[environmentString.index(after: delimiter) ..< environmentString.endIndex]
415+
environmentString[environmentString.index(after: delimiter)..<environmentString.endIndex]
416416
)
417417
results[key] = value
418418
}

Sources/Subprocess/IO/AsyncIO+Linux.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ final class AsyncIO: Sendable {
161161
break monitorLoop
162162
}
163163

164-
for index in 0 ..< Int(eventCount) {
164+
for index in 0..<Int(eventCount) {
165165
let event = events[index]
166166
let targetFileDescriptor = event.data.fd
167167
// Breakout the monitor loop if we received shutdown

Sources/Subprocess/IO/AsyncIO+Windows.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,12 @@ final class AsyncIO: @unchecked Sendable {
182182
return
183183
}
184184
// Post status to shutdown HANDLE
185+
// swift-format-ignore
185186
PostQueuedCompletionStatus(
186-
ioPort, // CompletionPort
187-
0, // Number of bytes transferred.
187+
ioPort, // CompletionPort
188+
0, // Number of bytes transferred.
188189
shutdownPort, // Completion key to post status
189-
nil // Overlapped
190+
nil // Overlapped
190191
)
191192
// Wait for monitor thread to exit
192193
WaitForSingleObject(monitorThreadHandle, INFINITE)

Sources/Subprocess/IO/Output.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public struct StringOutput<Encoding: Unicode.Encoding>: OutputProtocol {
121121
public func output(from span: RawSpan) throws -> String? {
122122
// FIXME: Span to String
123123
var array: [UInt8] = []
124-
for index in 0 ..< span.byteCount {
124+
for index in 0..<span.byteCount {
125125
array.append(span.unsafeLoad(fromByteOffset: index, as: UInt8.self))
126126
}
127127
return String(decodingBytes: array, as: Encoding.self)

Sources/Subprocess/Platforms/Subprocess+Linux.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private func monitorThreadFunc(context: MonitorThreadContext) {
264264
break monitorLoop
265265
}
266266

267-
for index in 0 ..< Int(eventCount) {
267+
for index in 0..<Int(eventCount) {
268268
let event = events[index]
269269
let targetFileDescriptor = event.data.fd
270270

Sources/Subprocess/Platforms/Subprocess+Windows.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ extension String {
13581358
// not add the \\?\ prefix required by other functions under these conditions).
13591359
let dwLength: DWORD = GetFullPathNameW(pwszPath, 0, nil, nil)
13601360
return try withUnsafeTemporaryAllocation(of: WCHAR.self, capacity: Int(dwLength)) { pwszFullPath in
1361-
guard (1 ..< dwLength).contains(GetFullPathNameW(pwszPath, DWORD(pwszFullPath.count), pwszFullPath.baseAddress, nil)) else {
1361+
guard (1..<dwLength).contains(GetFullPathNameW(pwszPath, DWORD(pwszFullPath.count), pwszFullPath.baseAddress, nil)) else {
13621362
throw SubprocessError(
13631363
code: .init(.invalidWindowsPath(self)),
13641364
underlyingError: .init(rawValue: GetLastError())
@@ -1434,7 +1434,7 @@ extension UInt8 {
14341434
static var _period: UInt8 { UInt8(ascii: ".") }
14351435

14361436
var isLetter: Bool? {
1437-
return (0x41 ... 0x5a) ~= self || (0x61 ... 0x7a) ~= self
1437+
return (0x41...0x5a) ~= self || (0x61...0x7a) ~= self
14381438
}
14391439
}
14401440

@@ -1459,7 +1459,7 @@ internal func fillNullTerminatedWideStringBuffer(
14591459
switch count {
14601460
case 0:
14611461
throw SubprocessError.UnderlyingError(rawValue: GetLastError())
1462-
case 1 ..< DWORD(buffer.count):
1462+
case 1..<DWORD(buffer.count):
14631463
let result = String(decodingCString: buffer.baseAddress!, as: UTF16.self)
14641464
assert(result.utf16.count == count, "Parsed UTF-16 count \(result.utf16.count) != reported UTF-16 count \(count)")
14651465
return result

0 commit comments

Comments
 (0)