SwiftLintFile
public final class SwiftLintFile
extension SwiftLintFile: Equatable, Hashable
A unit of Swift source code, either on disk or in memory.
-
Creates a
SwiftLintFilewith a SourceKittenFile.Declaration
Swift
public init(file: File)Parameters
fileA file from SourceKitten.
-
Creates a
SwiftLintFileby specifying its path on disk. Fails if the file does not exist.Declaration
Swift
public convenience init?(path: String)Parameters
pathThe path to a file on disk. Relative and absolute paths supported.
-
Creates a
SwiftLintFileby specifying its path on disk. Unlike theSwiftLintFile(path:)initializer, this one does not read its contents immediately, but rather traps at runtime when attempting to access its contents.Declaration
Swift
public convenience init(pathDeferringReading path: String)Parameters
pathThe path to a file on disk. Relative and absolute paths supported.
-
Creates a
SwiftLintFilethat is not backed by a file on disk by specifying its contents.Declaration
Swift
public convenience init(contents: String)Parameters
contentsThe contents of the file.
-
The path on disk for this file.
Declaration
Swift
public var path: String? { get } -
The file’s contents.
Declaration
Swift
public var contents: String { get } -
A string view into the contents of this file optimized for string manipulation operations.
Declaration
Swift
public var stringView: StringView { get } -
The parsed lines for this file’s contents.
Declaration
Swift
public var lines: [Line] { get } -
Invalidates all cached data for this file.
Declaration
Swift
public func invalidateCache()
-
Declaration
Swift
public static func == (lhs: SwiftLintFile, rhs: SwiftLintFile) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
Install in Dash
SwiftLintFile Class Reference