Skip to content

Commit 7382978

Browse files
committed
Fix lint errors with Xcode 26.4 RC1
1 parent e057d63 commit 7382978

File tree

10 files changed

+45
-31
lines changed

10 files changed

+45
-31
lines changed

.github/workflows/VerifyChanges.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ on:
66
push:
77
branches: ["main"]
88

9+
env:
10+
XCODE_VERSION: 26.0.1
11+
912
jobs:
1013
lint:
1114
name: Lint
1215
runs-on: macos-15
1316
steps:
1417
- name: Checkout
1518
uses: actions/checkout@v4
16-
- name: Select Xcode 26.0.0
17-
run: |
18-
sudo xcode-select -s /Applications/Xcode_26.0.0.app
19+
- name: Select Xcode ${{ env.XCODE_VERSION }}
20+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
1921
- name: Lint
20-
run: |
21-
Scripts/lint
22+
run: Scripts/lint
2223

2324
build-and-test:
2425
name: Build and Test (${{ matrix.platform }})
@@ -53,8 +54,8 @@ jobs:
5354
XCODE_TEST_PRODUCTS_PATH: .build/DevFoundation.xctestproducts
5455

5556
steps:
56-
- name: Select Xcode 26.0.0
57-
run: sudo xcode-select -s /Applications/Xcode_26.0.0.app
57+
- name: Select Xcode ${{ env.XCODE_VERSION }}
58+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
5859

5960
- name: Checkout
6061
uses: actions/checkout@v4

App/Tests/DevKeychainAppTests/GenericPasswordIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct GenericPasswordIntegrationTests: RandomValueGenerating {
3535
let attributes = GenericPassword.AdditionAttributes(
3636
service: service,
3737
account: account,
38-
data: randomData()
38+
data: randomData(),
3939
)
4040

4141
let addedItem = try keychain.addItem(with: attributes)

App/Tests/DevKeychainAppTests/InternetPasswordIntegrationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct InternetPasswordIntegrationTests: RandomValueGenerating {
3535
let attributes = InternetPassword.AdditionAttributes(
3636
server: server,
3737
account: account,
38-
data: randomData()
38+
data: randomData(),
3939
)
4040

4141
let addedItem = try keychain.addItem(with: attributes)

Scripts/format

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Get the directory where this script is located
4+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
6+
# Go to the repository root (one level up from Scripts)
7+
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
8+
9+
# Run swift format with --in-place to fix formatting issues
10+
swift format --in-place --recursive \
11+
"$REPO_ROOT/App/" \
12+
"$REPO_ROOT/Sources/" \
13+
"$REPO_ROOT/Tests/"

Sources/DevKeychain/Errors/KeychainItemMappingError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum KeychainItemMappingError: Error, Equatable {
2727
return lhsAttribute == rhsAttribute
2828
case (
2929
.attributeTypeMismatch(let lhsAttribute, let lhsType),
30-
.attributeTypeMismatch(let rhsAttribute, let rhsType)
30+
.attributeTypeMismatch(let rhsAttribute, let rhsType),
3131
):
3232
return lhsAttribute == rhsAttribute && lhsType == rhsType
3333
default:

Sources/DevKeychain/Keychain Items/GenericPassword.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension GenericPassword {
4545
self.init(
4646
service: try attributes.value(forKeychainAttribute: kSecAttrService, type: String.self),
4747
account: try attributes.value(forKeychainAttribute: kSecAttrAccount, type: String.self),
48-
data: try attributes.value(forKeychainAttribute: kSecValueData, type: Data.self)
48+
data: try attributes.value(forKeychainAttribute: kSecValueData, type: Data.self),
4949
)
5050
}
5151
}

Sources/DevKeychain/Keychain Items/InternetPassword.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension InternetPassword {
4545
self.init(
4646
server: try attributes.value(forKeychainAttribute: kSecAttrServer, type: String.self),
4747
account: try attributes.value(forKeychainAttribute: kSecAttrAccount, type: String.self),
48-
data: try attributes.value(forKeychainAttribute: kSecValueData, type: Data.self)
48+
data: try attributes.value(forKeychainAttribute: kSecValueData, type: Data.self),
4949
)
5050
}
5151
}

Tests/DevKeychainTests/Keychain Items/GenericPasswordTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct GenericPassword_AdditionAttributesTests: RandomValueGenerating {
143143
service: service,
144144
account: account,
145145
password: password,
146-
encoding: .ascii
146+
encoding: .ascii,
147147
)
148148
#expect(attributes == nil)
149149
}
@@ -161,7 +161,7 @@ struct GenericPassword_AdditionAttributesTests: RandomValueGenerating {
161161
service: service,
162162
account: account,
163163
password: password,
164-
encoding: .utf8
164+
encoding: .utf8,
165165
)
166166
)
167167

