Skip to content

Commit 5bcb9b0

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

4 files changed

Lines changed: 24 additions & 11 deletions

File tree

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)