mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
another small refactoring of Configuration+CommandLine.swift
This commit is contained in:
@@ -33,16 +33,14 @@ private func scriptInputFiles() -> Result<[String], CommandantError<()>> {
|
||||
}()
|
||||
|
||||
return count.flatMap { count in
|
||||
let inputFiles = (0..<count)
|
||||
.map { getEnvironmentVariable("SCRIPT_INPUT_FILE_\($0)") }
|
||||
.flatMap { path -> String? in
|
||||
switch path {
|
||||
case let .success(path):
|
||||
return path
|
||||
case let .failure(error):
|
||||
queuedPrintError(String(describing: error))
|
||||
return nil
|
||||
}
|
||||
let inputFiles = (0..<count).flatMap { fileNumber -> String? in
|
||||
switch getEnvironmentVariable("SCRIPT_INPUT_FILE_\(fileNumber)") {
|
||||
case let .success(path):
|
||||
return path
|
||||
case let .failure(error):
|
||||
queuedPrintError(String(describing: error))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return Result(inputFiles)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user