Linter

public struct Linter

Represents a file that can be linted for style violations and corrections after being collected.

  • The file to lint with this linter.

    Declaration

    Swift

    public let file: SwiftLintFile
  • Whether or not this linter will be used to collect information from several files.

    Declaration

    Swift

    public var isCollecting: Bool
  • Creates a Linter by specifying its properties directly.

    Declaration

    Swift

    public init(file: SwiftLintFile,
                configuration: Configuration = Configuration.default,
                cache: LinterCache? = nil,
                compilerArguments: [String] = [])

    Parameters

    file

    The file to lint with this linter.

    configuration

    The SwiftLint configuration to apply to this linter.

    cache

    The persisted cache to use for this linter.

    compilerArguments

    The compiler arguments to use for this linter if it is to execute analyzer rules.

  • Returns a linter capable of checking for violations after running each rule’s collection step.

    Declaration

    Swift

    public func collect(into storage: RuleStorage) -> CollectedLinter

    Parameters

    storage

    The storage object where collected info should be saved.

    Return Value

    A linter capable of checking for violations after running each rule’s collection step.