Files
Danny Mösch 58928b7e40 Enforce any on existential types (#5273)
This makes syntactically clear which types are rather expensive.
2023-10-12 08:37:23 +02:00

33 lines
854 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() throws {
print(TextTable(reporters: reportersList).render())
ExitHelper.successfullyExit()
}
}
}
// 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
])
}
}
}