Command

public struct Command : Equatable

A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

  • The action (verb) that SwiftLint should perform when interpreting this command.

    See more

    Declaration

    Swift

    public enum Action : String
  • The modifier for a command, used to modify its scope.

    See more

    Declaration

    Swift

    public enum Modifier : String
  • Creates a command based on the specified parameters.

    Declaration

    Swift

    public init(action: Action, ruleIdentifiers: Set<RuleIdentifier>, line: Int = 0,
                character: Int? = nil, modifier: Modifier? = nil, trailingComment: String? = nil)

    Parameters

    action

    This command’s action.

    ruleIdentifiers

    The identifiers for the rules associated with this command.

    line

    The line in the source file where this command is defined.

    character

    The character offset within the line in the source file where this command is defined.

    modifier

    This command’s modifier, if any.

    trailingComment

    The comment following this command’s - delimeter, if any.

  • Creates a command based on the specified parameters.

    Declaration

    Swift

    public init?(actionString: String, line: Int, character: Int)

    Parameters

    actionString

    The string in the command’s definition describing its action.

    line

    The line in the source file where this command is defined.

    character

    The character offset within the line in the source file where this command is defined.