@@ -198,7 +198,7 @@ struct GenericPassword_AdditionAttributesTests: RandomValueGenerating {
198198
let attributes = GenericPassword.AdditionAttributes(
199199
service: randomAlphanumericString(),
200200
account: randomAlphanumericString(),
201-
data: randomData()
201+
data: randomData(),
202202
)
203203

204204
#expect(throws: KeychainItemMappingError.dataCorrupted) {
@@ -212,7 +212,7 @@ struct GenericPassword_AdditionAttributesTests: RandomValueGenerating {
212212
let attributes = GenericPassword.AdditionAttributes(
213213
service: randomAlphanumericString(),
214214
account: randomAlphanumericString(),
215-
data: randomData()
215+
data: randomData(),
216216
)
217217

218218
#expect(throws: KeychainItemMappingError.self) {
@@ -273,7 +273,7 @@ struct GenericPassword_QueryTests: RandomValueGenerating {
273273
for isAccountNil in [false, true] {
274274
let query = GenericPassword.Query(
275275
service: isServiceNil ? nil : service,
276-
account: isAccountNil ? nil : account
276+
account: isAccountNil ? nil : account,
277277
)
278278

279279
var expectedDictionary = fullAttributesDictionary
@@ -295,7 +295,7 @@ struct GenericPassword_QueryTests: RandomValueGenerating {
295295
mutating func returnDictionaryIsCorrect() throws {
296296
let query = GenericPassword.Query(
297297
service: randomOptional(randomAlphanumericString()),
298-
account: randomOptional(randomAlphanumericString())
298+
account: randomOptional(randomAlphanumericString()),
299299
)
300300

301301
let expectedDictionary = [
@@ -311,7 +311,7 @@ struct GenericPassword_QueryTests: RandomValueGenerating {
311311
mutating func mapThrowsErrorWhenRawItemsIsIncorrectType() {
312312
let query = GenericPassword.Query(
313313
service: randomOptional(randomAlphanumericString()),
314-
account: randomOptional(randomAlphanumericString())
314+
account: randomOptional(randomAlphanumericString()),
315315
)
316316

317317
#expect(throws: KeychainItemMappingError.dataCorrupted) {
@@ -324,14 +324,14 @@ struct GenericPassword_QueryTests: RandomValueGenerating {
324324
mutating func mapReturnsItemsWithCorrectValues() throws {
325325
let query = GenericPassword.Query(
326326
service: randomOptional(randomAlphanumericString()),
327-
account: randomOptional(randomAlphanumericString())
327+
account: randomOptional(randomAlphanumericString()),
328328
)
329329

330330
let expectedItems = Array(count: randomInt(in: 3 ... 5)) {
331331
GenericPassword(
332332
service: randomAlphanumericString(),
333333
account: randomAlphanumericString(),
334-
data: randomData()
334+
data: randomData(),
335335
)
336336
}
337337

Tests/DevKeychainTests/Keychain Items/InternetPasswordTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct InternetPassword_AdditionAttributesTests: RandomValueGenerating {
143143
server: server,
144144
account: account,
145145
password: password,
146-
encoding: .ascii
146+
encoding: .ascii,
147147
)
148148
#expect(attributes == nil)
149149
}
@@ -161,7 +161,7 @@ struct InternetPassword_AdditionAttributesTests: RandomValueGenerating {
161161
server: server,
162162
account: account,
163163
password: password,
164-
encoding: .utf8
164+
encoding: .utf8,
165165
)
166166
)
167167

@@ -198,7 +198,7 @@ struct InternetPassword_AdditionAttributesTests: RandomValueGenerating {
198198
let attributes = InternetPassword.AdditionAttributes(
199199
server: randomAlphanumericString(),
200200
account: randomAlphanumericString(),
201-
data: randomData()
201+
data: randomData(),
202202
)
203203

204204
#expect(throws: KeychainItemMappingError.dataCorrupted) {
@@ -212,7 +212,7 @@ struct InternetPassword_AdditionAttributesTests: RandomValueGenerating {
212212
let attributes = InternetPassword.AdditionAttributes(
213213
server: randomAlphanumericString(),
214214
account: randomAlphanumericString(),
215-
data: randomData()
215+
data: randomData(),
216216
)
217217

218218
#expect(throws: KeychainItemMappingError.self) {
@@ -273,7 +273,7 @@ struct InternetPassword_QueryTests: RandomValueGenerating {
273273
for isAccountNil in [false, true] {
274274
let query = InternetPassword.Query(
275275
server: isServerNil ? nil : server,
276-
account: isAccountNil ? nil : account
276+
account: isAccountNil ? nil : account,
277277
)
278278

279279
var expectedDictionary = fullAttributesDictionary
@@ -295,7 +295,7 @@ struct InternetPassword_QueryTests: RandomValueGenerating {
295295
mutating func returnDictionaryIsCorrect() throws {
296296
let query = InternetPassword.Query(
297297
server: randomOptional(randomAlphanumericString()),
298-
account: randomOptional(randomAlphanumericString())
298+
account: randomOptional(randomAlphanumericString()),
299299
)
300300

301301
let expectedDictionary = [
@@ -311,7 +311,7 @@ struct InternetPassword_QueryTests: RandomValueGenerating {
311311
mutating func mapThrowsErrorWhenRawItemsIsIncorrectType() {
312312
let query = InternetPassword.Query(
313313
server: randomOptional(randomAlphanumericString()),
314-
account: randomOptional(randomAlphanumericString())
314+
account: randomOptional(randomAlphanumericString()),
315315
)
316316

317317
#expect(throws: KeychainItemMappingError.dataCorrupted) {
@@ -324,14 +324,14 @@ struct InternetPassword_QueryTests: RandomValueGenerating {
324324
mutating func mapReturnsItemsWithCorrectValues() throws {
325325
let query = InternetPassword.Query(
326326
server: randomOptional(randomAlphanumericString()),
327-
account: randomOptional(randomAlphanumericString())
327+
account: randomOptional(randomAlphanumericString()),
328328
)
329329

330330
let expectedItems = Array(count: randomInt(in: 3 ... 5)) {
331331
InternetPassword(
332332
server: randomAlphanumericString(),
333333
account: randomAlphanumericString(),
334-
data: randomData()
334+
data: randomData(),
335335
)
336336
}
337337

Tests/DevKeychainTests/Testing Helpers/RandomValueGenerating+DevKeychain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension RandomValueGenerating {
2525
mutating func randomKeychainQueryOptions() -> Keychain.QueryOptions {
2626
return .init(
2727
isCaseInsensitive: randomBool(),
28-
limit: randomOptional(randomInt(in: 1 ... 10))
28+
limit: randomOptional(randomInt(in: 1 ... 10)),
2929
)
3030
}
3131
}

0 commit comments

Comments
 (0)