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
  • The action (verb) that SwiftLint should perform when interpreting this command.

    Declaration

    Swift

    public let action: Action
  • The identifiers for the rules associated with this command.

    Declaration

    Swift

    public let ruleIdentifiers: Set<RuleIdentifier>
  • The line in the source file where this command is defined.

    Declaration

    Swift

    public let line: Int
  • The character offset within the line in the source file where this command is defined.

    Declaration

    Swift

    public let character: Int?
  • This command’s modifier, if any.

    Declaration

    Swift

    public let modifier: Modifier?
  • 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 - delimiter, 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.