Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s2mr committed Feb 7, 2023
1 parent 5e18d2b commit 91a956a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/l10nlint/Commands/Lint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import ArgumentParser
import Foundation
import L10nLintFramework

// TODO: Lint command
// Base, enが同じかどうか

// TODO: Correct command
// - Baseを編集したらそれぞれにコピー // markerをつけてその中身をコピー
// - 並び順を自動補正
Expand All @@ -18,6 +21,9 @@ extension MainTool {
@Option(help: "Change report format")
var reporter: String?

@Flag(help: "When have lint error, exit with error code")
var failOnError: Bool = false

func run() throws {
let configuration = try Configuration.load(customPath: arguments.config)
let violations = try LintRunner.run(configuration: configuration)
Expand All @@ -26,7 +32,7 @@ extension MainTool {
if !reportString.isEmpty {
queuedPrint(reportString)
}
if violations.map(\.severity).contains(.error) {
if failOnError && violations.map(\.severity).contains(.error) {
throw ExitCode.failure
}
}
Expand Down

0 comments on commit 91a956a

Please sign in to comment.