Skip to content

Commit 9d231fd

Browse files
committed
Add an option to swift-syntax-dev-utils to treat all warnings as errors
This allows me to verify that there are no warnings in the swift-syntax package before creating a release tag.
1 parent a63c292 commit 9d231fd

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/BuildArguments.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ struct BuildArguments: ParsableArguments {
6565
)
6666
var enableTestFuzzing: Bool = false
6767

68+
@Flag(help: "Treat all warnings as errors.")
69+
var warningsAsErrors: Bool = false
70+
6871
@Flag(help: "Enable verbose logging.")
6972
var verbose: Bool = false
7073
}

SwiftSyntaxDevUtils/Sources/swift-syntax-dev-utils/common/BuildCommand.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ extension BuildCommand {
4646
args += ["--scratch-path", buildDir]
4747
}
4848

49+
if self.arguments.warningsAsErrors {
50+
args += ["-Xswiftc", "-warnings-as-errors"]
51+
}
52+
4953
#if !canImport(Darwin)
5054
args += ["--enable-test-discovery"]
5155
#endif

0 commit comments

Comments
 (0)