CollectingCorrectableRule

public protocol CollectingCorrectableRule : CollectingRule, CorrectableRule

A CollectingRule that is also a CorrectableRule.

  • Attempts to correct the violations to this rule in the specified file after collecting file info for all files and returns all corrections that were applied.

    Note

    This function is called by the linter and is always implemented in extensions.

    Default Implementation

    Declaration

    Swift

    func correct(file: SwiftLintFile, collectedInfo: [SwiftLintFile: FileInfo],
                 compilerArguments: [String]) -> [Correction]

    Parameters

    file

    The file for which to execute the rule.

    collectedInfo

    All collected info.

    compilerArguments

    The compiler arguments needed to compile this file.

    Return Value

    All corrections that were applied.

  • Attempts to correct the violations to this rule in the specified file after collecting file info for all files and returns all corrections that were applied.

    Note

    This function is called by the linter and is always implemented in extensions.

    Declaration

    Swift

    func correct(file: SwiftLintFile, collectedInfo: [SwiftLintFile : FileInfo]) -> [Correction]

    Parameters

    file

    The file for which to execute the rule.

    collectedInfo

    All collected info.

    Return Value

    All corrections that were applied.

Collecting rules