Run SwiftFormat.

This commit is contained in:
Doug
2026-05-27 14:38:50 +01:00
committed by Doug
parent 5138e05e47
commit fa67713726
573 changed files with 2426 additions and 2426 deletions
+7 -7
View File
@@ -6,7 +6,7 @@ struct Locheck: ParsableCommand {
enum LocheckError: LocalizedError {
case missingMint
case outputError
var errorDescription: String? {
switch self {
case .missingMint:
@@ -16,28 +16,28 @@ struct Locheck: ParsableCommand {
}
}
}
static let configuration = CommandConfiguration(abstract: "A tool that verifies bad strings contained in localization files")
private var stringsDirectoryURL: URL {
.projectDirectory.appendingPathComponent("ElementX/Resources/Localizations")
}
func run() throws {
try checkMint()
try checkStrings()
}
func checkStrings() throws {
guard let output = try Zsh.run(command: "mint run locheck discoverlproj --ignore-missing --ignore lproj_file_missing_from_translation --treat-warnings-as-errors \(stringsDirectoryURL.path)") else {
throw LocheckError.missingMint
}
print(output)
}
private func checkMint() throws {
let result = try Zsh.run(command: "which mint")
if result?.contains("not found") == true {
throw LocheckError.missingMint
}