Files
SwiftLint/Source/swiftlint/Extensions/Reporter+CommandLine.swift
T
JP Simard 2bcea4b04d Add ability for SwiftLint to lint files with full type-checked AST awareness (#2379)
* 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
2018-09-02 00:13:27 -07:00

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