Files
SwiftLint/Source/SwiftLintFramework/Linter.swift
T
2015-05-18 04:33:25 +02:00

31 lines
632 B
Swift

//
// Linter.swift
// SwiftLint
//
// Created by JP Simard on 2015-05-16.
// Copyright (c) 2015 Realm. All rights reserved.
//
import Foundation
import SwiftXPC
import SourceKittenFramework
public struct Linter {
private let file: File
private let structure: Structure
public var styleViolations: [StyleViolation] {
return file.astViolationsInDictionary(structure.dictionary) + file.stringViolations
}
/**
Initialize a Linter by passing in a File.
:param: file File to lint.
*/
public init(file: File) {
self.file = file
structure = Structure(file: file)
}
}