mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
2bcea4b04d
* Add LintableFilesVisitor * Move LintCommand logic into LintOrAnalyzeCommand to prepare for the upcoming analyze command * Add AnalyzeCommand (not fully implemented yet in SwiftLintFramework) * Add analyzerRules configuration member * Add AnalyzerRule protocol * Pass compiler arguments to validate/correct * Add requiresFileOnDisk member to RuleDescription This will be used by AnalyzerRules because they need a file on disk to pass in the compiler arguments to SourceKit. * Exclusively run AnalyzerRules when the Linter has compiler arguments * Enable testing AnalyzerRules in TestHelpers * Add ExplicitSelfRule * Update documentation * Fix `analyze --autocorrect` * Improve performance of CompilerArgumentsExtractor * Fix lint command actually running analyze * Move File operations in TestHelpers into a private extension * Add analyzer column to rules command and markdown documentation * Use a Set literal * Make AnalyzerRule inherit from OptInRule * Mention analyzer_rules in readme * Mention that analyzer rules are slow
18 lines
549 B
Swift
18 lines
549 B
Swift
import SwiftLintFramework
|
|
|
|
extension Reporter {
|
|
static func report(violations: [StyleViolation], realtimeCondition: Bool) {
|
|
if isRealtime == realtimeCondition {
|
|
let report = generateReport(violations)
|
|
if !report.isEmpty {
|
|
queuedPrint(report)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
func reporterFrom(optionsReporter: String, configuration: Configuration) -> Reporter.Type {
|
|
let string = optionsReporter.isEmpty ? configuration.reporter : optionsReporter
|
|
return reporterFrom(identifier: string)
|
|
}
|