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 moreDeclaration
Swift
public enum Action : String -
The modifier for a command, used to modify its scope.
See moreDeclaration
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 range of the command in the line (0-based).
Declaration
Swift
public let range: Range<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, range: Range<Int>? = nil, modifier: Modifier? = nil, trailingComment: String? = nil)Parameters
actionThis command’s action.
ruleIdentifiersThe identifiers for the rules associated with this command.
lineThe line in the source file where this command is defined.
rangeThe range of the command in the line (0-based).
modifierThis command’s modifier, if any.
trailingCommentThe comment following this command’s
-delimiter, if any. -
Creates a command based on the specified parameters.
Declaration
Swift
public init(commandString: String, line: Int, range: Range<Int>)Parameters
commandStringThe whole command string as found in the code.
lineThe line in the source file where this command is defined.
rangeThe range of the command in the line (0-based).
View on GitHub
Install in Dash