Skip to content

Commit 79b62e3

Browse files
authored
chore: start treating warnings as errors - WPB-11987 (#3816)
1 parent 7f83724 commit 79b62e3

File tree

9 files changed

+59
-16
lines changed

9 files changed

+59
-16
lines changed

.github/workflows/swiftformat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ jobs:
2929
if: ${{ steps.changes.outputs.swift == 'true' }}
3030

3131
- name: Install SwiftFormat 0.58.3
32+
if: ${{ steps.changes.outputs.swift == 'true' }}
3233
run: |
3334
curl -L -o swiftformat.zip https://github.com/nicklockwood/SwiftFormat/releases/download/0.58.3/swiftformat_linux.zip
3435
unzip swiftformat.zip -d swiftformat_bin
3536
sudo mv swiftformat_bin/swiftformat_linux /usr/local/bin/swiftformat
3637
chmod +x /usr/local/bin/swiftformat
3738
3839
- name: Run SwiftFormat
40+
if: ${{ steps.changes.outputs.swift == 'true' }}
3941
run: swiftformat --lint . --reporter github-actions-log --config .swiftformat

WireAnalytics/Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Foundation
44
import PackageDescription
55

66
// You can enable/disable Datadog for debugging by overriding the boolean.
7+
// open --env ENABLE_DATADOG=true --env ENABLE_COUNTLY=true wire-ios-mono.xcworkspace
78
let isDatadogEnabled = hasEnvironmentVariable("ENABLE_DATADOG", "true")
89
let isCountlyEnabled = hasEnvironmentVariable("ENABLE_COUNTLY", "true")
910

WireAuthentication/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let package = Package(
2121
.package(path: "../WireUI"),
2222
.package(path: "../WirePlugins"),
2323
.package(url: "https://github.com/uber/needle.git", .upToNextMinor(from: "0.25.1")),
24-
.package(url: "https://github.com/siteline/swiftui-introspect", from: "1.0.0")
24+
.package(url: "https://github.com/siteline/swiftui-introspect", from: "26.0.0"),
2525
],
2626
targets: [
2727
.target(

WireLogging/Package.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// swift-tools-version: 6.2
22

3+
import Foundation
34
import PackageDescription
45

56
let package = Package(
@@ -26,11 +27,17 @@ let package = Package(
2627
]
2728
)
2829

30+
// open --env CI wire-ios-mono.xcworkspace
31+
// or
32+
// CI= swift build
33+
let isCI = ProcessInfo.processInfo.environment["CI"] != nil
34+
2935
for target in package.targets {
3036
target.swiftSettings = (target.swiftSettings ?? []) + [
3137
.enableUpcomingFeature("ExistentialAny"),
3238
.enableUpcomingFeature("InternalImportsByDefault"),
3339
.enableUpcomingFeature("MemberImportVisibility"),
3440
.enableUpcomingFeature("StrictMemorySafety"),
35-
]
41+
isCI ? .unsafeFlags(["-warnings-as-errors"]) : nil
42+
].compactMap(\.self)
3643
}

WireLogging/Tests/TestPlans/AllTests.xctestplan

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"configurations" : [
33
{
4-
"id" : "8C7B2297-3D36-4CFC-9B55-BF2CC1C85BF4",
5-
"name" : "Configuration 1",
4+
"id" : "8DA8C849-71C0-4072-92BA-9AF39BAA1039",
5+
"name" : "Test Scheme Action",
66
"options" : {
77

88
}
99
}
1010
],
1111
"defaultOptions" : {
12-
12+
"performanceAntipatternCheckerEnabled" : true
1313
},
1414
"testTargets" : [
1515
{
1616
"target" : {
17-
"containerPath" : "container:",
17+
"containerPath" : "container:WireLogging",
1818
"identifier" : "WireLoggingTests",
1919
"name" : "WireLoggingTests"
2020
}

fastlane/Fastfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,14 @@ platform :ios do
477477
if build.for_simulator
478478
Dir.chdir("..") do
479479
# Build the app for simulator
480-
sh "xcodebuild -workspace 'wire-ios-mono.xcworkspace' -scheme 'Wire-iOS' -configuration 'Debug' -destination \"generic/platform=iOS Simulator\" -derivedDataPath DerivedData -quiet build BUILD_NUMBER=#{build.build_number}"
480+
sh "xcodebuild " \
481+
"-workspace 'wire-ios-mono.xcworkspace' " \
482+
"-scheme 'Wire-iOS' " \
483+
"-configuration 'Debug' " \
484+
"-destination \"generic/platform=iOS Simulator\" " \
485+
"-derivedDataPath DerivedData " \
486+
"-quiet build " \
487+
"BUILD_NUMBER=#{build.build_number}"
481488

482489
# make a "fake" .ipa package that QA will use for installing to simulator
483490
sh "mkdir -p debug/Payload"

fastlane/framework.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def to_scheme(name)
176176
when "WireAnalytics"
177177
"WireAnalyticsAll" # if a package has multiple targets, fastlane does not found <Package>-Package
178178
when "WireLogging"
179-
"WireLogging"
179+
"WireLoggingAll" # if a package has multiple targets, fastlane does not find <Package>-Package
180180
when "wire-ios-mocktransport"
181181
"WireMockTransport"
182182
else

wire-ios-mono.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WireLogging/.swiftpm/xcode/xcshareddata/xcschemes/WireLogging.xcscheme renamed to wire-ios-mono.xcworkspace/xcshareddata/xcschemes/WireLoggingAll.xcscheme

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1640"
3+
LastUpgradeVersion = "2600"
44
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -18,7 +18,21 @@
1818
BlueprintIdentifier = "WireLogging"
1919
BuildableName = "WireLogging"
2020
BlueprintName = "WireLogging"
21-
ReferencedContainer = "container:">
21+
ReferencedContainer = "container:WireLogging">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
<BuildActionEntry
25+
buildForTesting = "YES"
26+
buildForRunning = "YES"
27+
buildForProfiling = "YES"
28+
buildForArchiving = "YES"
29+
buildForAnalyzing = "YES">
30+
<BuildableReference
31+
BuildableIdentifier = "primary"
32+
BlueprintIdentifier = "WireLoggingSupport"
33+
BuildableName = "WireLoggingSupport"
34+
BlueprintName = "WireLoggingSupport"
35+
ReferencedContainer = "container:WireLogging">
2236
</BuildableReference>
2337
</BuildActionEntry>
2438
</BuildActionEntries>
@@ -30,10 +44,22 @@
3044
shouldUseLaunchSchemeArgsEnv = "YES">
3145
<TestPlans>
3246
<TestPlanReference
33-
reference = "container:Tests/TestPlans/AllTests.xctestplan"
47+
reference = "container:WireLogging/Tests/TestPlans/AllTests.xctestplan"
3448
default = "YES">
3549
</TestPlanReference>
3650
</TestPlans>
51+
<Testables>
52+
<TestableReference
53+
skipped = "NO">
54+
<BuildableReference
55+
BuildableIdentifier = "primary"
56+
BlueprintIdentifier = "WireLoggingTests"
57+
BuildableName = "WireLoggingTests"
58+
BlueprintName = "WireLoggingTests"
59+
ReferencedContainer = "container:WireLogging">
60+
</BuildableReference>
61+
</TestableReference>
62+
</Testables>
3763
</TestAction>
3864
<LaunchAction
3965
buildConfiguration = "Debug"
@@ -58,7 +84,7 @@
5884
BlueprintIdentifier = "WireLogging"
5985
BuildableName = "WireLogging"
6086
BlueprintName = "WireLogging"
61-
ReferencedContainer = "container:">
87+
ReferencedContainer = "container:WireLogging">
6288
</BuildableReference>
6389
</MacroExpansion>
6490
</ProfileAction>

0 commit comments

Comments
 (0)