Files
Danny Mösch 9710148f76 Replace Sourcery with internal implementation (#6034)
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.
2025-03-26 20:38:53 +00:00

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())
}
}