Skip to content

Commit 7991725

Browse files
author
Prachi Gauriar
committed
Fix lint warnings in Xcode 26.4 RC1
1 parent ad62668 commit 7991725

File tree

5 files changed

+32
-19
lines changed

5 files changed

+32
-19
lines changed

.github/workflows/VerifyChanges.yaml

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

10+
env:
11+
XCODE_VERSION: 26.0.1
12+
1013
jobs:
1114
lint:
1215
name: Lint
1316
runs-on: macos-15
1417
steps:
1518
- name: Checkout
1619
uses: actions/checkout@v4
17-
- name: Select Xcode 26.0.0
18-
run: |
19-
sudo xcode-select -s /Applications/Xcode_26.0.0.app
20+
- name: Select Xcode ${{ env.XCODE_VERSION }}
21+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
2022
- name: Lint
21-
run: |
22-
Scripts/lint
23+
run: Scripts/lint
2324
build-and-test:
2425
name: Build and Test (${{ matrix.platform }})
2526
needs: lint
@@ -68,9 +69,8 @@ jobs:
6869
sourcepackages-directory: .build/DerivedData/SourcePackages
6970
swiftpm-package-resolved-file: Package.resolved
7071
verbose: true
71-
- name: Select Xcode 26.0
72-
run: |
73-
sudo xcode-select -s /Applications/Xcode_26.0.0.app
72+
- name: Select Xcode ${{ env.XCODE_VERSION }}
73+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
7474
- name: Build for Testing
7575
run: |
7676
"$DEV_BUILDS"/build_and_test.sh --action build-for-testing

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/Packages/" \
12+
"$REPO_ROOT/Sources/" \
13+
"$REPO_ROOT/Tests/"

Scripts/test-all-platforms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ print_error() {
2323

2424
# Platforms to test
2525
PLATFORMS=(
26-
"iOS Simulator,name=iPhone 16 Pro"
26+
"iOS Simulator,name=iPhone 17 Pro"
2727
"macOS"
2828
"tvOS Simulator,name=Apple TV 4K"
2929
)

Sources/DevColorExtraction/MostCommonColors.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension CGImage {
2222
public func mostCommonColors(
2323
count: Int,
2424
passes: Int = 5,
25-
edges: EdgeSet = .none
25+
edges: EdgeSet = .none,
2626
) -> [(color: CGColor, weight: CGFloat)]? {
2727
// Create a CIImage from which to extract the most common colors
2828
let ciImage: CIImage
@@ -128,7 +128,7 @@ extension CGContext {
128128
bitsPerComponent: 8,
129129
bytesPerRow: width * 4,
130130
space: CGColorSpace(name: CGColorSpace.sRGB)!,
131-
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue
131+
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue,
132132
)
133133
}
134134
}
@@ -148,7 +148,7 @@ extension CIImage {
148148
fileprivate func mostCommonColors(
149149
count: Int,
150150
extent: CGRect,
151-
passes: Int
151+
passes: Int,
152152
) -> [(color: CGColor, weight: CGFloat)]? {
153153
// Run the k-means filter.
154154
let filter = CIFilter.kMeans()
@@ -182,7 +182,7 @@ extension CIImage {
182182
let bitmapSize = count * 4
183183
let bitmap = UnsafeMutableRawPointer.allocate(
184184
byteCount: bitmapSize,
185-
alignment: MemoryLayout<UInt8>.alignment
185+
alignment: MemoryLayout<UInt8>.alignment,
186186
)
187187
defer { bitmap.deallocate() }
188188

@@ -194,7 +194,7 @@ extension CIImage {
194194
rowBytes: bitmapSize,
195195
bounds: CGRect(x: 0, y: 0, width: count, height: 1),
196196
format: .RGBA8,
197-
colorSpace: CGColorSpace(name: CGColorSpace.sRGB)
197+
colorSpace: CGColorSpace(name: CGColorSpace.sRGB),
198198
)
199199

200200
// Extract the RGBA values, with weight corresponding to the alpha value.
@@ -205,9 +205,9 @@ extension CIImage {
205205
srgbRed: CGFloat(rgbaBuffer[4 * i + 0]) / 255.0,
206206
green: CGFloat(rgbaBuffer[4 * i + 1]) / 255.0,
207207
blue: CGFloat(rgbaBuffer[4 * i + 2]) / 255.0,
208-
alpha: 1.0
208+
alpha: 1.0,
209209
),
210-
weight: CGFloat(rgbaBuffer[4 * i + 3]) / 255.0
210+
weight: CGFloat(rgbaBuffer[4 * i + 3]) / 255.0,
211211
)
212212
}
213213
}

Tests/DevColorExtractionTests/MostCommonColorsTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct MostCommonColorsTests {
126126
expectEqualColors(
127127
result[0].color,
128128
CGColor(srgbRed: red, green: green, blue: blue, alpha: 1.0),
129-
tolerance: 0.15
129+
tolerance: 0.15,
130130
)
131131
}
132132

@@ -359,7 +359,7 @@ struct MostCommonColorsTests {
359359
fileID: String = #fileID,
360360
filePath: String = #filePath,
361361
line: Int = #line,
362-
column: Int = #column
362+
column: Int = #column,
363363
) {
364364
let sourceLocation = SourceLocation(fileID: fileID, filePath: filePath, line: line, column: column)
365365

@@ -375,7 +375,7 @@ struct MostCommonColorsTests {
375375
#expect(
376376
actualComponent.isApproximatelyEqual(to: expectedComponent, absoluteTolerance: tolerance),
377377
"Color component \(actualComponent) not within tolerance \(tolerance) of \(expectedComponent)",
378-
sourceLocation: sourceLocation
378+
sourceLocation: sourceLocation,
379379
)
380380
}
381381
}

0 commit comments

Comments
 (0)