mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
32 lines
807 B
Swift
32 lines
807 B
Swift
import ArgumentParser
|
|
import SwiftLintFramework
|
|
import SwiftyTextTable
|
|
|
|
extension SwiftLint {
|
|
struct Reporters: ParsableCommand {
|
|
static let configuration = CommandConfiguration(abstract: "Display the list of reporters and their identifiers")
|
|
|
|
func run() {
|
|
print(TextTable(reporters: reportersList).render())
|
|
}
|
|
}
|
|
}
|
|
|
|
// MARK: - SwiftyTextTable
|
|
|
|
private extension TextTable {
|
|
init(reporters: [any Reporter.Type]) {
|
|
let columns = [
|
|
TextTableColumn(header: "identifier"),
|
|
TextTableColumn(header: "description"),
|
|
]
|
|
self.init(columns: columns)
|
|
for reporter in reporters {
|
|
addRow(values: [
|
|
reporter.identifier,
|
|
reporter.description,
|
|
])
|
|
}
|
|
}
|
|
}
|