mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
9710148f76
Tasks we perform with Sourcery are rather simple and can be replaced with a basic collection of files and the generation of lists in the new `swiftlint-dev` command. This spares contributors from installing either Sourcery or Bazel.
42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
import ArgumentParser
|
|
import Foundation
|
|
|
|
@main
|
|
struct SwiftLintDev: AsyncParsableCommand {
|
|
static let configuration = CommandConfiguration(
|
|
commandName: "swiftlint-dev",
|
|
abstract: "A tool to help develop SwiftLint.",
|
|
subcommands: [
|
|
Reporters.self,
|
|
Rules.self,
|
|
]
|
|
)
|
|
|
|
struct Reporters: AsyncParsableCommand {
|
|
static let configuration = CommandConfiguration(
|
|
commandName: "reporters",
|
|
abstract: "Manage SwiftLint reporters.",
|
|
subcommands: [
|
|
Self.Register.self,
|
|
]
|
|
)
|
|
}
|
|
|
|
struct Rules: AsyncParsableCommand {
|
|
static let configuration = CommandConfiguration(
|
|
commandName: "rules",
|
|
abstract: "Manage SwiftLint rules.",
|
|
subcommands: [
|
|
Self.Register.self,
|
|
Self.Template.self,
|
|
]
|
|
)
|
|
}
|
|
}
|
|
|
|
extension URL {
|
|
var relativeToCurrentDirectory: String {
|
|
String(path.replacingOccurrences(of: FileManager.default.currentDirectoryPath, with: "").dropFirst())
|
|
}
|
|
}
|