mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 02:03:32 +01:00
XCode project for app, moved app project to folder
This commit is contained in:
61
SideStoreApp/Sources/Cargo/Commands/Build.swift
Normal file
61
SideStoreApp/Sources/Cargo/Commands/Build.swift
Normal file
@@ -0,0 +1,61 @@
|
||||
import ArgumentParser
|
||||
import SwiftLintFramework
|
||||
|
||||
extension SwiftLint {
|
||||
struct Build: AsyncParsableCommand {
|
||||
static let configuration = CommandConfiguration(abstract: "Print lint warnings and errors")
|
||||
|
||||
@OptionGroup
|
||||
var common: LintOrAnalyzeArguments
|
||||
@Option(help: pathOptionDescription(for: .build))
|
||||
var path: String?
|
||||
@Flag(help: quietOptionDescription(for: .build))
|
||||
var quiet = false
|
||||
@Option(help: "The directory of the cache used when linting.")
|
||||
var cachePath: String?
|
||||
@Flag(help: "Ignore cache when linting.")
|
||||
var noCache = false
|
||||
@Flag(help: "Run all rules, even opt-in and disabled ones, ignoring `only_rules`.")
|
||||
var enableAllRules = false
|
||||
@Argument(help: pathsArgumentDescription(for: .build))
|
||||
var paths = [String]()
|
||||
|
||||
func run() async throws {
|
||||
let allPaths: [String]
|
||||
if let path {
|
||||
queuedPrintError("""
|
||||
warning: The --path option is deprecated. Pass the path(s) to lint last to the swiftlint command.
|
||||
""")
|
||||
allPaths = [path] + paths
|
||||
} else if !paths.isEmpty {
|
||||
allPaths = paths
|
||||
} else {
|
||||
allPaths = [""] // Lint files in current working directory if no paths were specified.
|
||||
}
|
||||
let options = LintOrAnalyzeOptions(
|
||||
mode: .build,
|
||||
paths: allPaths,
|
||||
configurationFiles: common.config,
|
||||
strict: common.leniency == .strict,
|
||||
lenient: common.leniency == .lenient,
|
||||
forceExclude: common.forceExclude,
|
||||
useExcludingByPrefix: common.useAlternativeExcluding,
|
||||
useScriptInputFiles: common.useScriptInputFiles,
|
||||
benchmark: common.benchmark,
|
||||
reporter: common.reporter,
|
||||
quiet: quiet,
|
||||
output: common.output,
|
||||
progress: common.progress,
|
||||
cachePath: cachePath,
|
||||
ignoreCache: noCache,
|
||||
enableAllRules: enableAllRules,
|
||||
autocorrect: common.fix,
|
||||
format: common.format,
|
||||
compilerLogPath: nil,
|
||||
compileCommands: nil,
|
||||
inProcessSourcekit: common.inProcessSourcekit
|
||||
)
|
||||
try await LintOrAnalyzeCommand.run(options)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user