We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8ed656 + 1898488 commit 08185e8Copy full SHA for 08185e8
Sources/swift-format/Subcommands/Lint.swift
@@ -21,11 +21,22 @@ extension SwiftFormatCommand {
21
22
@OptionGroup()
23
var lintOptions: LintFormatOptions
24
+
25
+ @Flag(
26
+ name: .shortAndLong,
27
+ help: "Fail on warnings."
28
+ )
29
+ var strict: Bool = false
30
31
func run() throws {
32
let frontend = LintFrontend(lintFormatOptions: lintOptions)
33
frontend.run()
34
if frontend.errorsWereEmitted { throw ExitCode.failure }
35
+ if strict,
36
+ frontend.diagnosticEngine.diagnostics
37
+ .contains(where: { $0.message.severity == .warning }) {
38
+ throw ExitCode.failure
39
+ }
40
}
41
42
0 commit comments