Skip to content

Commit 1060677

Browse files
authored
Merge pull request #2068 from ahoppen/ahoppen/warnings-as-errors
Add an option to swift-syntax-dev-utils to treat all warnings as errors
2 parents 269f452 + c881ee9 commit 1060677

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
@@ -48,6 +48,10 @@ extension BuildCommand {
4848
args += ["--scratch-path", buildDir]
4949
}
5050

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

0 commit comments

Comments
 (0)