diff --git a/Classes.html b/Classes.html deleted file mode 100644 index 9e8424a80..000000000 --- a/Classes.html +++ /dev/null @@ -1,652 +0,0 @@ - - - - Classes Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Classes

-

The following classes are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Classes/CodeIndentingRewriter.html b/Classes/CodeIndentingRewriter.html deleted file mode 100644 index 61b7bb4c4..000000000 --- a/Classes/CodeIndentingRewriter.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - CodeIndentingRewriter Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CodeIndentingRewriter

-
-
- -
public class CodeIndentingRewriter : SyntaxRewriter
- -
-
-

Rewriter that indents or unindents a syntax piece including comments and nested -AST nodes (e.g. a code block in a code block).

- - -
-
- -
-
-
-
    -
  • -
    - - - - IndentationStyle - -
    -
    -
    -
    -
    -
    -

    Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and -how many of them.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum IndentationStyle
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(style:) - -
    -
    -
    -
    -
    -
    -

    Initializer accepting an indentation style.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(style: IndentationStyle = .indentSpaces(4))
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - style - - -
    -

    Indentation style. The default is indentation by 4 spaces.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override public func visit(_ token: TokenSyntax) -> TokenSyntax
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/CodeIndentingRewriter/IndentationStyle.html b/Classes/CodeIndentingRewriter/IndentationStyle.html deleted file mode 100644 index 3ec611f37..000000000 --- a/Classes/CodeIndentingRewriter/IndentationStyle.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - IndentationStyle Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

IndentationStyle

-
-
- -
public enum IndentationStyle
- -
-
-

Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and -how many of them.

- - -
-
- -
-
-
-
    -
  • -
    - - - - indentSpaces(_:) - -
    -
    -
    -
    -
    -
    -

    Indentation with a number of spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indentSpaces(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - unindentSpaces(_:) - -
    -
    -
    -
    -
    -
    -

    Reverse indentation of a number of spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case unindentSpaces(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - indentTabs(_:) - -
    -
    -
    -
    -
    -
    -

    Indentation with a number of tabs

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indentTabs(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - unindentTabs(_:) - -
    -
    -
    -
    -
    -
    -

    Reverse indentation of a number of tabs.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case unindentTabs(Int)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/CustomRuleTimer.html b/Classes/CustomRuleTimer.html deleted file mode 100644 index b707fe3dc..000000000 --- a/Classes/CustomRuleTimer.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - CustomRuleTimer Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CustomRuleTimer

-
-
- -
public final class CustomRuleTimer
- -
-
-

Utility to measure the time spent in each custom rule.

- - -
-
- -
-
-
-
    -
  • -
    - - - - shared - -
    -
    -
    -
    -
    -
    -

    Singleton.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let shared: CustomRuleTimer
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - activate() - -
    -
    -
    -
    -
    -
    -

    Tell the timer it should record time spent in rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func activate()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - dump() - -
    -
    -
    -
    -
    -
    -

    Return all time spent for each custom rule, keyed by rule ID.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func dump() -> [String : TimeInterval]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/DeclaredIdentifiersTrackingVisitor.html b/Classes/DeclaredIdentifiersTrackingVisitor.html deleted file mode 100644 index 2c56a4c6d..000000000 --- a/Classes/DeclaredIdentifiersTrackingVisitor.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - DeclaredIdentifiersTrackingVisitor Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

DeclaredIdentifiersTrackingVisitor

-
-
- -
open class DeclaredIdentifiersTrackingVisitor<Configuration: RuleConfiguration>:
-        ViolationsSyntaxVisitor<Configuration>
- -
-
-

A specialized ViolationsSyntaxVisitor that tracks declared identifiers per scope while traversing the AST.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Scope - -
    -
    -
    -
    -
    -
    -

    A type that remembers the declared identifiers (in order) up to the current position in the code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public typealias Scope = Stack<Set<String>>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - scope - -
    -
    -
    -
    -
    -
    -

    The hierarchical stack of identifiers declared up to the current position in the code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var scope: Scope
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initializer.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile, scope: Scope = Scope())
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    - - scope - - -
    -

    A (potentially already pre-filled) scope to collect identifiers into.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Indicate whether a given identifier is in scope.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hasSeenDeclaration(for identifier: String) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    An identifier.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: CodeBlockItemListSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: CodeBlockItemListSyntax)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: VariableDeclSyntax)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: GuardStmtSyntax)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/LinterCache.html b/Classes/LinterCache.html deleted file mode 100644 index 91c9faae0..000000000 --- a/Classes/LinterCache.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - LinterCache Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

LinterCache

-
-
- -
public final class LinterCache
- -
-
-

A persisted cache for storing and retrieving linter results.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(configuration: Configuration, fileManager: some LintableFileManager = FileManager.default)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    The SwiftLint configuration for which this cache will be used.

    -
    -
    - - fileManager - - -
    -

    The file manager to use to read lintable file information.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - save() - -
    -
    -
    -
    -
    -
    -

    Persists the cache to disk.

    -
    -

    Throws

    - Throws if the linter cache doesn’t have a location value, if the cache couldn’t be serialized, or if - the contents couldn’t be written to disk. - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func save() throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/RuleRegistry.html b/Classes/RuleRegistry.html deleted file mode 100644 index c6dc68403..000000000 --- a/Classes/RuleRegistry.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - RuleRegistry Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleRegistry

-
-
- -
public final class RuleRegistry
- -
-
-

Container to register and look up SwiftLint rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - shared - -
    -
    -
    -
    -
    -
    -

    Shared rule registry instance.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let shared: RuleRegistry
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - list - -
    -
    -
    -
    -
    -
    -

    Rule list associated with this registry. Lazily created, and -immutable once looked up.

    -
    -

    Note

    - Adding registering more rules after this was first - accessed will not work. - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) lazy var list: RuleList { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - register(rules:) - -
    -
    -
    -
    -
    -
    -

    Register rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func register(rules: [any Rule.Type])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to register.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - rule(forID:) - -
    -
    -
    -
    -
    -
    -

    Look up a rule for a given ID.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func rule(forID id: String) -> (any Rule.Type)?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - id - - -
    -

    The ID for the rule to look up.

    -
    -
    -
    -
    -

    Return Value

    -

    The rule matching the specified ID, if one was found.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/RuleStorage.html b/Classes/RuleStorage.html deleted file mode 100644 index 509ab948e..000000000 --- a/Classes/RuleStorage.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - RuleStorage Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleStorage

-
-
- -
public class RuleStorage : CustomStringConvertible
- -
-
-

A storage mechanism for aggregating the results of CollectingRules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    Creates a RuleStorage with no initial stored data.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/SwiftLintFile.html b/Classes/SwiftLintFile.html deleted file mode 100644 index 8c6dcdff5..000000000 --- a/Classes/SwiftLintFile.html +++ /dev/null @@ -1,890 +0,0 @@ - - - - SwiftLintFile Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintFile

-
-
- -
public final class SwiftLintFile
-
extension SwiftLintFile: Equatable, Hashable
- -
-
-

A unit of Swift source code, either on disk or in memory.

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The underlying SourceKitten file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: File
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - id - -
    -
    -
    -
    -
    -
    -

    The associated unique identifier for this file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let id: UUID
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isTestFile - -
    -
    -
    -
    -
    -
    -

    Whether or not this is a file generated for testing purposes.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var isTestFile: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isVirtual - -
    -
    -
    -
    -
    -
    -

    A file is virtual if it is not backed by a filesystem path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var isVirtual: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(file:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile with a SourceKitten File.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: File)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    A file from SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(path:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile by specifying its path on disk. -Fails if the file does not exist.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init?(path: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - path - - -
    -

    The path to a file on disk. Relative and absolute paths supported.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this -one does not read its contents immediately, but rather traps at runtime when attempting to access its contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init(pathDeferringReading path: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - path - - -
    -

    The path to a file on disk. Relative and absolute paths supported.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(contents:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init(contents: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - contents - - -
    -

    The contents of the file.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - path - -
    -
    -
    -
    -
    -
    -

    The path on disk for this file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var path: String? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - contents - -
    -
    -
    -
    -
    -
    -

    The file’s contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var contents: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - stringView - -
    -
    -
    -
    -
    -
    -

    A string view into the contents of this file optimized for string manipulation operations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var stringView: StringView { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - lines - -
    -
    -
    -
    -
    -
    -

    The parsed lines for this file’s contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var lines: [Line] { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Hashable Conformance -

-
-
-
    -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: SwiftLintFile, rhs: SwiftLintFile) -> Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/ViolationsSyntaxRewriter.html b/Classes/ViolationsSyntaxRewriter.html deleted file mode 100644 index d92bf2ff2..000000000 --- a/Classes/ViolationsSyntaxRewriter.html +++ /dev/null @@ -1,621 +0,0 @@ - - - - ViolationsSyntaxRewriter Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationsSyntaxRewriter

-
-
- -
open class ViolationsSyntaxRewriter<Configuration> : SyntaxRewriter where Configuration : RuleConfiguration
- -
-
-

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

- - -
-
- -
-
-
-
    -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    A rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let configuration: Configuration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file from which the traversed syntax tree stems from.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - locationConverter - -
    -
    -
    -
    -
    -
    -

    A converter of positions in the traversed source file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var locationConverter: SourceLocationConverter { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - disabledRegions - -
    -
    -
    -
    -
    -
    -

    The regions in the traversed file that are disabled by a command.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var disabledRegions: [SourceRange] { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - correctionPositions - -
    -
    -
    -
    -
    -
    -

    Positions in a source file where corrections were applied.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var correctionPositions: [AbsolutePosition]
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initilizer for a ViolationsSyntaxRewriter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitAny(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitAny(_ node: Syntax) -> Syntax?
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Classes/ViolationsSyntaxVisitor.html b/Classes/ViolationsSyntaxVisitor.html deleted file mode 100644 index f2c914255..000000000 --- a/Classes/ViolationsSyntaxVisitor.html +++ /dev/null @@ -1,913 +0,0 @@ - - - - ViolationsSyntaxVisitor Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationsSyntaxVisitor

-
-
- -
open class ViolationsSyntaxVisitor<Configuration> : SyntaxVisitor where Configuration : RuleConfiguration
- -
-
-

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

- - -
-
- -
-
-
-
    -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    A rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let configuration: Configuration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file from which the traversed syntax tree stems from.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - locationConverter - -
    -
    -
    -
    -
    -
    -

    A source location converter associated with the syntax tree being traversed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var locationConverter: SourceLocationConverter { get set }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initializer for a ViolationsSyntaxVisitor.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - violations - -
    -
    -
    -
    -
    -
    -

    Positions in a source file where violations should be reported.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violations: [ReasonedRuleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - violationCorrections - -
    -
    -
    -
    -
    -
    -

    Ranges of violations to be used in rewriting (see SwiftSyntaxCorrectableRule). It is not mandatory to fill -this list while traversing the AST, especially not if the rule is not correctable or provides a custom rewriter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violationCorrections: [ViolationCorrection]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - skippableDeclarations - -
    -
    -
    -
    -
    -
    -

    List of declaration types that shall be skipped while traversing the AST.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    open var skippableDeclarations: [any DeclSyntaxProtocol.Type] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ActorDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ExtensionDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: InitializerDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: SubscriptDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums.html b/Enums.html deleted file mode 100644 index 40089c26b..000000000 --- a/Enums.html +++ /dev/null @@ -1,656 +0,0 @@ - - - - Enumerations Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Enumerations

-

The following enumerations are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Enums/AccessControlLevel.html b/Enums/AccessControlLevel.html deleted file mode 100644 index cc2a53283..000000000 --- a/Enums/AccessControlLevel.html +++ /dev/null @@ -1,703 +0,0 @@ - - - - AccessControlLevel Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AccessControlLevel

-
-
- -
public enum AccessControlLevel : String, CustomStringConvertible
-
extension AccessControlLevel: Comparable
- -
-
-

The accessibility of a Swift source declaration.

- - - -
-
- -
-
-
-
    -
  • -
    - - - - private - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s immediate lexical scope.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `private` = "source.lang.swift.accessibility.private"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - fileprivate - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `fileprivate` = "source.lang.swift.accessibility.fileprivate"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - internal - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `internal` = "source.lang.swift.accessibility.internal"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - package - -
    -
    -
    -
    -
    -
    -

    Accessible by all the modules defined in the same Swift package.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case package = "source.lang.swift.accessibility.package"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - public - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same program.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `public` = "source.lang.swift.accessibility.public"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - open - -
    -
    -
    -
    -
    -
    -

    Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case open = "source.lang.swift.accessibility.open"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(description:) - -
    -
    -
    -
    -
    -
    -

    Initializes an access control level by its Swift source keyword value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init?(description value: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The value used to describe this level in Swift source code.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isPrivate - -
    -
    -
    -
    -
    -
    -

    Returns true if is private or fileprivate

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var isPrivate: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: AccessControlLevel, rhs: AccessControlLevel) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/ExecutableInfo.html b/Enums/ExecutableInfo.html deleted file mode 100644 index 795f88e0c..000000000 --- a/Enums/ExecutableInfo.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - ExecutableInfo Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ExecutableInfo

-
-
- -
public enum ExecutableInfo
- -
-
-

Information about this executable.

- - -
-
- -
-
-
-
    -
  • -
    - - - - buildID - -
    -
    -
    -
    -
    -
    -

    A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let buildID: String?
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/Issue.html b/Enums/Issue.html deleted file mode 100644 index 4160cf5f0..000000000 --- a/Enums/Issue.html +++ /dev/null @@ -1,1160 +0,0 @@ - - - - Issue Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Issue

-
-
- -
public enum Issue : LocalizedError, Equatable
- -
-
-

All possible SwiftLint issues which are printed as warnings by default.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    The configuration didn’t match internal expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidConfiguration(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Issued when an option is deprecated. Suggests an alternative optionally.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case deprecatedConfigurationOption(ruleID: String, key: String, alternative: String? = nil)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Used in configuration parsing when no changes have been applied. Use only internally!

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case nothingApplied(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Rule is listed multiple times in the configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case listedMultipleTime(ruleID: String, times: Int)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    An identifier old has been renamed to new.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case renamedIdentifier(old: String, new: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Some configuration keys are invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidConfigurationKeys(ruleID: String, keys: Set<String>)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalidRuleIDs(_:) - -
    -
    -
    -
    -
    -
    -

    Used rule IDs are invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidRuleIDs(Set<String>)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not present in only_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotPresentInOnlyRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is disabled.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDisabledInDisabledRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is disabled in the parent configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDisabledInParentConfiguration(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not enabled in opt_in_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotEnabledInOptInRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not enabled in parent only_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotEnabledInParentOnlyRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - genericWarning(_:) - -
    -
    -
    -
    -
    -
    -

    A generic warning specified by a string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case genericWarning(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - genericError(_:) - -
    -
    -
    -
    -
    -
    -

    A generic error specified by a string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case genericError(String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A deprecation warning for a rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDeprecated(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The initial configuration file was not found.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case initialFileNotFound(path: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - fileNotFound(path:) - -
    -
    -
    -
    -
    -
    -

    A file at specified path was not found.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotFound(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path is not readable or cannot be opened.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotReadable(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path is not writable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotWritable(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path cannot be indexed by a specific rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indexingError(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    No arguments were provided to compile a file at path within a specific rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case missingCompilerArguments(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Cursor information cannot be extracted from a specific location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case missingCursorInfo(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yamlParsing(_:) - -
    -
    -
    -
    -
    -
    -

    An error that occurred when parsing YAML.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case yamlParsing(String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The baseline file at path is not readable or cannot be opened.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case baselineNotReadable(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Flag to enable warnings for deprecations being printed to the console. Printing is enabled by default.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var printDeprecationWarnings: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - print() - -
    -
    -
    -
    -
    -
    -

    Print the issue to the console.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func print()
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/OptionType.html b/Enums/OptionType.html deleted file mode 100644 index deaa759dd..000000000 --- a/Enums/OptionType.html +++ /dev/null @@ -1,898 +0,0 @@ - - - - OptionType Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

OptionType

-
-
- -
public enum OptionType : Equatable
-
extension OptionType: Documentable
- -
-
-

Type of an option.

- - -
-
- -
-
-
-
    -
  • -
    - - - - empty - -
    -
    -
    -
    -
    -
    -

    An irrelevant option. It will be ignored in documentation serialization.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case empty
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - flag(_:) - -
    -
    -
    -
    -
    -
    -

    A boolean flag.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case flag(Bool)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - string(_:) - -
    -
    -
    -
    -
    -
    -

    A string option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case string(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - symbol(_:) - -
    -
    -
    -
    -
    -
    -

    Like a string option but without quotes in the serialized output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case symbol(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - integer(_:) - -
    -
    -
    -
    -
    -
    -

    An integer option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case integer(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - float(_:) - -
    -
    -
    -
    -
    -
    -

    A floating point number option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case float(Double)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity(_:) - -
    -
    -
    -
    -
    -
    -

    Special option for a ViolationSeverity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case severity(ViolationSeverity)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - list(_:) - -
    -
    -
    -
    -
    -
    -

    A list of options.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case list([OptionType])
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - nested(_:) - -
    -
    -
    -
    -
    -
    -

    An option which is another set of configuration options to be nested in the serialized output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case nested(RuleConfigurationDescription)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Result builder -

-
-
-
    -
  • -
    - - - - =>(_:_:) - -
    -
    -
    -
    -
    -
    -

    Operator enabling an easy way to create a configuration option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func => (key: String, value: OptionType) -> RuleConfigurationOption
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - key - - -
    -

    Name of the option.

    -
    -
    - - value - - -
    -

    Value of the option.

    -
    -
    -
    -
    -

    Return Value

    -

    A configuration option built up by the given data.

    -
    - -
    -
    -
  • -
  • -
    - - - - nest(_:) - -
    -
    -
    -
    -
    -
    -

    Create an option defined by nested configuration description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func nest(@RuleConfigurationDescriptionBuilder _ description: () -> RuleConfigurationDescription) -> OptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - description - - -
    -

    A configuration description buildable by applying the result builder syntax.

    -
    -
    -
    -
    -

    Return Value

    -

    A configuration option with a value being another configuration description.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/RuleIdentifier.html b/Enums/RuleIdentifier.html deleted file mode 100644 index 194bd2d30..000000000 --- a/Enums/RuleIdentifier.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - RuleIdentifier Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleIdentifier

-
-
- -
public enum RuleIdentifier : Hashable, ExpressibleByStringLiteral
- -
-
-

An identifier representing a SwiftLint rule, or all rules.

- - -
-
- -
-
-
-
- - -
- -

Values -

-
-
-
    -
  • -
    - - - - all - -
    -
    -
    -
    -
    -
    -

    Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in -disabling all SwiftLint rules in a given file by adding a // swiftlint:disable all comment at the top of the -file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case all
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - single(identifier:) - -
    -
    -
    -
    -
    -
    -

    Represents a single SwiftLint rule with the specified identifier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case single(identifier: String)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Properties -

-
-
-
    -
  • -
    - - - - stringRepresentation - -
    -
    -
    -
    -
    -
    -

    The spelling of the string for this idenfitier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var stringRepresentation: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Initializers -

-
-
-
    -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleIdentifier by its string representation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ value: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The string representation.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

ExpressibleByStringLiteral Conformance -

-
-
- -
-
-
- -
-
- - - diff --git a/Enums/RuleKind.html b/Enums/RuleKind.html deleted file mode 100644 index 9a2f3ae84..000000000 --- a/Enums/RuleKind.html +++ /dev/null @@ -1,530 +0,0 @@ - - - - RuleKind Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleKind

-
-
- -
public enum RuleKind : String, Codable, Sendable
- -
-
-

All the possible rule kinds (categories).

- - -
-
- -
-
-
-
    -
  • -
    - - - - lint - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate Swift source conventions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case lint
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - idiomatic - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate common practices in the Swift community.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case idiomatic
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - style - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate stylistic choices.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case style
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - metrics - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate magnitudes or measurements of Swift source.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case metrics
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - performance - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate that code patterns with poor performance are avoided.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case performance
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/RuleListError.html b/Enums/RuleListError.html deleted file mode 100644 index dd2e1bbf5..000000000 --- a/Enums/RuleListError.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - RuleListError Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleListError

-
-
- -
public enum RuleListError : Error
- -
-
-

All possible rule list configuration errors.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    The rule list contains more than one configuration for the specified rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case duplicatedConfigurations(rule: any Rule.Type)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Enums/SwiftExpressionKind.html b/Enums/SwiftExpressionKind.html deleted file mode 100644 index 38328d28a..000000000 --- a/Enums/SwiftExpressionKind.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - SwiftExpressionKind Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftExpressionKind

-
-
- -
public enum SwiftExpressionKind : String
- -
-
-

The kind of expression for a contiguous set of Swift source tokens.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Enums/ViolationSeverity.html b/Enums/ViolationSeverity.html deleted file mode 100644 index a6e100889..000000000 --- a/Enums/ViolationSeverity.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - ViolationSeverity Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationSeverity

-
-
- -
public enum ViolationSeverity : String, Comparable, Codable, InlinableOptionType
- -
-
-

The magnitude of a StyleViolation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case warning
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case error
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Comparable -

-
-
-
    -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: ViolationSeverity, rhs: ViolationSeverity) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Extensions.html b/Extensions.html deleted file mode 100644 index 83be51062..000000000 --- a/Extensions.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - Extensions Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Extensions

-

The following extensions are available globally.

- -
-
- -
-
-
- -
-
-
- - -
- -

AcceptableByConfigurationElement conformances -

-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/Array.html b/Extensions/Array.html deleted file mode 100644 index e23f5dd84..000000000 --- a/Extensions/Array.html +++ /dev/null @@ -1,860 +0,0 @@ - - - - Array Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Array

-
-
- -
public extension Array where Element == Example
-
extension Array: AcceptableByConfigurationElement where Element: AcceptableByConfigurationElement
-
public extension Array where Element == SwiftLintSyntaxToken
-
public extension Array where Element == ReasonedRuleViolation
-
public extension Array where Element == any DeclSyntaxProtocol.Type
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Element == Example -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip wrapping in comment tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipWrappingInCommentTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip wrapping in string tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipWrappingInStringTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip multi-byte offset tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipMultiByteOffsetTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip disable command tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipDisableCommandTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Remove all violation markers from the examples.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func removingViolationMarker() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element: AcceptableByConfigurationElement -

-
-
- -
-
-
- - -
- -

Available where Element == SwiftLintSyntaxToken -

-
-
-
    -
  • -
    - - - - kinds - -
    -
    -
    -
    -
    -
    -

    The kinds for these tokens.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var kinds: [SyntaxKind] { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element == ReasonedRuleViolation -

-
-
-
    -
  • -
    - - - - append(_:) - -
    -
    -
    -
    -
    -
    -

    Append a minimal violation for the specified position.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func append(_ position: AbsolutePosition)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - position - - -
    -

    The position for the violation to append.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - append(contentsOf:) - -
    -
    -
    -
    -
    -
    -

    Append minimal violations for the specified positions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func append(contentsOf positions: [AbsolutePosition])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - positions - - -
    -

    The positions for the violations to append.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element == anyDeclSyntaxProtocol.Type -

-
-
-
    -
  • -
    - - - - all - -
    -
    -
    -
    -
    -
    -

    All visitable declaration syntax types.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static let all: `Self`
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - allExcept(_:) - -
    -
    -
    -
    -
    -
    -

    All declarations except for the specified ones.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func allExcept(_ declarations: Element...) -> Array<Element>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - declarations - - -
    -

    The declarations to exclude from all declarations.

    -
    -
    -
    -
    -

    Return Value

    -

    All declarations except for the specified ones.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Extensions/Bool.html b/Extensions/Bool.html deleted file mode 100644 index 447de6b67..000000000 --- a/Extensions/Bool.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Bool Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Bool

-
-
- -
extension Bool: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/Double.html b/Extensions/Double.html deleted file mode 100644 index a69d97644..000000000 --- a/Extensions/Double.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Double Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Double

-
-
- -
extension Double: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/Int.html b/Extensions/Int.html deleted file mode 100644 index b9dbd552a..000000000 --- a/Extensions/Int.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Int Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Int

-
-
- -
extension Int: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/Optional.html b/Extensions/Optional.html deleted file mode 100644 index 14ba0b6f8..000000000 --- a/Extensions/Optional.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Optional Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Optional

-
-
- -
extension Optional: AcceptableByConfigurationElement where Wrapped: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Wrapped: AcceptableByConfigurationElement -

-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/Set.html b/Extensions/Set.html deleted file mode 100644 index 9fb12858e..000000000 --- a/Extensions/Set.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Set Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Set

-
-
- -
extension Set: AcceptableByConfigurationElement where Element: AcceptableByConfigurationElement & Comparable
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Element: AcceptableByConfigurationElement & Comparable -

-
-
- -
-
-
- -
-
- - - diff --git a/Extensions/String.html b/Extensions/String.html deleted file mode 100644 index e809bba93..000000000 --- a/Extensions/String.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - String Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

String

-
-
- -
extension String: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Functions.html b/Functions.html deleted file mode 100644 index ff3338341..000000000 --- a/Functions.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - Functions Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Functions

-

The following functions are available globally.

- -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any -known reporters.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func reporterFrom(identifier: String?) -> any Reporter.Type
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    The identifier corresponding to the reporter.

    -
    -
    -
    -
    -

    Return Value

    -

    The reporter type.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Global Variables.html b/Global Variables.html deleted file mode 100644 index 798997968..000000000 --- a/Global Variables.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - Global Variables Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Global Variables

-

The following global variables are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - reportersList - -
    -
    -
    -
    -
    -
    -

    The reporters list containing all the reporters built into SwiftLint.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reportersList: [any Reporter.Type]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - coreRules - -
    -
    -
    -
    -
    -
    -

    The rule list containing all available rules built into SwiftLintCore.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let coreRules: [any Rule.Type]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Guides.html b/Guides.html deleted file mode 100644 index 5bfea6146..000000000 --- a/Guides.html +++ /dev/null @@ -1,2521 +0,0 @@ - - - - Guides Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Guides

-

The following guides are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Protocols.html b/Protocols.html deleted file mode 100644 index f7a675132..000000000 --- a/Protocols.html +++ /dev/null @@ -1,952 +0,0 @@ - - - - Protocols Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Protocols

-

The following protocols are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - Documentable - -
    -
    -
    -
    -
    -
    -

    A type that can be converted into a human-readable representation.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Documentable
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Property wrapper -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Type of an object that can be used as a configuration element.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - InlinableOptionType - -
    -
    -
    -
    -
    -
    -

    An option type that can appear inlined into its using configuration.

    - -

    The ConfigurationElement must opt into this behavior. In this case, the option does not have a key. This is -almost exclusively useful for common RuleConfigurations that are used in many other rules as child -configurations.

    -
    -

    Warning

    -

    A type conforming to this protocol is assumed to throw an issue in its apply method only when it’s -absolutely clear that there is an error in the YAML configuration passed in. Since it may be used in a nested -context and doesn’t know about the outer configuration, it’s not always clear if a certain key-value is really -unacceptable.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol InlinableOptionType : AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ASTRule - -
    -
    -
    -
    -
    -
    -

    A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s -structure, validating the rule recursively in nested source bodies.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol ASTRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Interface providing access to a cache description.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CacheDescriptionProvider
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - AnyCollectingRule - -
    -
    -
    -
    -
    -
    -

    Type-erased protocol used to check whether a rule is collectable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AnyCollectingRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CollectingRule - -
    -
    -
    -
    -
    -
    -

    A rule that requires knowledge of all other files being linted.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CollectingRule : AnyCollectingRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Reporter - -
    -
    -
    -
    -
    -
    -

    An interface for reporting violations as strings.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Reporter : CustomStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Rule - -
    -
    -
    -
    -
    -
    -

    An executable value that can identify issues (violations) in Swift source code.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - OptInRule - -
    -
    -
    -
    -
    -
    -

    A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol OptInRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CorrectableRule - -
    -
    -
    -
    -
    -
    -

    A rule that can correct violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CorrectableRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with -updated content.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SubstitutionCorrectableRule : CorrectableRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SourceKitFreeRule - -
    -
    -
    -
    -
    -
    -

    A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SourceKitFreeRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - AnalyzerRule - -
    -
    -
    -
    -
    -
    -

    A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like -static analysis than syntactic checks.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AnalyzerRule : OptInRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleConfiguration - -
    -
    -
    -
    -
    -
    -

    A configuration value for a rule to allow users to modify its behavior.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol RuleConfiguration : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A configuration for a rule that allows to configure at least the severity.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SeverityBasedRuleConfiguration : RuleConfiguration
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SwiftSyntaxCorrectableRule : CorrectableRule, SwiftSyntaxRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftSyntaxRule - -
    -
    -
    -
    -
    -
    -

    A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SwiftSyntaxRule : SourceKitFreeRule
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/ASTRule.html b/Protocols/ASTRule.html deleted file mode 100644 index 2bed74d41..000000000 --- a/Protocols/ASTRule.html +++ /dev/null @@ -1,644 +0,0 @@ - - - - ASTRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ASTRule

-
-
- -
public protocol ASTRule : Rule
- -
-
-

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s -structure, validating the rule recursively in nested source bodies.

- - -
-
- -
-
-
-
    -
  • -
    - - - - KindType - -
    -
    -
    -
    -
    -
    -

    The kind of token being recursed over.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype KindType : RawRepresentable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, kind: KindType, dictionary: SourceKittenDictionary) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - kind - - -
    -

    The kind of token being recursed over.

    -
    -
    - - dictionary - - -
    -

    The dictionary for an AST subset to validate.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - kind(from:) - -
    -
    -
    -
    -
    -
    -

    Get the kind from the specified dictionary.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func kind(from dictionary: SourceKittenDictionary) -> KindType?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - dictionary - - -
    -

    The SourceKittenDictionary representing the source structure from which to extract the - kind.

    -
    -
    -
    -
    -

    Return Value

    -

    The kind from the specified dictionary, if one was found.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:dictionary:) - - - Extension method - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, dictionary: SourceKittenDictionary) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - dictionary - - -
    -

    The dictionary for an AST subset to validate.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/AcceptableByConfigurationElement.html b/Protocols/AcceptableByConfigurationElement.html deleted file mode 100644 index 39f08007d..000000000 --- a/Protocols/AcceptableByConfigurationElement.html +++ /dev/null @@ -1,591 +0,0 @@ - - - - AcceptableByConfigurationElement Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AcceptableByConfigurationElement

-
-
- -
public protocol AcceptableByConfigurationElement
- -
-
-

Type of an object that can be used as a configuration element.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Initializer taking a value from a configuration to create an element of Self.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(fromAny value: Any, context ruleID: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value from a configuration.

    -
    -
    - - ruleID - - -
    -

    The rule’s identifier in which context the configuration parsing runs.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - asOption() - -
    -
    -
    -
    -
    -
    -

    Make the object an option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asOption() -> OptionType
    - -
    -
    -
    -

    Return Value

    -

    Option representing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - asDescription(with:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Make the object a description.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asDescription(with key: String) -> RuleConfigurationDescription
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - key - - -
    -

    Name of the option to be put into the description.

    -
    -
    -
    -
    -

    Return Value

    -

    Configuration description of this object.

    -
    - -
    -
    -
  • -
  • -
    - - - - apply(_:ruleID:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Update the object.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func apply(_ value: Any?, ruleID: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    New underlying data for the object.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/AnalyzerRule.html b/Protocols/AnalyzerRule.html deleted file mode 100644 index a883e92e9..000000000 --- a/Protocols/AnalyzerRule.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - AnalyzerRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AnalyzerRule

-
-
- -
public protocol AnalyzerRule : OptInRule
- -
-
-

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like -static analysis than syntactic checks.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Protocols/CacheDescriptionProvider.html b/Protocols/CacheDescriptionProvider.html deleted file mode 100644 index a6160966c..000000000 --- a/Protocols/CacheDescriptionProvider.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - CacheDescriptionProvider Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CacheDescriptionProvider

-
-
- -
public protocol CacheDescriptionProvider
- -
-
-

Interface providing access to a cache description.

- - -
-
- -
-
-
-
    -
  • -
    - - - - cacheDescription - -
    -
    -
    -
    -
    -
    -

    The cache description which will be used to determine if a previous -cached value is still valid given the new cache value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/CollectingRule.html b/Protocols/CollectingRule.html deleted file mode 100644 index 7964aa8e9..000000000 --- a/Protocols/CollectingRule.html +++ /dev/null @@ -1,815 +0,0 @@ - - - - CollectingRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CollectingRule

-
-
- -
public protocol CollectingRule : AnyCollectingRule
- -
-
-

A rule that requires knowledge of all other files being linted.

- - -
-
- -
-
-
-
    -
  • -
    - - - - FileInfo - -
    -
    -
    -
    -
    -
    -

    The kind of information to collect for each file being linted for this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype FileInfo
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, compilerArguments: [String]) -> FileInfo
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    The collected file information.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:) - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile) -> FileInfo
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    -
    -
    -

    Return Value

    -

    The collected file information.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:collectedInfo:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile: FileInfo],
    -              compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - collectedInfo - - -
    -

    All collected info for all files.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile : FileInfo]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - collectedInfo - - -
    -

    All collected info for all files.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:into:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:using:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/CorrectableRule.html b/Protocols/CorrectableRule.html deleted file mode 100644 index 8c0a425cf..000000000 --- a/Protocols/CorrectableRule.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - CorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CorrectableRule

-
-
- -
public protocol CorrectableRule : Rule
- -
-
-

A rule that can correct violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - correct(file:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Attempts to correct the violations to this rule in the specified file.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

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

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to correct violations.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:) - -
    -
    -
    -
    -
    -
    -

    Attempts to correct the violations to this rule in the specified file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

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

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to correct violations.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:using:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    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, using storage: RuleStorage, compilerArguments: [String]) -> [Correction]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/Documentable.html b/Protocols/Documentable.html deleted file mode 100644 index dd2fc66e8..000000000 --- a/Protocols/Documentable.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - Documentable Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Documentable

-
-
- -
public protocol Documentable
- -
-
-

A type that can be converted into a human-readable representation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    -

    Convert an object to Markdown.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func markdown() -> String
    - -
    -
    -
    -

    Return Value

    -

    A Markdown string describing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    -

    Convert an object to a single line string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func oneLiner() -> String
    - -
    -
    -
    -

    Return Value

    -

    A “one liner” describing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    -

    Indicate if the item has some content that is useful to document.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    -

    Convert an object to YAML as used in .swiftlint.yml.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func yaml() -> String
    - -
    -
    -
    -

    Return Value

    -

    A YAML snippet that can be used in configuration files.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/Reporter.html b/Protocols/Reporter.html deleted file mode 100644 index d8df8311b..000000000 --- a/Protocols/Reporter.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - Reporter Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Reporter

-
-
- -
public protocol Reporter : CustomStringConvertible
- -
-
-

An interface for reporting violations as strings.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The unique identifier for this reporter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var identifier: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isRealtime - -
    -
    -
    -
    -
    -
    -

    Whether or not this reporter can output incrementally as violations are found or if all violations must be -collected before generating the report.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var isRealtime: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A more detailed description of the reporter’s output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    For CustomStringConvertible conformance.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - generateReport(_:) - -
    -
    -
    -
    -
    -
    -

    Return a string with the report for the specified violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func generateReport(_ violations: [StyleViolation]) -> String
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations to report.

    -
    -
    -
    -
    -

    Return Value

    -

    The report.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/Rule.html b/Protocols/Rule.html deleted file mode 100644 index ccb68aad9..000000000 --- a/Protocols/Rule.html +++ /dev/null @@ -1,1093 +0,0 @@ - - - - Rule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Rule

-
-
- -
public protocol Rule
- -
-
-

An executable value that can identify issues (violations) in Swift source code.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Description - -
    -
    -
    -
    -
    -
    -

    The rule’s description type.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype Description : Documentable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ConfigurationType - -
    -
    -
    -
    -
    -
    -

    The type of the configuration used to configure this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype ConfigurationType : RuleConfiguration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A verbose description of many of this rule’s properties.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var description: RuleDescription { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configurationDescription - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    A description of how this rule has been configured to run. It can be built using the annotated result builder.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @RuleConfigurationDescriptionBuilder
    -var configurationDescription: Description { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    This rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var configuration: ConfigurationType { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - shouldLintEmptyFiles - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Whether this rule should be used on empty files. Defaults to false.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var shouldLintEmptyFiles: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    A default initializer for rules. All rules need to be trivially initializable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(configuration:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Creates a rule by applying its configuration.

    -
    -

    Throws

    -

    Throws if the configuration didn’t match the expected format.

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(configuration: Any) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - configuration - - -
    -

    The untyped configuration value to apply.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and returns any violations to the rule’s expectations.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and returns any violations to the rule’s expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - isEqualTo(_:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Whether or not the specified rule is equivalent to the current rule.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func isEqualTo(_ rule: any Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule value to compare against.

    -
    -
    -
    -
    -

    Return Value

    -

    Whether or not the specified rule is equivalent to the current rule.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:into:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

    -
    -

    Note

    -

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

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    - - storage - - -
    -

    The storage object where collected info should be saved.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:using:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    -
    -

    Note

    -

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

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - cacheDescription - - - Extension method - -
    -
    -
    -
    -
    -
    -

    The cache description which will be used to determine if a previous -cached value is still valid given the new cache value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - identifier - - - Extension method - -
    -
    -
    -
    -
    -
    -

    The rule’s unique identifier which is the same as Rule.description.identifier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var identifier: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/RuleConfiguration.html b/Protocols/RuleConfiguration.html deleted file mode 100644 index b3ded1bbb..000000000 --- a/Protocols/RuleConfiguration.html +++ /dev/null @@ -1,535 +0,0 @@ - - - - RuleConfiguration Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfiguration

-
-
- -
public protocol RuleConfiguration : Equatable
- -
-
-

A configuration value for a rule to allow users to modify its behavior.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Parent - -
    -
    -
    -
    -
    -
    -

    The type of the rule that’s using this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - parameterDescription - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    A description for this configuration’s parameters. It can be built using the annotated result builder.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @RuleConfigurationDescriptionBuilder
    -var parameterDescription: RuleConfigurationDescription? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    -

    Apply an untyped configuration to the current value.

    -
    -

    Throws

    -

    Throws if the configuration is not in the expected format.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func apply(configuration: Any) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - configuration - - -
    -

    The untyped configuration value to apply.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - supportedKeys - - - Extension method - -
    -
    -
    -
    -
    -
    -

    All keys supported by this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var supportedKeys: Set<String> { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/SeverityBasedRuleConfiguration.html b/Protocols/SeverityBasedRuleConfiguration.html deleted file mode 100644 index 7ffcf2d52..000000000 --- a/Protocols/SeverityBasedRuleConfiguration.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - SeverityBasedRuleConfiguration Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityBasedRuleConfiguration

-
-
- -
public protocol SeverityBasedRuleConfiguration : RuleConfiguration
- -
-
-

A configuration for a rule that allows to configure at least the severity.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Protocols/SubstitutionCorrectableRule.html b/Protocols/SubstitutionCorrectableRule.html deleted file mode 100644 index c6b54d70f..000000000 --- a/Protocols/SubstitutionCorrectableRule.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - SubstitutionCorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SubstitutionCorrectableRule

-
-
- -
public protocol SubstitutionCorrectableRule : CorrectableRule
- -
-
-

A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with -updated content.

- - -
-
- -
-
-
-
    -
  • -
    - - - - violationRanges(in:) - -
    -
    -
    -
    -
    -
    -

    Returns the NSString-based NSRanges to be replaced in the specified file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func violationRanges(in file: SwiftLintFile) -> [NSRange]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file in which to find ranges of violations for this rule.

    -
    -
    -
    -
    -

    Return Value

    -

    The NSString-based NSRanges to be replaced in the specified file.

    -
    - -
    -
    -
  • -
  • -
    - - - - substitution(for:in:) - -
    -
    -
    -
    -
    -
    -

    Returns the substitution to apply for the given range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func substitution(for violationRange: NSRange, in file: SwiftLintFile) -> (NSRange, String)?
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - violationRange - - -
    -

    The NSString-based NSRange of the violation that should be replaced.

    -
    -
    - - file - - -
    -

    The file in which the violation should be replaced.

    -
    -
    -
    -
    -

    Return Value

    -

    The range of the correction and its contents, if one could be computed.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func correct(file: SwiftLintFile) -> [Correction]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Protocols/SwiftSyntaxCorrectableRule.html b/Protocols/SwiftSyntaxCorrectableRule.html deleted file mode 100644 index 4e4ff2826..000000000 --- a/Protocols/SwiftSyntaxCorrectableRule.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - SwiftSyntaxCorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftSyntaxCorrectableRule

-
-
- -
public protocol SwiftSyntaxCorrectableRule : CorrectableRule, SwiftSyntaxRule
- -
-
-

A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Protocols/SwiftSyntaxRule.html b/Protocols/SwiftSyntaxRule.html deleted file mode 100644 index 5b6892f68..000000000 --- a/Protocols/SwiftSyntaxRule.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - SwiftSyntaxRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftSyntaxRule

-
-
- -
public protocol SwiftSyntaxRule : SourceKitFreeRule
- -
-
-

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

- - -
-
- -
-
-
-
    -
  • -
    - - - - makeVisitor(file:) - -
    -
    -
    -
    -
    -
    -

    Produce a ViolationsSyntaxVisitor for the given file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor<ConfigurationType>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to produce the visitor.

    -
    -
    -
    -
    -

    Return Value

    -

    A ViolationsSyntaxVisitor for the given file.

    -
    - -
    -
    -
  • -
  • -
    - - - - makeViolation(file:violation:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Produce a violation for the given file and absolute position.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func makeViolation(file: SwiftLintFile, violation: ReasonedRuleViolation) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to produce the violation.

    -
    -
    - - violation - - -
    -

    A violation in the file.

    -
    -
    -
    -
    -

    Return Value

    -

    A violation for the given file and absolute position.

    -
    - -
    -
    -
  • -
  • -
    - - - - preprocess(file:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Gives a chance for the rule to do some pre-processing on the syntax tree. -One typical example is using SwiftOperators to “fold” the tree, resolving operators precedence. -This can also be used to skip validation in a given file. -By default, it just returns the file’s syntaxTree.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func preprocess(file: SwiftLintFile) -> SourceFileSyntax?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file to run pre-processing on.

    -
    -
    -
    -
    -

    Return Value

    -

    The tree that will be used to check for violations. If nil, this rule will return no violations.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Rules.html b/Rules.html deleted file mode 100644 index c6303462c..000000000 --- a/Rules.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - Rules Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Rules

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Structs.html b/Structs.html deleted file mode 100644 index 4304abfd9..000000000 --- a/Structs.html +++ /dev/null @@ -1,1404 +0,0 @@ - - - - Structures Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Structures

-

The following structures are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - RuleListDocumentation - -
    -
    -
    -
    -
    -
    -

    User-facing documentation for a SwiftLint RuleList.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleListDocumentation
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Stack - -
    -
    -
    -
    -
    -
    -

    A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Stack<Element>
    -
    extension Stack: CustomDebugStringConvertible where Element: CustomDebugStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Baseline - -
    -
    -
    -
    -
    -
    -

    A set of violations that can be used to filter newly detected violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Baseline : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which -case it’s active.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct ChildOptionSeverityConfiguration<Parent> : RuleConfiguration, AcceptableByConfigurationElement where Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Command - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Command : Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Configuration - -
    -
    -
    -
    -
    -
    -

    The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Configuration
    -
    extension Configuration: Hashable
    -
    extension Configuration: CustomStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Correction - -
    -
    -
    -
    -
    -
    -

    A value describing a SwiftLint violation that was corrected.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Correction : Equatable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Example - -
    -
    -
    -
    -
    -
    -

    Captures code and context information for an example of a triggering or -non-triggering style

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Example : Sendable
    -
    extension Example: Hashable
    -
    extension Example: Comparable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Linter - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Linter
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CollectedLinter - -
    -
    -
    -
    -
    -
    -

    Represents a file that can compute style violations and corrections for a list of rules.

    - -

    A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct CollectedLinter
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Location - -
    -
    -
    -
    -
    -
    -

    The placement of a segment of Swift in a collection of source files.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Location : CustomStringConvertible, Comparable, Codable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Region - -
    -
    -
    -
    -
    -
    -

    A contiguous region of Swift source code.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Region : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Description of a rule configuration.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleConfigurationDescription : Equatable
    -
    extension RuleConfigurationDescription: Documentable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A single option of a RuleConfigurationDescription.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleConfigurationOption : Equatable
    -
    extension RuleConfigurationOption: Documentable
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Result builder -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    A result builder creating configuration descriptions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @resultBuilder
    -public struct RuleConfigurationDescriptionBuilder
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Property wrapper -

-
-
-
    -
  • -
    - - - - ConfigurationElement - -
    -
    -
    -
    -
    -
    -

    A single parameter of a rule configuration.

    - -

    Apply it to a simple (e.g. boolean) property like

    -
    @ConfigurationElement
    -var property = true
    -
    - -

    to add a (boolean) option to a configuration. The name of the option will be inferred from the name of the property. -In this case, it’s just property. CamelCase names will translated into snake_case, i.e. myOption is going to be -translated into my_option in the .swiftlint.yml configuration file.

    - -

    This mechanism may be overwritten with an explicitly set key:

    -
    @ConfigurationElement(key: "foo_bar")
    -var property = true
    -
    - -

    If the wrapped element is an InlinableOptionType, there are three ways to represent it in the documentation:

    - -
      -
    1. It can be inlined into the parent configuration. For that, add the parameter inline: true. E.g. -swift -@ConfigurationElement(inline: true) -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will be documented as a linear list: - -warning: 1 -error: 2 -
    2. -
    3. It can be represented as a separate nested configuration. In this case, it must not have set the inline flag to -true. E.g. -swift -@ConfigurationElement -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will have a nested configuration section: - -levels: warning: 1 - error: 2 -
    4. -
    5. As mentioned in the beginning, the implict key inference meachnism can be overruled by specifying a key as in: -swift -@ConfigurationElement(key: "foo") -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -It will appear in the documentation as: - -foo: warning: 1 - error: 2 -
    6. -
    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @propertyWrapper
    -public struct ConfigurationElement<T> : Equatable where T : Equatable, T : AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SeverityConfiguration - -
    -
    -
    -
    -
    -
    -

    A rule configuration that allows specifying the desired severity level for violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SeverityConfiguration<Parent> : SeverityBasedRuleConfiguration, InlinableOptionType where Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleDescription - -
    -
    -
    -
    -
    -
    -

    A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleDescription : Equatable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleList - -
    -
    -
    -
    -
    -
    -

    A list of available SwiftLint rules.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleList
    -
    extension RuleList: Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleParameter - -
    -
    -
    -
    -
    -
    -

    A configuration parameter for rules.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleParameter<T> : Equatable where T : Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - StyleViolation - -
    -
    -
    -
    -
    -
    -

    A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct StyleViolation : CustomStringConvertible, Codable, Hashable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftLintSyntaxMap - -
    -
    -
    -
    -
    -
    -

    Represents a Swift file’s syntax information.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftLintSyntaxMap
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftLintSyntaxToken - -
    -
    -
    -
    -
    -
    -

    A SwiftLint-aware Swift syntax token.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftLintSyntaxToken
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftVersion - -
    -
    -
    -
    -
    -
    -

    A value describing the version of the Swift compiler.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftVersion : RawRepresentable, Codable, Comparable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Version - -
    -
    -
    -
    -
    -
    -

    A type describing the SwiftLint version.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Version
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

YamlParser -

-
-
- -
-
-
- -
-
- - - diff --git a/Structs/Baseline.html b/Structs/Baseline.html deleted file mode 100644 index 159ac9f85..000000000 --- a/Structs/Baseline.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - Baseline Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Baseline

-
-
- -
public struct Baseline : Equatable
- -
-
-

A set of violations that can be used to filter newly detected violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - violations - -
    -
    -
    -
    -
    -
    -

    The stored violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violations: [StyleViolation] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(fromPath:) - -
    -
    -
    -
    -
    -
    -

    Creates a Baseline from a saved file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(fromPath path: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - fromPath - - -
    -

    The path to read from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(violations:) - -
    -
    -
    -
    -
    -
    -

    Creates a Baseline from a list of violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(violations: [StyleViolation])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations for the baseline.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - write(toPath:) - -
    -
    -
    -
    -
    -
    -

    Writes a Baseline to disk in JSON format.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func write(toPath path: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - toPath - - -
    -

    The path to write to.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - filter(_:) - -
    -
    -
    -
    -
    -
    -

    Filters out violations that are present in the Baseline.

    - -

    Assumes that all violations are from the same file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func filter(_ violations: [StyleViolation]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations to filter.

    -
    -
    -
    -
    -

    Return Value

    -

    The new violations.

    -
    - -
    -
    -
  • -
  • -
    - - - - compare(_:) - -
    -
    -
    -
    -
    -
    -

    Returns the violations that are present in another Baseline, but not in this one.

    - -

    The violations are filtered using the same algorithm as the filter method above.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func compare(_ otherBaseline: Baseline) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - otherBaseline - - -
    -

    The other Baseline.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/ChildOptionSeverityConfiguration.html b/Structs/ChildOptionSeverityConfiguration.html deleted file mode 100644 index 81c78cb05..000000000 --- a/Structs/ChildOptionSeverityConfiguration.html +++ /dev/null @@ -1,560 +0,0 @@ - - - - ChildOptionSeverityConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ChildOptionSeverityConfiguration

-
-
- -
public struct ChildOptionSeverityConfiguration<Parent> : RuleConfiguration, AcceptableByConfigurationElement where Parent : Rule
- -
-
-

A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which -case it’s active.

- - -
-
- -
-
-
-
    -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Configuration with a warning severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var error: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Configuration with an error severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var warning: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - off - -
    -
    -
    -
    -
    -
    -

    Configuration disabling an option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var off: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The ChildOptionSeverityConfiguration mapped to a usually used ViolationSeverity. It’s nil if the option -is set to off.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var severity: ViolationSeverity? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - asOption() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func asOption() -> OptionType
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/CollectedLinter.html b/Structs/CollectedLinter.html deleted file mode 100644 index e18139ac5..000000000 --- a/Structs/CollectedLinter.html +++ /dev/null @@ -1,633 +0,0 @@ - - - - CollectedLinter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CollectedLinter

-
-
- -
public struct CollectedLinter
- -
-
-

Represents a file that can compute style violations and corrections for a list of rules.

- -

A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file to lint with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Computes or retrieves style violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func styleViolations(using storage: RuleStorage) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations found by this linter.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Computes or retrieves style violations and the time spent executing each rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func styleViolationsAndRuleTimes(using storage: RuleStorage)
    -    -> ([StyleViolation], [(id: String, time: Double)])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations found by this linter, and the time spent executing each rule.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(using:) - -
    -
    -
    -
    -
    -
    -

    Applies corrections for all rules to this file, returning performed corrections.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func correct(using storage: RuleStorage) -> [Correction]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Formats the file associated with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func format(useTabs: Bool, indentWidth: Int)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - useTabs - - -
    -

    Should the file be formatted using tabs?

    -
    -
    - - indentWidth - - -
    -

    How many spaces should be used per indentation level.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Command.html b/Structs/Command.html deleted file mode 100644 index 6e988e151..000000000 --- a/Structs/Command.html +++ /dev/null @@ -1,777 +0,0 @@ - - - - Command Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Command

-
-
- -
public struct Command : Equatable
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - Action - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum Action : String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Modifier - -
    -
    -
    -
    -
    -
    -

    The modifier for a command, used to modify its scope.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum Modifier : String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - action - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let action: Action
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleIdentifiers - -
    -
    -
    -
    -
    -
    -

    The identifiers for the rules associated with this command.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleIdentifiers: Set<RuleIdentifier>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let line: Int
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - character - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let character: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - modifier - -
    -
    -
    -
    -
    -
    -

    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.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Command/Action.html b/Structs/Command/Action.html deleted file mode 100644 index a4e0d2532..000000000 --- a/Structs/Command/Action.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - Action Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Action

-
-
- -
public enum Action : String
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - enable - -
    -
    -
    -
    -
    -
    -

    The rule(s) associated with this command should be enabled by the SwiftLint engine.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case enable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - disable - -
    -
    -
    -
    -
    -
    -

    The rule(s) associated with this command should be disabled by the SwiftLint engine.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case disable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalid - -
    -
    -
    -
    -
    -
    -

    The action string was invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalid
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Command/Modifier.html b/Structs/Command/Modifier.html deleted file mode 100644 index f21fc5a9b..000000000 --- a/Structs/Command/Modifier.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - Modifier Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Modifier

-
-
- -
public enum Modifier : String
- -
-
-

The modifier for a command, used to modify its scope.

- - -
-
- -
-
-
-
    -
  • -
    - - - - previous - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the line preceding its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case previous
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - this - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the same line as its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case this
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - next - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the line following its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case next
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalid - -
    -
    -
    -
    -
    -
    -

    The modifier string was invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalid
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Configuration.html b/Structs/Configuration.html deleted file mode 100644 index 502be44cb..000000000 --- a/Structs/Configuration.html +++ /dev/null @@ -1,1087 +0,0 @@ - - - - Configuration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Configuration

-
-
- -
public struct Configuration
-
extension Configuration: Hashable
-
extension Configuration: CustomStringConvertible
- -
-
-

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

- - -
-
- -
-
-
-
- - -
- -

Properties: Static -

-
-
-
    -
  • -
    - - - - default - -
    -
    -
    -
    -
    -
    -

    The default Configuration resulting from an empty configuration file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var `default`: Configuration { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - defaultFileName - -
    -
    -
    -
    -
    -
    -

    The default file name to look for user-defined configurations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let defaultFileName: String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public Instance -

-
-
-
    -
  • -
    - - - - includedPaths - -
    -
    -
    -
    -
    -
    -

    The paths that should be included when linting

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var includedPaths: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excludedPaths - -
    -
    -
    -
    -
    -
    -

    The paths that should be excluded when linting

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var excludedPaths: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - indentation - -
    -
    -
    -
    -
    -
    -

    The style to use when indenting Swift source code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let indentation: IndentationStyle
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warningThreshold - -
    -
    -
    -
    -
    -
    -

    The threshold for the number of warnings to tolerate before treating the lint as having failed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let warningThreshold: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reporter - -
    -
    -
    -
    -
    -
    -

    The identifier for the Reporter to use to report style violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reporter: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - cachePath - -
    -
    -
    -
    -
    -
    -

    The location of the persisted cache to use with this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let cachePath: String?
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let allowZeroLintableFiles: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - strict - -
    -
    -
    -
    -
    -
    -

    Treat warnings as errors

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let strict: Bool
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    This value is true iff the --config parameter was used to specify (a) configuration file(s) -In particular, this means that the value is also true if the --config parameter -was used to explicitly specify the default .swiftlint.yml as the configuration file

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var basedOnCustomConfigurationFiles: Bool { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public Computed -

-
-
-
    -
  • -
    - - - - rules - -
    -
    -
    -
    -
    -
    -

    All rules enabled in this configuration

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rules: [any Rule] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - rootDirectory - -
    -
    -
    -
    -
    -
    -

    The root directory is the directory that included & excluded paths relate to. -By default, the root directory is the current working directory, -but during some merging algorithms it may be used differently. -The rootDirectory also serves as the stopping point when searching for nested configs along the file hierarchy.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rootDirectory: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - rulesMode - -
    -
    -
    -
    -
    -
    -

    The rules mode used for this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rulesMode: RulesMode { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Creates a Configuration with convenience parameters.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(
    -    configurationFiles: [String], // No default value here to avoid ambiguous Configuration() initializer
    -    enableAllRules: Bool = false,
    -    cachePath: String? = nil,
    -    ignoreParentAndChildConfigs: Bool = false,
    -    mockedNetworkResults: [String: String] = [:],
    -    useDefaultConfigOnFailure: Bool? = nil // swiftlint:disable:this discouraged_optional_boolean
    -)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - configurationFiles - - -
    -

    The path on disk to one or multiple configuration files. If this array - is empty, the default .swiftlint.yml file will be used.

    -
    -
    - - enableAllRules - - -
    -

    Enable all available rules.

    -
    -
    - - cachePath - - -
    -

    The location of the persisted cache to use whith this configuration.

    -
    -
    - - ignoreParentAndChildConfigs - - -
    -

    If true, child and parent config references will be ignored.

    -
    -
    - - mockedNetworkResults - - -
    -

    For testing purposes only. Instead of loading the specified urls, - the mocked value will be used. Example: [“http://mock.com”: “content”]

    -
    -
    - - useDefaultConfigOnFailure - - -
    -

    If this value is specified, it will override the normal behavior. - This is only intended for tests checking whether invalid configs fail.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Hashable -

-
-
-
    -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: Configuration, rhs: Configuration) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

CustomStringConvertible -

-
-
-
    -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/ConfigurationElement.html b/Structs/ConfigurationElement.html deleted file mode 100644 index 66b9aa4f2..000000000 --- a/Structs/ConfigurationElement.html +++ /dev/null @@ -1,876 +0,0 @@ - - - - ConfigurationElement Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ConfigurationElement

-
-
- -
@propertyWrapper
-public struct ConfigurationElement<T> : Equatable where T : Equatable, T : AcceptableByConfigurationElement
- -
-
-

A single parameter of a rule configuration.

- -

Apply it to a simple (e.g. boolean) property like

-
@ConfigurationElement
-var property = true
-
- -

to add a (boolean) option to a configuration. The name of the option will be inferred from the name of the property. -In this case, it’s just property. CamelCase names will translated into snake_case, i.e. myOption is going to be -translated into my_option in the .swiftlint.yml configuration file.

- -

This mechanism may be overwritten with an explicitly set key:

-
@ConfigurationElement(key: "foo_bar")
-var property = true
-
- -

If the wrapped element is an InlinableOptionType, there are three ways to represent it in the documentation:

- -
    -
  1. It can be inlined into the parent configuration. For that, add the parameter inline: true. E.g. -swift -@ConfigurationElement(inline: true) -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will be documented as a linear list: - -warning: 1 -error: 2 -
  2. -
  3. It can be represented as a separate nested configuration. In this case, it must not have set the inline flag to -true. E.g. -swift -@ConfigurationElement -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will have a nested configuration section: - -levels: warning: 1 - error: 2 -
  4. -
  5. As mentioned in the beginning, the implict key inference meachnism can be overruled by specifying a key as in: -swift -@ConfigurationElement(key: "foo") -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -It will appear in the documentation as: - -foo: warning: 1 - error: 2 -
  6. -
- - -
-
- -
-
-
-
    -
  • -
    - - - - DeprecationNotice - -
    -
    -
    -
    -
    -
    -

    A deprecation notice.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum DeprecationNotice
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - wrappedValue - -
    -
    -
    -
    -
    -
    -

    Wrapped option value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var wrappedValue: T { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - projectedValue - -
    -
    -
    -
    -
    -
    -

    The wrapper itself providing access to all its data. This field can only be accessed by the -element’s name prefixed with a $.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var projectedValue: ConfigurationElement { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - key - -
    -
    -
    -
    -
    -
    -

    Name of this configuration entry.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var key: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - inline - -
    -
    -
    -
    -
    -
    -

    Whether this configuration element will be inlined into its description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let inline: Bool
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Default constructor.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T,
    -            key: String,
    -            deprecationNotice: DeprecationNotice? = nil,
    -            postprocessor: @escaping (inout T) -> Void = { _ in })
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - key - - -
    -

    Optional name of the option. If not specified, it will be inferred from the attributed property.

    -
    -
    - - deprecationNotice - - -
    -

    An optional deprecation notice in case an option is outdated and/or has been replaced by - an alternative.

    -
    -
    - - postprocessor - - -
    -

    Function to be applied to the wrapped value after parsing to validate and modify it.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(key:) - -
    -
    -
    -
    -
    -
    -

    Constructor for optional values.

    - -

    It allows to skip explicit initialization of the property with nil.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init<Wrapped>(key: String) where T == Wrapped?, Wrapped : Equatable, Wrapped : AcceptableByConfigurationElement
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - key - - -
    -

    Optional name of the option. If not specified, it will be inferred from the attributed property.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Constructor for an InlinableOptionType without a key.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T, inline: Bool) where T : InlinableOptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - inline - - -
    -

    If true, the option will be handled as it would be part of its parent. All of its options - will be inlined. Otherwise, it will be treated as a normal nested configuration with its name - inferred from the name of the attributed property.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Constructor for an InlinableOptionType with a name. The configuration will explicitly not be inlined.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T, key: String) where T : InlinableOptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - key - - -
    -

    Name of the option.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: ConfigurationElement, rhs: ConfigurationElement) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/ConfigurationElement/DeprecationNotice.html b/Structs/ConfigurationElement/DeprecationNotice.html deleted file mode 100644 index 1e539f65d..000000000 --- a/Structs/ConfigurationElement/DeprecationNotice.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - DeprecationNotice Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

DeprecationNotice

-
-
- -
public enum DeprecationNotice
- -
-
-

A deprecation notice.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Structs/Correction.html b/Structs/Correction.html deleted file mode 100644 index 858dc7f71..000000000 --- a/Structs/Correction.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - Correction Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Correction

-
-
- -
public struct Correction : Equatable, Sendable
- -
-
-

A value describing a SwiftLint violation that was corrected.

- - -
-
- -
-
-
-
    -
  • -
    - - - - ruleDescription - -
    -
    -
    -
    -
    -
    -

    The description of the rule for which this correction was applied.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleDescription: RuleDescription
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - location - -
    -
    -
    -
    -
    -
    -

    The location of the original violation that was corrected.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let location: Location
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - consoleDescription - -
    -
    -
    -
    -
    -
    -

    The console-printable description for this correction.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var consoleDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Memberwise initializer.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(ruleDescription: RuleDescription, location: Location)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - ruleDescription - - -
    -

    The description of the rule for which this correction was applied.

    -
    -
    - - location - - -
    -

    The location of the original violation that was corrected.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Example.html b/Structs/Example.html deleted file mode 100644 index c30785c30..000000000 --- a/Structs/Example.html +++ /dev/null @@ -1,923 +0,0 @@ - - - - Example Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Example

-
-
- -
public struct Example : Sendable
-
extension Example: Hashable
-
extension Example: Comparable
- -
-
-

Captures code and context information for an example of a triggering or -non-triggering style

- - -
-
- -
-
-
-
    -
  • -
    - - - - code - -
    -
    -
    -
    -
    -
    -

    The contents of the example

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var code: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    The untyped configuration to apply to the rule, if deviating from the default configuration. -The structure should match what is expected as a configuration value for the rule being tested.

    - -

    For example, if the following YAML would be used to configure the rule:

    -
    severity: warning
    -
    - -

    Then the equivalent configuration value would be ["severity": "warning"].

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var configuration: [String : any Sendable]? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - testMultiByteOffsets - -
    -
    -
    -
    -
    -
    -

    Whether the example should be tested by prepending multibyte grapheme clusters

    -
    -

    See also

    - addEmoji(_:) - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var testMultiByteOffsets: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - testOnLinux - -
    -
    -
    -
    -
    -
    -

    Whether the example should be tested on Linux

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var testOnLinux: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The path to the file where the example was created

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var file: StaticString { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

    The line in the file where the example was created

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var line: UInt
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Create a new Example with the specified code, file, and line.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(_ code: String, configuration: [String: any Sendable]? = nil, testMultiByteOffsets: Bool = true,
    -     testWrappingInComment: Bool = true, testWrappingInString: Bool = true, testDisableCommand: Bool = true,
    -     testOnLinux: Bool = true, file: StaticString = #file, line: UInt = #line,
    -     excludeFromDocumentation: Bool = false)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - code - - -
    -

    The contents of the example.

    -
    -
    - - configuration - - -
    -

    The untyped configuration to apply to the rule, if deviating from the default - configuration.

    -
    -
    - - testMultibyteOffsets - - -
    -

    Whether the example should be tested by prepending multibyte grapheme clusters.

    -
    -
    - - testWrappingInComment - - -
    -

    Whether test shall verify that the example wrapped in a comment doesn’t trigger.

    -
    -
    - - testWrappingInString - - -
    -

    Whether tests shall verify that the example wrapped into a string doesn’t trigger.

    -
    -
    - - testDisableCommand - - -
    -

    Whether tests shall verify that the disabled rule (comment in the example) doesn’t - trigger.

    -
    -
    - - testOnLinux - - -
    -

    Whether the example should be tested on Linux.

    -
    -
    - - file - - -
    -

    The path to the file where the example is located. - Defaults to the file where this initializer is called.

    -
    -
    - - line - - -
    -

    The line in the file where the example is located. - Defaults to the line where this initializer is called.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(code:) - -
    -
    -
    -
    -
    -
    -

    Returns the same example, but with the code that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func with(code: String) -> Example
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - code - - -
    -

    the new code to use in the modified example

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Returns a copy of the Example with all instances of the “↓” character removed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func removingViolationMarkers() -> Example
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - focused() - -
    -
    -
    -
    -
    -
    -

    Makes the current example focused. This is for debugging purposes only.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func focused() -> Example
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: Example, rhs: Example) -> Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: Example, rhs: Example) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Linter.html b/Structs/Linter.html deleted file mode 100644 index a80ae0274..000000000 --- a/Structs/Linter.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - Linter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Linter

-
-
- -
public struct Linter
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file to lint with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isCollecting - -
    -
    -
    -
    -
    -
    -

    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.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - collect(into:) - -
    -
    -
    -
    -
    -
    -

    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.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Location.html b/Structs/Location.html deleted file mode 100644 index 552e49f33..000000000 --- a/Structs/Location.html +++ /dev/null @@ -1,831 +0,0 @@ - - - - Location Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Location

-
-
- -
public struct Location : CustomStringConvertible, Comparable, Codable, Sendable
- -
-
-

The placement of a segment of Swift in a collection of source files.

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file path on disk for this location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

    The line offset in the file for this location. 1-indexed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let line: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - character - -
    -
    -
    -
    -
    -
    -

    The character offset in the file for this location. 1-indexed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let character: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A lossless printable description of this location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - relativeFile - -
    -
    -
    -
    -
    -
    -

    The file path for this location relative to the current working directory.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var relativeFile: String? { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: String?, line: Int? = nil, character: Int? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file path on disk for this location.

    -
    -
    - - line - - -
    -

    The line offset in the file for this location. 1-indexed.

    -
    -
    - - character - - -
    -

    The character offset in the file for this location. 1-indexed.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a byte-offset into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, byteOffset offset: ByteCount)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - offset - - -
    -

    The offset in bytes into the file for this location.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(file:position:) - -
    -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, position: AbsolutePosition)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - position - - -
    -

    The absolute position returned from SwiftSyntax.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, characterOffset offset: Int)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - offset - - -
    -

    The offset in UTF8 fragments into the file for this location.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Comparable -

-
-
-
    -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: Location, rhs: Location) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/ReasonedRuleViolation.html b/Structs/ReasonedRuleViolation.html deleted file mode 100644 index 5269752d2..000000000 --- a/Structs/ReasonedRuleViolation.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - ReasonedRuleViolation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ReasonedRuleViolation

-
-
- -
public struct ReasonedRuleViolation : Comparable, Hashable
- -
-
-

A violation produced by ViolationsSyntaxVisitors.

- - -
-
- -
-
-
-
    -
  • -
    - - - - position - -
    -
    -
    -
    -
    -
    -

    The violation’s position.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let position: AbsolutePosition
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reason - -
    -
    -
    -
    -
    -
    -

    A specific reason for the violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reason: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The violation’s severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let severity: ViolationSeverity?
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a ReasonedRuleViolation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(position: AbsolutePosition, reason: String? = nil, severity: ViolationSeverity? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - position - - -
    -

    The violations position in the analyzed source file.

    -
    -
    - - reason - - -
    -

    The reason for the violation if different from the rule’s description.

    -
    -
    - - severity - - -
    -

    The severity of the violation if different from the rule’s default configured severity.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: `Self`, rhs: `Self`) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RegexConfiguration.html b/Structs/RegexConfiguration.html deleted file mode 100644 index e4c2319f5..000000000 --- a/Structs/RegexConfiguration.html +++ /dev/null @@ -1,788 +0,0 @@ - - - - RegexConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RegexConfiguration

-
-
- -
public struct RegexConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration, Hashable,
-                                                CacheDescriptionProvider, InlinableOptionType
- -
-
-

A rule configuration used for defining custom rules in yaml.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The identifier for this custom rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let identifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - name - -
    -
    -
    -
    -
    -
    -

    The name for this custom rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var name: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - message - -
    -
    -
    -
    -
    -
    -

    The message to be presented when producing violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var message: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - included - -
    -
    -
    -
    -
    -
    -

    Regular expressions to include when matching the file path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var included: [NSRegularExpression]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excluded - -
    -
    -
    -
    -
    -
    -

    Regular expressions to exclude when matching the file path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var excluded: [NSRegularExpression]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excludedMatchKinds - -
    -
    -
    -
    -
    -
    -

    The syntax kinds to exclude from matches. If the regex matched syntax kinds from this list, it would -be ignored and not count as a rule violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var excludedMatchKinds: Set<SyntaxKind>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severityConfiguration - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var severityConfiguration: SeverityConfiguration<Parent> { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - captureGroup - -
    -
    -
    -
    -
    -
    -

    The index of the regex capture group to match.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var captureGroup: Int
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - cacheDescription - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    The RuleDescription for the custom rule defined here.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: RuleDescription { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(identifier:) - -
    -
    -
    -
    -
    -
    -

    Create a RegexConfiguration with the specified identifier, with other properties to be set later.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(identifier: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    The rule identifier to use.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Region.html b/Structs/Region.html deleted file mode 100644 index 64d321516..000000000 --- a/Structs/Region.html +++ /dev/null @@ -1,811 +0,0 @@ - - - - Region Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Region

-
-
- -
public struct Region : Equatable
- -
-
-

A contiguous region of Swift source code.

- - -
-
- -
-
-
-
    -
  • -
    - - - - start - -
    -
    -
    -
    -
    -
    -

    The location describing the start of the region. All locations that are less than this value -(earlier in the source file) are not contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let start: Location
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - end - -
    -
    -
    -
    -
    -
    -

    The location describing the end of the region. All locations that are greater than this value -(later in the source file) are not contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let end: Location
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    All SwiftLint rule identifiers that are disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let disabledRuleIdentifiers: Set<RuleIdentifier>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Region by setting explicit values for all its properties.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(start: Location, end: Location, disabledRuleIdentifiers: Set<RuleIdentifier>)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - start - - -
    -

    The region’s starting location.

    -
    -
    - - end - - -
    -

    The region’s ending location.

    -
    -
    - - disabledRuleIdentifiers - - -
    -

    All SwiftLint rule identifiers that are disabled in this region.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - contains(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specific location is contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func contains(_ location: Location) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - location - - -
    -

    The location to check for containment.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specific location is contained in this region.

    -
    - -
    -
    -
  • -
  • -
    - - - - isRuleEnabled(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specified rule is enabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func isRuleEnabled(_ rule: some Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule whose status should be determined.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rule is enabled in this region.

    -
    - -
    -
    -
  • -
  • -
    - - - - isRuleDisabled(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specified rule is disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func isRuleDisabled(_ rule: some Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule whose status should be determined.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rule is disabled in this region.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Whether the given rules are disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func areRulesDisabled(ruleIDs: [String]) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - ruleIDs - - -
    -

    A list of rule IDs. Typically all identifiers of a single rule.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rules are disabled in this region.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Returns the deprecated rule aliases that are disabling the specified rule in this region. -Returns the empty set if the rule isn’t disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func deprecatedAliasesDisabling(rule: some Rule) -> Set<String>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule to check.

    -
    -
    -
    -
    -

    Return Value

    -

    Deprecated rule aliases.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleConfigurationDescription.html b/Structs/RuleConfigurationDescription.html deleted file mode 100644 index 92d3aff93..000000000 --- a/Structs/RuleConfigurationDescription.html +++ /dev/null @@ -1,497 +0,0 @@ - - - - RuleConfigurationDescription Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfigurationDescription

-
-
- -
public struct RuleConfigurationDescription : Equatable
-
extension RuleConfigurationDescription: Documentable
- -
-
-

Description of a rule configuration.

- - -
-
- -
-
-
-
    -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleConfigurationOption.html b/Structs/RuleConfigurationOption.html deleted file mode 100644 index 8e7160a9d..000000000 --- a/Structs/RuleConfigurationOption.html +++ /dev/null @@ -1,527 +0,0 @@ - - - - RuleConfigurationOption Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfigurationOption

-
-
- -
public struct RuleConfigurationOption : Equatable
-
extension RuleConfigurationOption: Documentable
- -
-
-

A single option of a RuleConfigurationDescription.

- - -
-
- -
-
-
-
    -
  • -
    - - - - noOptions - -
    -
    -
    -
    -
    -
    -

    An option serving as a marker for an empty configuration description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let noOptions: RuleConfigurationOption
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleDescription.html b/Structs/RuleDescription.html deleted file mode 100644 index 58c730a75..000000000 --- a/Structs/RuleDescription.html +++ /dev/null @@ -1,965 +0,0 @@ - - - - RuleDescription Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleDescription

-
-
- -
public struct RuleDescription : Equatable, Sendable
- -
-
-

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The rule’s unique identifier, to be used in configuration files and SwiftLint commands. -Should be short and only comprised of lowercase latin alphabet letters and underscores formatted in snake case.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let identifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - name - -
    -
    -
    -
    -
    -
    -

    The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let name: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an -explanation of the rule’s purpose and rationale.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let description: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - kind - -
    -
    -
    -
    -
    -
    -

    The RuleKind that best categorizes this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let kind: RuleKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - nonTriggeringExamples - -
    -
    -
    -
    -
    -
    -

    Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform -users of various samples of code that are considered valid by this rule. Should be valid Swift syntax but is not -required to compile.

    - -

    These examples are also used for automatic testing purposes. Tests will validate that the rule does not trigger -any violations for these examples.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let nonTriggeringExamples: [Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - triggeringExamples - -
    -
    -
    -
    -
    -
    -

    Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to -inform users of various samples of code that are considered invalid by this rule. Should be valid Swift syntax -but is not required to compile.

    - -

    Violations should occur where ↓ markers are located.

    - -

    These examples are also used for automatic testing purposes. Tests will validate that the rule triggers -violations for these examples wherever ↓ markers are located.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let triggeringExamples: [Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - corrections - -
    -
    -
    -
    -
    -
    -

    Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values -are the expected value after applying corrections with the rule.

    - -

    Rules that aren’t correctable (conforming to the CorrectableRule protocol) should leave property empty.

    - -

    These examples are used for testing purposes if the rule conforms to AutomaticTestableRule. Tests will -validate that the rule corrects all keys to their corresponding values.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let corrections: [Example : Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - deprecatedAliases - -
    -
    -
    -
    -
    -
    -

    Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let deprecatedAliases: Set<String>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - minSwiftVersion - -
    -
    -
    -
    -
    -
    -

    The oldest version of the Swift compiler supported by this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let minSwiftVersion: SwiftVersion
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - requiresFileOnDisk - -
    -
    -
    -
    -
    -
    -

    Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules -conforming to AnalyzerRule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let requiresFileOnDisk: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - consoleDescription - -
    -
    -
    -
    -
    -
    -

    The console-printable string for this description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var consoleDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - allIdentifiers - -
    -
    -
    -
    -
    -
    -

    All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var allIdentifiers: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a RuleDescription by specifying all its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(identifier: String, name: String, description: String, kind: RuleKind,
    -            minSwiftVersion: SwiftVersion = .five,
    -            nonTriggeringExamples: [Example] = [], triggeringExamples: [Example] = [],
    -            corrections: [Example: Example] = [:],
    -            deprecatedAliases: Set<String> = [],
    -            requiresFileOnDisk: Bool = false)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - identifier - - -
    -

    Sets the description’s identifier property.

    -
    -
    - - name - - -
    -

    Sets the description’s name property.

    -
    -
    - - description - - -
    -

    Sets the description’s description property.

    -
    -
    - - kind - - -
    -

    Sets the description’s kind property.

    -
    -
    - - minSwiftVersion - - -
    -

    Sets the description’s minSwiftVersion property.

    -
    -
    - - nonTriggeringExamples - - -
    -

    Sets the description’s nonTriggeringExamples property.

    -
    -
    - - triggeringExamples - - -
    -

    Sets the description’s triggeringExamples property.

    -
    -
    - - corrections - - -
    -

    Sets the description’s corrections property.

    -
    -
    - - deprecatedAliases - - -
    -

    Sets the description’s deprecatedAliases property.

    -
    -
    - - requiresFileOnDisk - - -
    -

    Sets the description’s requiresFileOnDisk property.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Equatable -

-
-
-
    -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleList.html b/Structs/RuleList.html deleted file mode 100644 index 851851876..000000000 --- a/Structs/RuleList.html +++ /dev/null @@ -1,551 +0,0 @@ - - - - RuleList Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleList

-
-
- -
public struct RuleList
-
extension RuleList: Equatable
- -
-
-

A list of available SwiftLint rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - list - -
    -
    -
    -
    -
    -
    -

    The rules contained in this list.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let list: [String : any Rule.Type]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Initializers -

-
-
-
    -
  • -
    - - - - init(rules:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleList by specifying all its rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(rules: any Rule.Type...)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to be contained in this list.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(rules:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleList by specifying all its rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(rules: [any Rule.Type])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to be contained in this list.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: RuleList, rhs: RuleList) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleListDocumentation.html b/Structs/RuleListDocumentation.html deleted file mode 100644 index 28cc700bc..000000000 --- a/Structs/RuleListDocumentation.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - RuleListDocumentation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleListDocumentation

-
-
- -
public struct RuleListDocumentation
- -
-
-

User-facing documentation for a SwiftLint RuleList.

- - -
-
- -
-
-
-
    -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleListDocumentation instance from a RuleList.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ list: RuleList)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - list - - -
    -

    A RuleList to document.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - write(to:) - -
    -
    -
    -
    -
    -
    -

    Write the rule list documentation as markdown files to the specified directory.

    -
    -

    Throws

    -

    Throws if the files could not be written to.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func write(to url: URL) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - url - - -
    -

    Local URL for directory where the markdown files for this documentation should be saved.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/RuleParameter.html b/Structs/RuleParameter.html deleted file mode 100644 index dde4e6bd5..000000000 --- a/Structs/RuleParameter.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - RuleParameter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleParameter

-
-
- -
public struct RuleParameter<T> : Equatable where T : Equatable
- -
-
-

A configuration parameter for rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The severity that should be assigned to the violation of this parameter’s value is met.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let severity: ViolationSeverity
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The value to configure the rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: T
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(severity:value:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleParameter by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(severity: ViolationSeverity, value: T)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - severity - - -
    -

    The severity that should be assigned to the violation of this parameter’s value is met.

    -
    -
    - - value - - -
    -

    The value to configure the rule.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/SeverityConfiguration.html b/Structs/SeverityConfiguration.html deleted file mode 100644 index 1c9f7f16b..000000000 --- a/Structs/SeverityConfiguration.html +++ /dev/null @@ -1,591 +0,0 @@ - - - - SeverityConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityConfiguration

-
-
- -
public struct SeverityConfiguration<Parent> : SeverityBasedRuleConfiguration, InlinableOptionType where Parent : Rule
- -
-
-

A rule configuration that allows specifying the desired severity level for violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Configuration with a warning severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var error: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Configuration with an error severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var warning: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severityConfiguration - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var severityConfiguration: SeverityConfiguration { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Create a SeverityConfiguration with the specified severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ severity: ViolationSeverity)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - severity - - -
    -

    The severity that should be used when emitting violations.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

RuleConfiguration conformances -

-
-
-
    -
  • -
    - - - - asDescription(with:) - -
    -
    -
    -
    -
    -
    -

    Severity configurations are special in that they shall not be nested when an option name is provided. -Instead, their only option value must be used together with the option name.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asDescription(with key: String) -> RuleConfigurationDescription
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/SeverityLevelsConfiguration.html b/Structs/SeverityLevelsConfiguration.html deleted file mode 100644 index e2b9ac377..000000000 --- a/Structs/SeverityLevelsConfiguration.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - SeverityLevelsConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityLevelsConfiguration

-
-
- -
public struct SeverityLevelsConfiguration<Parent> : RuleConfiguration, InlinableOptionType where Parent : Rule
- -
-
-

A rule configuration that allows specifying thresholds for warning and error severities.

- - -
-
- -
-
-
-
    -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    The threshold for a violation to be a warning.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var warning: Int { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    The threshold for a violation to be an error.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var error: Int? { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(warning:error:) - -
    -
    -
    -
    -
    -
    -

    Create a SeverityLevelsConfiguration based on the sepecified warning and error thresholds.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(warning: Int, error: Int? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - warning - - -
    -

    The threshold for a violation to be a warning.

    -
    -
    - - error - - -
    -

    The threshold for a violation to be an error.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - params - -
    -
    -
    -
    -
    -
    -

    The rule parameters that define the thresholds that should map to each severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var params: [RuleParameter<Int>] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/Stack.html b/Structs/Stack.html deleted file mode 100644 index eff46041e..000000000 --- a/Structs/Stack.html +++ /dev/null @@ -1,700 +0,0 @@ - - - - Stack Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Stack

-
-
- -
public struct Stack<Element>
-
extension Stack: CustomDebugStringConvertible where Element: CustomDebugStringConvertible
- -
-
-

A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

- - -
-
- -
-
-
-
    -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    Creates an empty Stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - count - -
    -
    -
    -
    -
    -
    -

    The number of elements in this stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var count: Int { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - push(_:) - -
    -
    -
    -
    -
    -
    -

    Pushes (appends) an element onto the stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func push(_ element: Element)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - element - - -
    -

    The element to push onto the stack.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - pop() - -
    -
    -
    -
    -
    -
    -

    Removes and returns the last element of the stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @discardableResult
    -public mutating func pop() -> Element?
    - -
    -
    -
    -

    Return Value

    -

    The last element of the stack if the stack is not empty; otherwise, nil.

    -
    - -
    -
    -
  • -
  • -
    - - - - peek() - -
    -
    -
    -
    -
    -
    -

    Returns the last element of the stack if the stack is not empty; otherwise, nil.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func peek() -> Element?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - contains(where:) - -
    -
    -
    -
    -
    -
    -

    Check whether the sequence contains an element that satisfies the given predicate.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func contains(where predicate: (Element) -> Bool) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - predicate - - -
    -

    A closure that takes an element of the sequence -and returns whether it represents a match.

    -
    -
    -
    -
    -

    Return Value

    -

    true if the sequence contains an element that satisfies predicate.

    -
    - -
    -
    -
  • -
  • -
    - - - - modifyLast(by:) - -
    -
    -
    -
    -
    -
    -

    Modify the last element.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func modifyLast(by modifier: (inout Element) -> Void)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - modifier - - -
    -

    A function to be applied to the last element to modify the same in place.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element: CustomDebugStringConvertible -

-
-
-
    -
  • -
    - - - - debugDescription - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var debugDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/StyleViolation.html b/Structs/StyleViolation.html deleted file mode 100644 index e50cea87d..000000000 --- a/Structs/StyleViolation.html +++ /dev/null @@ -1,806 +0,0 @@ - - - - StyleViolation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

StyleViolation

-
-
- -
public struct StyleViolation : CustomStringConvertible, Codable, Hashable
- -
-
-

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

- - -
-
- -
-
-
-
    -
  • -
    - - - - ruleIdentifier - -
    -
    -
    -
    -
    -
    -

    The identifier of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleIdentifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleDescription - -
    -
    -
    -
    -
    -
    -

    The description of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleDescription: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleName - -
    -
    -
    -
    -
    -
    -

    The name of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleName: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The severity of this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var severity: ViolationSeverity { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - location - -
    -
    -
    -
    -
    -
    -

    The location of this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var location: Location { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reason - -
    -
    -
    -
    -
    -
    -

    The justification for this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reason: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A printable description for this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a StyleViolation by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(ruleDescription: RuleDescription,
    -            severity: ViolationSeverity = .warning,
    -            location: Location,
    -            reason: String? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - -
    - - ruleDescription - - -
    -

    The description of the rule that generated this violation.

    -
    -
    - - severity - - -
    -

    The severity of this violation.

    -
    -
    - - location - - -
    -

    The location of this violation.

    -
    -
    - - reason - - -
    -

    The justification for this violation. If not specified the rule’s description will - be used.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(severity:) - -
    -
    -
    -
    -
    -
    -

    Returns the same violation, but with the severity that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func with(severity: ViolationSeverity) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - severity - - -
    -

    the new severity to use in the modified violation

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(location:) - -
    -
    -
    -
    -
    -
    -

    Returns the same violation, but with the location that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func with(location: Location) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - location - - -
    -

    the new location to use in the modified violation

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/SwiftLintSyntaxMap.html b/Structs/SwiftLintSyntaxMap.html deleted file mode 100644 index fdde4d691..000000000 --- a/Structs/SwiftLintSyntaxMap.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - SwiftLintSyntaxMap Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintSyntaxMap

-
-
- -
public struct SwiftLintSyntaxMap
- -
-
-

Represents a Swift file’s syntax information.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The raw SyntaxMap obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: SyntaxMap
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - tokens - -
    -
    -
    -
    -
    -
    -

    The SwiftLint-specific syntax tokens for this syntax map.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let tokens: [SwiftLintSyntaxToken]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(value:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(value: SyntaxMap)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The raw SyntaxMap obtained by SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - tokens(inByteRange:) - -
    -
    -
    -
    -
    -
    -

    Returns array of syntax tokens intersecting with byte range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func tokens(inByteRange byteRange: ByteRange) -> [SwiftLintSyntaxToken]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - byteRange - - -
    -

    Byte-based NSRange.

    -
    -
    -
    -
    -

    Return Value

    -

    The array of syntax tokens intersecting with byte range.

    -
    - -
    -
    -
  • -
  • -
    - - - - kinds(inByteRange:) - -
    -
    -
    -
    -
    -
    -

    Returns the syntax kinds in the specified byte range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func kinds(inByteRange byteRange: ByteRange) -> [SyntaxKind]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - byteRange - - -
    -

    Byte range.

    -
    -
    -
    -
    -

    Return Value

    -

    The syntax kinds in the specified byte range.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/SwiftLintSyntaxToken.html b/Structs/SwiftLintSyntaxToken.html deleted file mode 100644 index 1b7b1bb0d..000000000 --- a/Structs/SwiftLintSyntaxToken.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - SwiftLintSyntaxToken Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintSyntaxToken

-
-
- -
public struct SwiftLintSyntaxToken
- -
-
-

A SwiftLint-aware Swift syntax token.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The raw SyntaxToken obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: SyntaxToken
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - kind - -
    -
    -
    -
    -
    -
    -

    The syntax kind associated with is token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let kind: SyntaxKind?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(value:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(value: SyntaxToken)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The raw SyntaxToken obtained by SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - range - -
    -
    -
    -
    -
    -
    -

    The byte range in a source file for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var range: ByteRange { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - offset - -
    -
    -
    -
    -
    -
    -

    The starting byte offset in a source file for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var offset: ByteCount { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - length - -
    -
    -
    -
    -
    -
    -

    The length in bytes for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var length: ByteCount { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/SwiftVersion.html b/Structs/SwiftVersion.html deleted file mode 100644 index cec806031..000000000 --- a/Structs/SwiftVersion.html +++ /dev/null @@ -1,860 +0,0 @@ - - - - SwiftVersion Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftVersion

-
-
- -
public struct SwiftVersion : RawRepresentable, Codable, Comparable, Sendable
- -
-
-

A value describing the version of the Swift compiler.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/Structs/Version.html b/Structs/Version.html deleted file mode 100644 index 630cce614..000000000 --- a/Structs/Version.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - Version Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Version

-
-
- -
public struct Version
- -
-
-

A type describing the SwiftLint version.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The string value for this version.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - current - -
    -
    -
    -
    -
    -
    -

    The current SwiftLint version.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let current: Version
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/ViolationCorrection.html b/Structs/ViolationCorrection.html deleted file mode 100644 index a42f83ecd..000000000 --- a/Structs/ViolationCorrection.html +++ /dev/null @@ -1,484 +0,0 @@ - - - - ViolationCorrection Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationCorrection

-
-
- -
public struct ViolationCorrection
- -
-
-

The correction of a violation that is basically the violation’s range in the source code and a -replacement for this range that would fix the violation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - start - -
    -
    -
    -
    -
    -
    -

    Start position of the violation range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let start: AbsolutePosition
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Create a ViolationCorrection.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(start: AbsolutePosition, end: AbsolutePosition, replacement: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - start - - -
    -

    Start position of the violation range.

    -
    -
    - - end - - -
    -

    End position of the violation range.

    -
    -
    - - replacement - - -
    -

    Replacement for the violating range.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/Structs/YamlParser.html b/Structs/YamlParser.html deleted file mode 100644 index b3023cbe3..000000000 --- a/Structs/YamlParser.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - YamlParser Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

YamlParser

-
-
- -
public struct YamlParser
- -
-
-

An interface for parsing YAML.

- - -
-
- -
-
-
-
    -
  • -
    - - - - parse(_:env:) - -
    -
    -
    -
    -
    -
    -

    Parses the input YAML string as an untyped dictionary.

    -
    -

    Throws

    -

    Throws if the yaml string provided could not be parsed.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func parse(_ yaml: String,
    -                         env: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - yaml - - -
    -

    YAML-formatted string.

    -
    -
    - - env - - -
    -

    The environment to use to expand variables in the YAML.

    -
    -
    -
    -
    -

    Return Value

    -

    The parsed YAML as an untyped dictionary.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/accessibility_label_for_image.html b/accessibility_label_for_image.html deleted file mode 100644 index 468527362..000000000 --- a/accessibility_label_for_image.html +++ /dev/null @@ -1,626 +0,0 @@ - - - - accessibility_label_for_image Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Accessibility Label for Image

- -

Images that provide context should have an accessibility label or should be explicitly hidden from accessibility

- -
    -
  • Identifier: accessibility_label_for_image
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        Image(decorative: "my-image")
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image", label: Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibility(hidden: true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibility(label: Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibilityLabel(Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .renderingMode(.template)
-            .foregroundColor(.blue)
-            .accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .accessibilityLabel(Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityElement()
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .combine)
-        .padding(16)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .ignore)
-        .padding(16)
-        .accessibilityLabel(Text("Label for my image and text"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Button(action: { doAction() }) {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-        }
-        .accessibilityLabel(Text("Label for my image"))
-    }
-}
-
-

Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        ↓Image("my-image")
-            .resizable(true)
-            .frame(width: 48, height: 48)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Image(uiImage: myUiImage)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(false)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .resizable()
-            .frame(width: 48, height: 48)
-            .accessibilityLabel(Text("Alt text for my image"))
-        ↓Image("other image")
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(decorative: "image1")
-        ↓Image("image2")
-        Image(uiImage: "image3")
-            .accessibility(label: Text("a pretty picture"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            ↓Image("my-image")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityElement(children: .contain)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityHidden(false)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .combine)
-        .padding(16)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Button(action: { doAction() }) {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Image(systemName: "circle.plus")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/accessibility_trait_for_button.html b/accessibility_trait_for_button.html deleted file mode 100644 index 146994a82..000000000 --- a/accessibility_trait_for_button.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - accessibility_trait_for_button Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Accessibility Trait for Button

- -

All views with tap gestures added should include the .isButton or the .isLink accessibility traits

- -
    -
  • Identifier: accessibility_trait_for_button
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        Button {
-            print("tapped")
-        } label: {
-            Text("Learn more")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Link("Open link", destination: myUrl)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture {
-                print("tapped - open URL")
-            }
-            .accessibility(addTraits: .isLink)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .accessibilityAddTraits(.isButton)
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .accessibility(addTraits: [.isButton, .isHeader])
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture {
-                print("tapped - open URL")
-            }
-            .accessibilityAddTraits([.isHeader, .isLink])
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture(count: 1, perform: {
-                print("tapped")
-            })
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            // This rule does not include tap gestures with multiple taps for now.
-            // Custom gestures like this are also not very accessible, but require
-            // alternative ways to accomplish the same task with assistive tech.
-            .onTapGesture(count: 2) {
-                print("double-tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Label("Learn more", systemImage: "info.circle")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack {
-            Image(systemName: "info.circle")
-            Text("Learn more")
-        }
-        .onTapGesture {
-            print("tapped")
-        }
-        // This modifier is not strictly required — each subview will inherit the button trait.
-        // That said, grouping a tappable stack into a single element is a good way to reduce
-        // the number of swipes required for a VoiceOver user to navigate the page.
-        .accessibilityElement(children: .combine)
-        .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .gesture(TapGesture().onEnded {
-                print("tapped")
-            })
-            .accessibilityAddTraits(.isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .simultaneousGesture(TapGesture(count: 1).onEnded {
-                print("tapped - open URL")
-            })
-            .accessibilityAddTraits(.isLink)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .highPriorityGesture(TapGesture().onEnded {
-                print("tapped")
-            })
-            .accessibility(addTraits: [.isButton])
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .gesture(TapGesture(count: 2).onEnded {
-                print("tapped")
-            })
-    }
-}
-
-

Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .accessibility(addTraits: .isHeader)
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture(count: 1, perform: {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Label("Learn more", systemImage: "info.circle")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓HStack {
-            Image(systemName: "info.circle")
-            Text("Learn more")
-        }
-        .onTapGesture {
-            print("tapped")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .gesture(TapGesture().onEnded {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .simultaneousGesture(TapGesture(count: 1).onEnded {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .highPriorityGesture(TapGesture().onEnded {
-                print("tapped")
-            })
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/anonymous_argument_in_multiline_closure.html b/anonymous_argument_in_multiline_closure.html deleted file mode 100644 index babcfb8c9..000000000 --- a/anonymous_argument_in_multiline_closure.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - anonymous_argument_in_multiline_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Anonymous Argument in Multiline Closure

- -

Use named arguments in multiline closures

- -
    -
  • Identifier: anonymous_argument_in_multiline_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
closure { $0 }
-
-
closure { print($0) }
-
-
closure { arg in
-    print(arg)
-}
-
-
closure { arg in
-    nestedClosure { $0 + arg }
-}
-
-

Triggering Examples

-
closure {
-    print(↓$0)
-}
-
- -
-
- - -
-
- - - diff --git a/anyobject_protocol.html b/anyobject_protocol.html deleted file mode 100644 index 7bafdbea4..000000000 --- a/anyobject_protocol.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - anyobject_protocol Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

AnyObject Protocol

- -

Prefer using AnyObject over class for class-only protocols

- -
    -
  • Identifier: anyobject_protocol
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol SomeProtocol {}
-
-
protocol SomeClassOnlyProtocol: AnyObject {}
-
-
protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
-
-
@objc protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
-
-

Triggering Examples

-
protocol SomeClassOnlyProtocol: ↓class {}
-
-
protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
-
-
@objc protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
-
- -
-
- - -
-
- - - diff --git a/array_init.html b/array_init.html deleted file mode 100644 index 0d03b109d..000000000 --- a/array_init.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - array_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Array Init

- -

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array

- -
    -
  • Identifier: array_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Array(foo)
-
-
foo.map { $0.0 }
-
-
foo.map { $1 }
-
-
foo.map { $0() }
-
-
foo.map { ((), $0) }
-
-
foo.map { $0! }
-
-
foo.map { $0! /* force unwrap */ }
-
-
foo.something { RouteMapper.map($0) }
-
-
foo.map { !$0 }
-
-
foo.map { /* a comment */ !$0 }
-
-

Triggering Examples

-
foo.↓map({ $0 })
-
-
foo.↓map { $0 }
-
-
foo.↓map { return $0 }
-
-
    foo.↓map { elem in
-        elem
-    }
-
-
    foo.↓map { elem in
-        return elem
-    }
-
-
    foo.↓map { (elem: String) in
-        elem
-    }
-
-
    foo.↓map { elem -> String in
-        elem
-    }
-
-
foo.↓map { $0 /* a comment */ }
-
-
foo.↓map { /* a comment */ $0 }
-
- -
-
- - -
-
- - - diff --git a/attributes.html b/attributes.html deleted file mode 100644 index 93a69d236..000000000 --- a/attributes.html +++ /dev/null @@ -1,645 +0,0 @@ - - - - attributes Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Attributes

- -

Attributes should be on their own lines in functions and types, but on the same line as variables and imports

- -
    -
  • Identifier: attributes
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -attributes_with_arguments_always_on_line_above - -true -
    -always_on_same_line - -[“@IBAction”, “@NSManaged”] -
    -always_on_line_above - -[] -
  • -
-

Non Triggering Examples

-
@objc var x: String
-
-
@objc private var x: String
-
-
@nonobjc var x: String
-
-
@IBOutlet private var label: UILabel
-
-
@IBOutlet @objc private var label: UILabel
-
-
@NSCopying var name: NSString
-
-
@NSManaged var name: String?
-
-
@IBInspectable var cornerRadius: CGFloat
-
-
@available(iOS 9.0, *)
- let stackView: UIStackView
-
-
@NSManaged func addSomeObject(book: SomeObject)
-
-
@IBAction func buttonPressed(button: UIButton)
-
-
@objc
- @IBAction func buttonPressed(button: UIButton)
-
-
@available(iOS 9.0, *)
- func animate(view: UIStackView)
-
-
@available(*, deprecated, message: "A message")
- func animate(view: UIStackView)
-
-
@nonobjc
- final class X {}
-
-
@available(iOS 9.0, *)
- class UIStackView {}
-
-
@NSApplicationMain
- class AppDelegate: NSObject, NSApplicationDelegate {}
-
-
@UIApplicationMain
- class AppDelegate: NSObject, UIApplicationDelegate {}
-
-
@IBDesignable
- class MyCustomView: UIView {}
-
-
@testable import SourceKittenFramework
-
-
@objc(foo_x)
- var x: String
-
-
@available(iOS 9.0, *)
-@objc(abc_stackView)
- let stackView: UIStackView
-
-
@objc(abc_addSomeObject:)
- @NSManaged func addSomeObject(book: SomeObject)
-
-
@objc(ABCThing)
- @available(iOS 9.0, *)
- class Thing {}
-
-
class Foo: NSObject {
- override var description: String { return "" }
-}
-
-
class Foo: NSObject {
-
- override func setUp() {}
-}
-
-
@objc
-class ⽺ {}
-
-
extension Property {
-
-    @available(*, unavailable, renamed: "isOptional")
-    public var optional: Bool { fatalError() }
-}
-
-
@GKInspectable var maxSpeed: Float
-
-
@discardableResult
- func a() -> Int
-
-
@objc
- @discardableResult
- func a() -> Int
-
-
func increase(f: @autoclosure () -> Int) -> Int
-
-
func foo(completionHandler: @escaping () -> Void)
-
-
private struct DefaultError: Error {}
-
-
@testable import foo
-
-private let bar = 1
-
-
import XCTest
-@testable import DeleteMe
-
-@available (iOS 11.0, *)
-class DeleteMeTests: XCTestCase {
-}
-
-
@objc
-internal func foo(identifier: String, completion: @escaping (() -> Void)) {}
-
-
@objc
-internal func foo(identifier: String, completion: @autoclosure (() -> Bool)) {}
-
-
func printBoolOrTrue(_ expression: @autoclosure () throws -> Bool?) rethrows {
-  try print(expression() ?? true)
-}
-
-
import Foundation
-
-class MyClass: NSObject {
-  @objc(
-    first:
-  )
-  static func foo(first: String) {}
-}
-
-
func refreshable(action: @escaping @Sendable () async -> Void) -> some View {
-    modifier(RefreshableModifier(action: action))
-}
-
-
import AppKit
-
-@NSApplicationMain
-@MainActor
-final class AppDelegate: NSAppDelegate {}
-
-

Triggering Examples

-
@objc
- ↓var x: String
-
-
@objc
-
- ↓var x: String
-
-
@objc
- private ↓var x: String
-
-
@nonobjc
- ↓var x: String
-
-
@IBOutlet
- private ↓var label: UILabel
-
-
@IBOutlet
-
- private ↓var label: UILabel
-
-
@NSCopying
- ↓var name: NSString
-
-
@NSManaged
- ↓var name: String?
-
-
@IBInspectable
- ↓var cornerRadius: CGFloat
-
-
@available(iOS 9.0, *) ↓let stackView: UIStackView
-
-
@NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@IBAction
- ↓func buttonPressed(button: UIButton)
-
-
@IBAction
- @objc
- ↓func buttonPressed(button: UIButton)
-
-
@available(iOS 9.0, *) ↓func animate(view: UIStackView)
-
-
@nonobjc final ↓class X {}
-
-
@available(iOS 9.0, *) ↓class UIStackView {}
-
-
@available(iOS 9.0, *)
- @objc ↓class UIStackView {}
-
-
@available(iOS 9.0, *) @objc
- ↓class UIStackView {}
-
-
@available(iOS 9.0, *)
-
- ↓class UIStackView {}
-
-
@UIApplicationMain ↓class AppDelegate: NSObject, UIApplicationDelegate {}
-
-
@IBDesignable ↓class MyCustomView: UIView {}
-
-
@testable
-↓import SourceKittenFramework
-
-
@testable
-
-
-↓import SourceKittenFramework
-
-
@available(iOS 9.0, *) @objc(abc_stackView)
- ↓let stackView: UIStackView
-
-
@objc(abc_addSomeObject:) @NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@objc(abc_addSomeObject:)
- @NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@available(iOS 9.0, *)
- @objc(ABCThing) ↓class Thing {}
-
-
@GKInspectable
- ↓var maxSpeed: Float
-
-
@discardableResult ↓func a() -> Int
-
-
@objc
- @discardableResult ↓func a() -> Int
-
-
@objc
-
- @discardableResult
- ↓func a() -> Int
-
- -
-
- - -
-
- - - diff --git a/badge.svg b/badge.svg deleted file mode 100644 index a096feca8..000000000 --- a/badge.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - documentation - - - documentation - - - 100% - - - 100% - - - diff --git a/balanced_xctest_lifecycle.html b/balanced_xctest_lifecycle.html deleted file mode 100644 index dfc417845..000000000 --- a/balanced_xctest_lifecycle.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - balanced_xctest_lifecycle Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Balanced XCTest Life Cycle

- -

Test classes must implement balanced setUp and tearDown methods

- -
    -
  • Identifier: balanced_xctest_lifecycle
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDown() {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDown() {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDownWithError() throws {}
-}
-final class BarTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDownWithError() throws {}
-}
-
-
struct FooTests {
-    override func setUp() {}
-}
-class BarTests {
-    override func setUpWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpAlLExamples() {}
-}
-
-
final class FooTests: XCTestCase {
-    class func setUp() {}
-    class func tearDown() {}
-}
-
-

Triggering Examples

-
final class ↓FooTests: XCTestCase {
-    override func setUp() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-final class ↓BarTests: XCTestCase {
-    override func setUpWithError() throws {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    class func tearDown() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func tearDown() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func tearDownWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-final class ↓BarTests: XCTestCase {
-    override func tearDownWithError() throws {}
-}
-
- -
-
- - -
-
- - - diff --git a/blanket_disable_command.html b/blanket_disable_command.html deleted file mode 100644 index e895c6150..000000000 --- a/blanket_disable_command.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - blanket_disable_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Blanket Disable Command

- -

swiftlint:disable commands should use next, this or previous to disable rules for a single line, or swiftlint:enable to re-enable the rules immediately after the violations to be ignored, instead of disabling the rule for the rest of the file.

- -
    -
  • Identifier: blanket_disable_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allowed_rules - -[“file_header”, “file_length”, “file_name”, “file_name_no_space”, “single_test_class”] -
    -always_blanket_disable - -[] -
  • -
-

Non Triggering Examples

-
// swiftlint:disable unused_import
-// swiftlint:enable unused_import
-
-
// swiftlint:disable unused_import unused_declaration
-// swiftlint:enable unused_import
-// swiftlint:enable unused_declaration
-
-
// swiftlint:disable:this unused_import
-
-
// swiftlint:disable:next unused_import
-
-
// swiftlint:disable:previous unused_import
-
-

Triggering Examples

-
// swiftlint:disable ↓unused_import
-
-
// swiftlint:disable unused_import ↓unused_declaration
-// swiftlint:enable unused_import
-
-
// swiftlint:disable unused_import
-// swiftlint:disable ↓unused_import
-// swiftlint:enable unused_import
-
-
// swiftlint:enable ↓unused_import
-
- -
-
- - -
-
- - - diff --git a/block_based_kvo.html b/block_based_kvo.html deleted file mode 100644 index 134b86b0a..000000000 --- a/block_based_kvo.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - block_based_kvo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Block Based KVO

- -

Prefer the new block based KVO API with keypaths when using Swift 3.2 or later

- -
    -
  • Identifier: block_based_kvo
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let observer = foo.observe(\.value, options: [.new]) { (foo, change) in
-   print(change.newValue)
-}
-
-

Triggering Examples

-
class Foo: NSObject {
-  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
-                              change: [NSKeyValueChangeKey : Any]?,
-                              context: UnsafeMutableRawPointer?) {}
-}
-
-
class Foo: NSObject {
-  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
-                              change: Dictionary<NSKeyValueChangeKey, Any>?,
-                              context: UnsafeMutableRawPointer?) {}
-}
-
- -
-
- - -
-
- - - diff --git a/capture_variable.html b/capture_variable.html deleted file mode 100644 index 624361383..000000000 --- a/capture_variable.html +++ /dev/null @@ -1,511 +0,0 @@ - - - - capture_variable Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Capture Variable

- -

Non-constant variables should not be listed in a closure’s capture list to avoid confusion about closures capturing variables at creation time

- -
    -
  • Identifier: capture_variable
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    let i: Int
-    init(_ i: Int) { self.i = i }
-}
-
-let j: Int = 0
-let c = C(1)
-
-let closure: () -> Void = { [j, c] in
-    print(c.i, j)
-}
-
-closure()
-
-
let iGlobal: Int = 0
-
-class C {
-    class var iClass: Int { 0 }
-    static let iStatic: Int = 0
-    let iInstance: Int = 0
-
-    func callTest() {
-        var iLocal: Int = 0
-        test { [unowned self, iGlobal, iInstance, iLocal, iClass=C.iClass, iStatic=C.iStatic] j in
-            print(iGlobal, iClass, iStatic, iInstance, iLocal, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
-
var j: Int!
-j = 0
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-
lazy var j: Int = { 0 }()
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-

Triggering Examples

-
var j: Int = 0
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-
class C {
-    let i: Int
-    init(_ i: Int) { self.i = i }
-}
-
-var c = C(0)
-let closure: () -> Void = { [c] in
-    print(c.i)
-}
-
-closure()
-c = C(1)
-closure()
-
-
var iGlobal: Int = 0
-
-class C {
-    func callTest() {
-        test { [iGlobal] j in
-            print(iGlobal, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
-
class C {
-    static var iStatic: Int = 0
-
-    static func callTest() {
-        test { [↓iStatic] j in
-            print(iStatic, j)
-        }
-    }
-
-    static func test(_ completionHandler: @escaping (Int) -> Void) {
-        completionHandler(2)
-        C.iStatic = 1
-        completionHandler(3)
-    }
-}
-
-C.callTest()
-
-
class C {
-    var iInstance: Int = 0
-
-    func callTest() {
-        test { [iInstance] j in
-            print(iInstance, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/class_delegate_protocol.html b/class_delegate_protocol.html deleted file mode 100644 index 27af2b2fe..000000000 --- a/class_delegate_protocol.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - class_delegate_protocol Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Class Delegate Protocol

- -

Delegate protocols should be class-only so they can be weakly referenced

- -
    -
  • Identifier: class_delegate_protocol
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol FooDelegate: class {}
-
-
protocol FooDelegate: class, BarDelegate {}
-
-
protocol Foo {}
-
-
class FooDelegate {}
-
-
@objc protocol FooDelegate {}
-
-
@objc(MyFooDelegate)
- protocol FooDelegate {}
-
-
protocol FooDelegate: BarDelegate {}
-
-
protocol FooDelegate: AnyObject {}
-
-
protocol FooDelegate: NSObjectProtocol {}
-
-
protocol FooDelegate where Self: BarDelegate {}
-
-
protocol FooDelegate where Self: AnyObject {}
-
-
protocol FooDelegate where Self: NSObjectProtocol {}
-
-

Triggering Examples

-
↓protocol FooDelegate {}
-
-
↓protocol FooDelegate: Bar {}
-
-
↓protocol FooDelegate where Self: StringProtocol {}
-
- -
-
- - -
-
- - - diff --git a/closing_brace.html b/closing_brace.html deleted file mode 100644 index 000c7dfca..000000000 --- a/closing_brace.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - closing_brace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closing Brace Spacing

- -

Closing brace with closing parenthesis should not have any whitespaces in the middle

- -
    -
  • Identifier: closing_brace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[].map({ })
-
-
[].map(
-  { }
-)
-
-

Triggering Examples

-
[].map({ ↓} )
-
-
[].map({ ↓}   )
-
- -
-
- - -
-
- - - diff --git a/closure_body_length.html b/closure_body_length.html deleted file mode 100644 index 8a12e02c1..000000000 --- a/closure_body_length.html +++ /dev/null @@ -1,1088 +0,0 @@ - - - - closure_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Body Length

- -

Closure bodies should not span too many lines

- -
    -
  • Identifier: closure_body_length
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -30 -
    -error - -100 -
  • -
-

Non Triggering Examples

-
foo.bar { $0 }
-
-
foo.bar { toto in
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar({ toto in
-})
-
-
foo.bar({ toto in
-    let a0 = 0
-})
-
-
foo.bar({ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}, anotherLabel: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}) { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}
-
-
let foo: Bar = { toto in
-    let bar = Bar()
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    return bar
-}()
-
-

Triggering Examples

-
foo.bar ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}
-
-
foo.bar ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar(↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}, anotherLabel: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}) ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}
-
-
let foo: Bar = ↓{ toto in
-    let bar = Bar()
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    return bar
-}()
-
- -
-
- - -
-
- - - diff --git a/closure_end_indentation.html b/closure_end_indentation.html deleted file mode 100644 index f56e7cb10..000000000 --- a/closure_end_indentation.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - closure_end_indentation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure End Indentation

- -

Closure end should have the same indentation as the line that started it.

- -
    -
  • Identifier: closure_end_indentation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
SignalProducer(values: [1, 2, 3])
-   .startWithNext { number in
-       print(number)
-   }
-
-
-
[1, 2].map { $0 + 1 }
-
-
-
return match(pattern: pattern, with: [.comment]).flatMap { range in
-   return Command(string: contents, range: range)
-}.flatMap { command in
-   return command.expand()
-}
-
-
-
foo(foo: bar,
-    options: baz) { _ in }
-
-
-
someReallyLongProperty.chainingWithAnotherProperty
-   .foo { _ in }
-
-
foo(abc, 123)
-{ _ in }
-
-
-
function(
-    closure: { x in
-        print(x)
-    },
-    anotherClosure: { y in
-        print(y)
-    })
-
-
function(parameter: param,
-         closure: { x in
-    print(x)
-})
-
-
function(parameter: param, closure: { x in
-        print(x)
-    },
-    anotherClosure: { y in
-        print(y)
-    })
-
-
(-variable).foo()
-
-

Triggering Examples

-
SignalProducer(values: [1, 2, 3])
-   .startWithNext { number in
-       print(number)
-↓}
-
-
-
return match(pattern: pattern, with: [.comment]).flatMap { range in
-   return Command(string: contents, range: range)
-   ↓}.flatMap { command in
-   return command.expand()
-↓}
-
-
-
function(
-    closure: { x in
-        print(x)
-↓},
-    anotherClosure: { y in
-        print(y)
-↓})
-
- -
-
- - -
-
- - - diff --git a/closure_parameter_position.html b/closure_parameter_position.html deleted file mode 100644 index 6b1f181da..000000000 --- a/closure_parameter_position.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - closure_parameter_position Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Parameter Position

- -

Closure parameters should be on the same line as opening brace

- -
    -
  • Identifier: closure_parameter_position
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
[1, 2].map { number -> Int in
- number + 1 
-}
-
-
[1, 2].map { (number: Int) -> Int in
- number + 1 
-}
-
-
[1, 2].map { [weak self] number in
- number + 1 
-}
-
-
[1, 2].something(closure: { number in
- number + 1 
-})
-
-
let isEmpty = [1, 2].isEmpty()
-
-
rlmConfiguration.migrationBlock.map { rlmMigration in
-    return { migration, schemaVersion in
-        rlmMigration(migration.rlmMigration, schemaVersion)
-    }
-}
-
-
let mediaView: UIView = { [weak self] index in
-   return UIView()
-}(index)
-
-

Triggering Examples

-
[1, 2].map {
-    ↓number in
-    number + 1
-}
-
-
[1, 2].map {
-    ↓number -> Int in
-    number + 1
-}
-
-
[1, 2].map {
-    (↓number: Int) -> Int in
-    number + 1
-}
-
-
[1, 2].map {
-    [weak ↓self] ↓number in
-    number + 1
-}
-
-
[1, 2].map { [weak self]
-    ↓number in
-    number + 1
-}
-
-
[1, 2].map({
-    ↓number in
-    number + 1
-})
-
-
[1, 2].something(closure: {
-    ↓number in
-    number + 1
-})
-
-
[1, 2].reduce(0) {
-    ↓sum, ↓number in
-    number + sum
-})
-
-
f.completionHandler = {
-    ↓thing in
-    doStuff()
-}
-
-
foo {
-    [weak ↓self] in
-    self?.bar()
-}
-
- -
-
- - -
-
- - - diff --git a/closure_spacing.html b/closure_spacing.html deleted file mode 100644 index 1f718e3e1..000000000 --- a/closure_spacing.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - closure_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Spacing

- -

Closure expressions should have a single space inside each brace

- -
    -
  • Identifier: closure_spacing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[].map ({ $0.description })
-
-
[].filter { $0.contains(location) }
-
-
extension UITableViewCell: ReusableView { }
-
-
extension UITableViewCell: ReusableView {}
-
-

Triggering Examples

-
[].filter↓{ $0.contains(location) }
-
-
[].filter(↓{$0.contains(location)})
-
-
[].map(↓{$0})
-
-
(↓{each in return result.contains(where: ↓{e in return e}) }).count
-
-
filter ↓{ sorted ↓{ $0 < $1}}
-
- -
-
- - -
-
- - - diff --git a/collection_alignment.html b/collection_alignment.html deleted file mode 100644 index a5e27cbb0..000000000 --- a/collection_alignment.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - collection_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Collection Element Alignment

- -

All elements in a collection literal should be vertically aligned

- -
    -
  • Identifier: collection_alignment
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -align_colons - -false -
  • -
-

Non Triggering Examples

-
doThings(arg: [
-    "foo": 1,
-    "bar": 2,
-    "fizz": 2,
-    "buzz": 2
-])
-
-
let abc = [
-    "alpha": "a",
-    "beta": "b",
-    "gamma": "g",
-    "delta": "d",
-    "epsilon": "e"
-]
-
-
let meals = [
-                "breakfast": "oatmeal",
-                "lunch": "sandwich",
-                "dinner": "burger"
-]
-
-
NSAttributedString(string: "…", attributes: [.font: UIFont.systemFont(ofSize: 12, weight: .regular),
-                                             .foregroundColor: UIColor(white: 0, alpha: 0.2)])
-
-
let coordinates = [
-    CLLocationCoordinate2D(latitude: 0, longitude: 33),
-    CLLocationCoordinate2D(latitude: 0, longitude: 66),
-    CLLocationCoordinate2D(latitude: 0, longitude: 99)
-]
-
-
var evenNumbers: Set<Int> = [
-    2,
-    4,
-    6
-]
-
-
let abc = [1, 2, 3, 4]
-
-
let abc = [
-    1, 2, 3, 4
-]
-
-
let abc = [
-    "foo": "bar", "fizz": "buzz"
-]
-
-

Triggering Examples

-
doThings(arg: [
-    "foo": 1,
-    "bar": 2,
-   ↓"fizz": 2,
-   ↓"buzz": 2
-])
-
-
let abc = [
-    "alpha": "a",
-     ↓"beta": "b",
-    "gamma": "g",
-    "delta": "d",
-  ↓"epsilon": "e"
-]
-
-
let meals = [
-                "breakfast": "oatmeal",
-                "lunch": "sandwich",
-    ↓"dinner": "burger"
-]
-
-
let coordinates = [
-    CLLocationCoordinate2D(latitude: 0, longitude: 33),
-        ↓CLLocationCoordinate2D(latitude: 0, longitude: 66),
-    CLLocationCoordinate2D(latitude: 0, longitude: 99)
-]
-
-
var evenNumbers: Set<Int> = [
-    2,
-  ↓4,
-    6
-]
-
- -
-
- - -
-
- - - diff --git a/colon.html b/colon.html deleted file mode 100644 index d11de7305..000000000 --- a/colon.html +++ /dev/null @@ -1,618 +0,0 @@ - - - - colon Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Colon Spacing

- -

Colons should be next to the identifier when specifying a type and next to the key in dictionary literals

- -
    -
  • Identifier: colon
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -flexible_right_spacing - -false -
    -apply_to_dictionaries - -true -
  • -
-

Non Triggering Examples

-
let abc: Void
-
-
let abc: [Void: Void]
-
-
let abc: (Void, Void)
-
-
let abc: ([Void], String, Int)
-
-
let abc: [([Void], String, Int)]
-
-
let abc: String="def"
-
-
let abc: Int=0
-
-
let abc: Enum=Enum.Value
-
-
func abc(def: Void) {}
-
-
func abc(def: Void, ghi: Void) {}
-
-
let abc: String = "abc:"
-
-
let abc = [Void: Void]()
-
-
let abc = [1: [3: 2], 3: 4]
-
-
let abc = ["string": "string"]
-
-
let abc = ["string:string": "string"]
-
-
let abc: [String: Int]
-
-
func foo(bar: [String: Int]) {}
-
-
func foo() -> [String: Int] { return [:] }
-
-
let abc: Any
-
-
let abc: [Any: Int]
-
-
let abc: [String: Any]
-
-
class Foo: Bar {}
-
-
class Foo<T>: Bar {}
-
-
class Foo<T: Equatable>: Bar {}
-
-
class Foo<T, U>: Bar {}
-
-
class Foo<T: Equatable> {}
-
-
object.method(x: /* comment */ 5)
-
-
switch foo {
-case .bar:
-    _ = something()
-}
-
-
object.method(x: 5, y: "string")
-
-
object.method(x: 5, y:
-              "string")
-
-
object.method(5, y: "string")
-
-
func abc() { def(ghi: jkl) }
-
-
func abc(def: Void) { ghi(jkl: mno) }
-
-
class ABC { let def = ghi(jkl: mno) } }
-
-
func foo() { let dict = [1: 1] }
-
-
let aaa = Self.bbb ? Self.ccc : Self.ddd else {
-return nil
-Example("}
-
-
range.flatMap(file.syntaxMap.kinds(inByteRange:)) ?? []
-
-
@objc(receiveReply:)
-public class func receiveReply(_ reply: bad_instruction_exception_reply_t) -> CInt { 0 }
-
-
switch str {
-case "adlm", "adlam":             return .adlam
-case "aghb", "caucasianalbanian": return .caucasianAlbanian
-default:                          return nil
-}
-
-
precedencegroup PipelinePrecedence {
-  associativity: left
-}
-infix operator |> : PipelinePrecedence
-
-
switch scalar {
-  case 0x000A...0x000D /* LF ... CR */: return true
-  case 0x0085 /* NEXT LINE (NEL) */: return true
-  case 0x2028 /* LINE SEPARATOR */: return true
-  case 0x2029 /* PARAGRAPH SEPARATOR */: return true
-  default: return false
-}
-
-

Triggering Examples

-
let abc↓:Void
-
-
let abc↓:  Void
-
-
let abc↓ :Void
-
-
let abc↓ : Void
-
-
let abc↓ : [Void: Void]
-
-
let abc↓ : (Void, String, Int)
-
-
let abc↓ : ([Void], String, Int)
-
-
let abc↓ : [([Void], String, Int)]
-
-
let abc↓:  (Void, String, Int)
-
-
let abc↓:  ([Void], String, Int)
-
-
let abc↓:  [([Void], String, Int)]
-
-
let abc↓ :String="def"
-
-
let abc↓ :Int=0
-
-
let abc↓ :Int = 0
-
-
let abc↓:Int=0
-
-
let abc↓:Int = 0
-
-
let abc↓:Enum=Enum.Value
-
-
func abc(def↓:Void) {}
-
-
func abc(def↓:  Void) {}
-
-
func abc(def↓ :Void) {}
-
-
func abc(def↓ : Void) {}
-
-
func abc(def: Void, ghi↓ :Void) {}
-
-
let abc = [Void↓:Void]()
-
-
let abc = [Void↓ : Void]()
-
-
let abc = [Void↓:  Void]()
-
-
let abc = [Void↓ :  Void]()
-
-
let abc = [1: [3↓ : 2], 3: 4]
-
-
let abc = [1: [3↓ : 2], 3↓:  4]
-
-
let abc: [String↓ : Int]
-
-
let abc: [String↓:Int]
-
-
func foo(bar: [String↓ : Int]) {}
-
-
func foo(bar: [String↓:Int]) {}
-
-
func foo() -> [String↓ : Int] { return [:] }
-
-
func foo() -> [String↓:Int] { return [:] }
-
-
let abc↓ : Any
-
-
let abc: [Any↓ : Int]
-
-
let abc: [String↓ : Any]
-
-
class Foo↓ : Bar {}
-
-
class Foo↓:Bar {}
-
-
class Foo<T>↓ : Bar {}
-
-
class Foo<T>↓:Bar {}
-
-
class Foo<T, U>↓:Bar {}
-
-
class Foo<T: Equatable>↓:Bar {}
-
-
class Foo<T↓:Equatable> {}
-
-
class Foo<T↓ : Equatable> {}
-
-
object.method(x: 5, y↓ : "string")
-
-
object.method(x↓:5, y: "string")
-
-
object.method(x↓:  5, y: "string")
-
-
func abc() { def(ghi↓:jkl) }
-
-
func abc(def: Void) { ghi(jkl↓:mno) }
-
-
class ABC { let def = ghi(jkl↓:mno) } }
-
-
func foo() { let dict = [1↓ : 1] }
-
-
switch foo {
-case .bar↓ : return baz
-}
-
-
private var action↓:(() -> Void)?
-
- -
-
- - -
-
- - - diff --git a/comma.html b/comma.html deleted file mode 100644 index 330e09ab0..000000000 --- a/comma.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - comma Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comma Spacing

- -

There should be no space before and one after any comma

- -
    -
  • Identifier: comma
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func abc(a: String, b: String) { }
-
-
abc(a: "string", b: "string"
-
-
enum a { case a, b, c }
-
-
func abc(
-  a: String,  // comment
-  bcd: String // comment
-) {
-}
-
-
func abc(
-  a: String,
-  bcd: String
-) {
-}
-
-
#imageLiteral(resourceName: "foo,bar,baz")
-
-
kvcStringBuffer.advanced(by: rootKVCLength)
-  .storeBytes(of: 0x2E /* '.' */, as: CChar.self)
-
-

Triggering Examples

-
func abc(a: String↓ ,b: String) { }
-
-
func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }
-
-
abc(a: "string"↓,b: "string"
-
-
enum a { case a↓ ,b }
-
-
let result = plus(
-    first: 3↓ , // #683
-    second: 4
-)
-
-
Foo(
-  parameter: a.b.c,
-  tag: a.d,
-  value: a.identifier.flatMap { Int64($0) }↓ ,
-  reason: Self.abcd()
-)
-
-
return Foo(bar: .baz, title: fuzz,
-          message: My.Custom.message↓ ,
-          another: parameter, doIt: true,
-          alignment: .center)
-
-
Logger.logError("Hat is too large"↓,  info: [])
-
- -
-
- - -
-
- - - diff --git a/comma_inheritance.html b/comma_inheritance.html deleted file mode 100644 index 92a759a12..000000000 --- a/comma_inheritance.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - comma_inheritance Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comma Inheritance Rule

- -

Use commas to separate types in inheritance lists

- -
    -
  • Identifier: comma_inheritance
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct A: Codable, Equatable {}
-
-
enum B: Codable, Equatable {}
-
-
class C: Codable, Equatable {}
-
-
protocol D: Codable, Equatable {}
-
-
typealias E = Equatable & Codable
-
-
func foo<T: Equatable & Codable>(_ param: T) {}
-
-
protocol G {
-    associatedtype Model: Codable, Equatable
-}
-
-

Triggering Examples

-
struct A: Codable↓ & Equatable {}
-
-
struct A: Codable↓  & Equatable {}
-
-
struct A: Codable↓&Equatable {}
-
-
struct A: Codable↓& Equatable {}
-
-
enum B: Codable↓ & Equatable {}
-
-
class C: Codable↓ & Equatable {}
-
-
protocol D: Codable↓ & Equatable {}
-
-
protocol G {
-    associatedtype Model: Codable↓ & Equatable
-}
-
- -
-
- - -
-
- - - diff --git a/comment_spacing.html b/comment_spacing.html deleted file mode 100644 index 67cfdceea..000000000 --- a/comment_spacing.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - comment_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comment Spacing

- -

Prefer at least one space after slashes for comments

- -
    -
  • Identifier: comment_spacing
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// This is a comment
-
-
/// Triple slash comment
-
-
// Multiline double-slash
-// comment
-
-
/// Multiline triple-slash
-/// comment
-
-
/// Multiline triple-slash
-///   - This is indented
-
-
// - MARK: Mark comment
-
-
//: Swift Playground prose section
-
-
///////////////////////////////////////////////
-// Comment with some lines of slashes boxing it
-///////////////////////////////////////////////
-
-
//:#localized(key: "SwiftPlaygroundLocalizedProse")
-
-
/* Asterisk comment */
-
-
/*
-    Multiline asterisk comment
-*/
-
-
/*:
-    Multiline Swift Playground prose section
-*/
-
-
/*#-editable-code Swift Platground editable area*/default/*#-end-editable-code*/
-
-

Triggering Examples

-
//↓Something
-
-
//↓MARK
-
-
//↓👨‍👨‍👦‍👦Something
-
-
func a() {
-    //↓This needs refactoring
-    print("Something")
-}
-//↓We should improve above function
-
-
///↓This is a comment
-
-
/// Multiline triple-slash
-///↓This line is incorrect, though
-
-
//↓- MARK: Mark comment
-
-
//:↓Swift Playground prose section
-
- -
-
- - -
-
- - - diff --git a/compiler_protocol_init.html b/compiler_protocol_init.html deleted file mode 100644 index 124f170b2..000000000 --- a/compiler_protocol_init.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - compiler_protocol_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Compiler Protocol Init

- -

The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn’t be called directly.

- -
    -
  • Identifier: compiler_protocol_init
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let set: Set<Int> = [1, 2]
-
-
let set = Set(array)
-
-

Triggering Examples

-
let set = ↓Set(arrayLiteral: 1, 2)
-
-
let set = ↓Set (arrayLiteral: 1, 2)
-
-
let set = ↓Set.init(arrayLiteral: 1, 2)
-
-
let set = ↓Set.init(arrayLiteral : 1, 2)
-
- -
-
- - -
-
- - - diff --git a/computed_accessors_order.html b/computed_accessors_order.html deleted file mode 100644 index eb2fc78e9..000000000 --- a/computed_accessors_order.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - computed_accessors_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Computed Accessors Order

- -

Getter and setters in computed properties and subscripts should be in a consistent order.

- -
    -
  • Identifier: computed_accessors_order
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -get_set -
  • -
-

Non Triggering Examples

-
class Foo {
-    var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int
-}
-
-
class Foo {
-    var foo: Int {
-        return getValueFromDisk()
-    }
-}
-
-
class Foo {
-    var foo: String {
-        return "get"
-    }
-}
-
-
protocol Foo {
-    var foo: Int { get }
-
-
protocol Foo {
-    var foo: Int { get set }
-}
-
-
protocol Foo {
-    var foo: Int { set get }
-
-
class Foo {
-    var foo: Int {
-        struct Bar {
-            var bar: Int {
-                get { return 1 }
-                set { _ = newValue }
-            }
-        }
-
-        return Bar().bar
-    }
-}
-
-
var _objCTaggedPointerBits: UInt {
-    @inline(__always) get { return 0 }
-    set { print(newValue) }
-}
-
-
var next: Int? {
-    mutating get {
-        defer { self.count += 1 }
-        return self.count
-    }
-    set {
-        self.count = newValue
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set { self._bar = newValue }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set(newValue) { self._bar = newValue }
-    }
-}
-
-
extension Reactive where Base: UITapGestureRecognizer {
-    var tapped: CocoaAction<Base>? {
-        get {
-            return associatedAction.withValue { $0.flatMap { $0.action } }
-        }
-        nonmutating set {
-            setAction(newValue)
-        }
-    }
-}
-
-
extension Test {
-    var foo: Bool {
-        get {
-            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
-        }
-        set {
-            bar = NSNumber(value: newValue as Bool)
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        return 20
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get set }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { set get }
-}
-
-

Triggering Examples

-
class Foo {
-    var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
-
var foo: Int {
-    ↓set { print(newValue) }
-    get { return 20 }
-}
-
-
extension Foo {
-    var bar: Bool {
-        ↓set { print(bar) }
-        get { _bar }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        mutating get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        ↓set {
-            print(i)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/conditional_returns_on_newline.html b/conditional_returns_on_newline.html deleted file mode 100644 index f19e66807..000000000 --- a/conditional_returns_on_newline.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - conditional_returns_on_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Conditional Returns on Newline

- -

Conditional statements should always return on the next line

- -
    -
  • Identifier: conditional_returns_on_newline
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -if_only - -false -
  • -
-

Non Triggering Examples

-
guard true else {
- return true
-}
-
-
guard true,
- let x = true else {
- return true
-}
-
-
if true else {
- return true
-}
-
-
if true,
- let x = true else {
- return true
-}
-
-
if textField.returnKeyType == .Next {
-
-
if true { // return }
-
-
guard something
-else { return }
-
-

Triggering Examples

-
↓guard true else { return }
-
-
↓if true { return }
-
-
↓if true { break } else { return }
-
-
↓if true { break } else {       return }
-
-
↓if true { return "YES" } else { return "NO" }
-
-
↓guard condition else { XCTFail(); return }
-
- -
-
- - -
-
- - - diff --git a/contains_over_filter_count.html b/contains_over_filter_count.html deleted file mode 100644 index de25b9f03..000000000 --- a/contains_over_filter_count.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - contains_over_filter_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Filter Count

- -

Prefer contains over comparing filter(where:).count to 0

- -
    -
  • Identifier: contains_over_filter_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count > 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 01
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count == 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 01
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count != 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 01
-
-
let result = myList.contains(where: { $0 % 2 == 0 })
-
-
let result = !myList.contains(where: { $0 % 2 == 0 })
-
-
let result = myList.contains(10)
-
-

Triggering Examples

-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count > 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count > 0
-
-
let result = ↓myList.filter(where: someFunction).count > 0
-
-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count == 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count == 0
-
-
let result = ↓myList.filter(where: someFunction).count == 0
-
-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count != 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count != 0
-
-
let result = ↓myList.filter(where: someFunction).count != 0
-
- -
-
- - -
-
- - - diff --git a/contains_over_filter_is_empty.html b/contains_over_filter_is_empty.html deleted file mode 100644 index cb0757a58..000000000 --- a/contains_over_filter_is_empty.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - contains_over_filter_is_empty Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Filter is Empty

- -

Prefer contains over using filter(where:).isEmpty

- -
    -
  • Identifier: contains_over_filter_is_empty
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count > 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count == 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count != 1
-
-
let result = myList.contains(where: { $0 % 2 == 0 })
-
-
let result = !myList.contains(where: { $0 % 2 == 0 })
-
-
let result = myList.contains(10)
-
-

Triggering Examples

-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
-
-
let result = !↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.isEmpty
-
-
let result = ↓myList.filter(where: someFunction).isEmpty
-
- -
-
- - -
-
- - - diff --git a/contains_over_first_not_nil.html b/contains_over_first_not_nil.html deleted file mode 100644 index 21f676408..000000000 --- a/contains_over_first_not_nil.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - contains_over_first_not_nil Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over First not Nil

- -

Prefer contains over first(where:) != nil and firstIndex(where:) != nil.

- -
    -
  • Identifier: contains_over_first_not_nil
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let first = myList.first(where: { $0 % 2 == 0 })
-
-
let first = myList.first { $0 % 2 == 0 }
-
-
let firstIndex = myList.firstIndex(where: { $0 % 2 == 0 })
-
-
let firstIndex = myList.firstIndex { $0 % 2 == 0 }
-
-

Triggering Examples

-
↓myList.first { $0 % 2 == 0 } != nil
-
-
↓myList.first(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.first(where: someFunction) != nil
-
-
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } != nil
-
-
(↓myList.first { $0 % 2 == 0 }) != nil
-
-
↓myList.first { $0 % 2 == 0 } == nil
-
-
↓myList.first(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.first(where: someFunction) == nil
-
-
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } == nil
-
-
(↓myList.first { $0 % 2 == 0 }) == nil
-
-
↓myList.firstIndex { $0 % 2 == 0 } != nil
-
-
↓myList.firstIndex(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.firstIndex(where: someFunction) != nil
-
-
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } != nil
-
-
(↓myList.firstIndex { $0 % 2 == 0 }) != nil
-
-
↓myList.firstIndex { $0 % 2 == 0 } == nil
-
-
↓myList.firstIndex(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.firstIndex(where: someFunction) == nil
-
-
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } == nil
-
-
(↓myList.firstIndex { $0 % 2 == 0 }) == nil
-
- -
-
- - -
-
- - - diff --git a/contains_over_range_nil_comparison.html b/contains_over_range_nil_comparison.html deleted file mode 100644 index cf1e520bb..000000000 --- a/contains_over_range_nil_comparison.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - contains_over_range_nil_comparison Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Range Comparison to Nil

- -

Prefer contains over range(of:) != nil and range(of:) == nil

- -
    -
  • Identifier: contains_over_range_nil_comparison
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let range = myString.range(of: "Test")
-
-
myString.contains("Test")
-
-
!myString.contains("Test")
-
-
resourceString.range(of: rule.regex, options: .regularExpression) != nil
-
-

Triggering Examples

-
↓myString.range(of: "Test") != nil
-
-
↓myString.range(of: "Test") == nil
-
- -
-
- - -
-
- - - diff --git a/control_statement.html b/control_statement.html deleted file mode 100644 index 2d8608c57..000000000 --- a/control_statement.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - control_statement Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Control Statement

- -

if, for, guard, switch, while, and catch statements shouldn’t unnecessarily wrap their conditionals or arguments in parentheses

- -
    -
  • Identifier: control_statement
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if condition {}
-
-
if (a, b) == (0, 1) {}
-
-
if (a || b) && (c || d) {}
-
-
if (min...max).contains(value) {}
-
-
if renderGif(data) {}
-
-
renderGif(data)
-
-
guard condition else {}
-
-
while condition {}
-
-
do {} while condition {}
-
-
do { ; } while condition {}
-
-
switch foo {}
-
-
do {} catch let error as NSError {}
-
-
foo().catch(all: true) {}
-
-
if max(a, b) < c {}
-
-
switch (lhs, rhs) {}
-
-
if (f() { g() {} }) {}
-
-
if (a + f() {} == 1) {}
-
-

Triggering Examples

-
↓if (condition) {}
-
-
↓if(condition) {}
-
-
↓if (condition == endIndex) {}
-
-
↓if ((a || b) && (c || d)) {}
-
-
↓if ((min...max).contains(value)) {}
-
-
↓guard (condition) else {}
-
-
↓while (condition) {}
-
-
↓while(condition) {}
-
-
do { ; } ↓while(condition) {}
-
-
do { ; } ↓while (condition) {}
-
-
↓switch (foo) {}
-
-
do {} ↓catch(let error as NSError) {}
-
-
↓if (max(a, b) < c) {}
-
- -
-
- - -
-
- - - diff --git a/convenience_type.html b/convenience_type.html deleted file mode 100644 index fed6d6fb9..000000000 --- a/convenience_type.html +++ /dev/null @@ -1,467 +0,0 @@ - - - - convenience_type Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Convenience Type

- -

Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation

- -
    -
  • Identifier: convenience_type
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Math { // enum
-  public static let pi = 3.14
-}
-
-
// class with inheritance
-class MathViewController: UIViewController {
-  public static let pi = 3.14
-}
-
-
@objc class Math: NSObject { // class visible to Obj-C
-  public static let pi = 3.14
-}
-
-
struct Math { // type with non-static declarations
-  public static let pi = 3.14
-  public let randomNumber = 2
-}
-
-
class DummyClass {}
-
-
class Foo: NSObject { // class with Obj-C class property
-    class @objc let foo = 1
-}
-
-
class Foo: NSObject { // class with Obj-C static property
-    static @objc let foo = 1
-}
-
-
class Foo { // @objc class func can't exist on an enum
-   @objc class func foo() {}
-}
-
-
class Foo { // @objc static func can't exist on an enum
-   @objc static func foo() {}
-}
-
-
@objcMembers class Foo { // @objc static func can't exist on an enum
-   static func foo() {}
-}
-
-
final class Foo { // final class, but @objc class func can't exist on an enum
-   @objc class func foo() {}
-}
-
-
final class Foo { // final class, but @objc static func can't exist on an enum
-   @objc static func foo() {}
-}
-
-
@globalActor actor MyActor {
-  static let shared = MyActor()
-}
-
-

Triggering Examples

-
↓struct Math {
-  public static let pi = 3.14
-}
-
-
↓struct Math {
-  public static let pi = 3.14
-  @available(*, unavailable) init() {}
-}
-
-
final ↓class Foo { // final class can't be inherited
-    class let foo = 1
-}
-
-
↓class Foo {
-    class let foo = 1
-}
-
-
↓class Foo {
-    final class let foo = 1
-}
-
-
↓class SomeClass {
-    static func foo() {}
-}
-
- -
-
- - -
-
- - - diff --git a/css/highlight.css b/css/highlight.css deleted file mode 100644 index c170357ce..000000000 --- a/css/highlight.css +++ /dev/null @@ -1,202 +0,0 @@ -/*! Jazzy - https://github.com/realm/jazzy - * Copyright Realm Inc. - * SPDX-License-Identifier: MIT - */ -/* Credit to https://gist.github.com/wataru420/2048287 */ -.highlight .c { - color: #999988; - font-style: italic; } - -.highlight .err { - color: #a61717; - background-color: #e3d2d2; } - -.highlight .k { - color: #000000; - font-weight: bold; } - -.highlight .o { - color: #000000; - font-weight: bold; } - -.highlight .cm { - color: #999988; - font-style: italic; } - -.highlight .cp { - color: #999999; - font-weight: bold; } - -.highlight .c1 { - color: #999988; - font-style: italic; } - -.highlight .cs { - color: #999999; - font-weight: bold; - font-style: italic; } - -.highlight .gd { - color: #000000; - background-color: #ffdddd; } - -.highlight .gd .x { - color: #000000; - background-color: #ffaaaa; } - -.highlight .ge { - color: #000000; - font-style: italic; } - -.highlight .gr { - color: #aa0000; } - -.highlight .gh { - color: #999999; } - -.highlight .gi { - color: #000000; - background-color: #ddffdd; } - -.highlight .gi .x { - color: #000000; - background-color: #aaffaa; } - -.highlight .go { - color: #888888; } - -.highlight .gp { - color: #555555; } - -.highlight .gs { - font-weight: bold; } - -.highlight .gu { - color: #aaaaaa; } - -.highlight .gt { - color: #aa0000; } - -.highlight .kc { - color: #000000; - font-weight: bold; } - -.highlight .kd { - color: #000000; - font-weight: bold; } - -.highlight .kp { - color: #000000; - font-weight: bold; } - -.highlight .kr { - color: #000000; - font-weight: bold; } - -.highlight .kt { - color: #445588; } - -.highlight .m { - color: #009999; } - -.highlight .s { - color: #d14; } - -.highlight .na { - color: #008080; } - -.highlight .nb { - color: #0086B3; } - -.highlight .nc { - color: #445588; - font-weight: bold; } - -.highlight .no { - color: #008080; } - -.highlight .ni { - color: #800080; } - -.highlight .ne { - color: #990000; - font-weight: bold; } - -.highlight .nf { - color: #990000; } - -.highlight .nn { - color: #555555; } - -.highlight .nt { - color: #000080; } - -.highlight .nv { - color: #008080; } - -.highlight .ow { - color: #000000; - font-weight: bold; } - -.highlight .w { - color: #bbbbbb; } - -.highlight .mf { - color: #009999; } - -.highlight .mh { - color: #009999; } - -.highlight .mi { - color: #009999; } - -.highlight .mo { - color: #009999; } - -.highlight .sb { - color: #d14; } - -.highlight .sc { - color: #d14; } - -.highlight .sd { - color: #d14; } - -.highlight .s2 { - color: #d14; } - -.highlight .se { - color: #d14; } - -.highlight .sh { - color: #d14; } - -.highlight .si { - color: #d14; } - -.highlight .sx { - color: #d14; } - -.highlight .sr { - color: #009926; } - -.highlight .s1 { - color: #d14; } - -.highlight .ss { - color: #990073; } - -.highlight .bp { - color: #999999; } - -.highlight .vc { - color: #008080; } - -.highlight .vg { - color: #008080; } - -.highlight .vi { - color: #008080; } - -.highlight .il { - color: #009999; } diff --git a/css/jazzy.css b/css/jazzy.css deleted file mode 100644 index c7bb9fe22..000000000 --- a/css/jazzy.css +++ /dev/null @@ -1,404 +0,0 @@ -/*! Jazzy - https://github.com/realm/jazzy - * Copyright Realm Inc. - * SPDX-License-Identifier: MIT - */ -*, *:before, *:after { - box-sizing: inherit; } - -body { - margin: 0; - background: #fff; - color: #333; - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: .2px; - -webkit-font-smoothing: antialiased; - box-sizing: border-box; } - -h1 { - font-size: 2rem; - font-weight: 700; - margin: 1.275em 0 0.6em; } - -h2 { - font-size: 1.75rem; - font-weight: 700; - margin: 1.275em 0 0.3em; } - -h3 { - font-size: 1.5rem; - font-weight: 700; - margin: 1em 0 0.3em; } - -h4 { - font-size: 1.25rem; - font-weight: 700; - margin: 1.275em 0 0.85em; } - -h5 { - font-size: 1rem; - font-weight: 700; - margin: 1.275em 0 0.85em; } - -h6 { - font-size: 1rem; - font-weight: 700; - margin: 1.275em 0 0.85em; - color: #777; } - -p { - margin: 0 0 1em; } - -ul, ol { - padding: 0 0 0 2em; - margin: 0 0 0.85em; } - -blockquote { - margin: 0 0 0.85em; - padding: 0 15px; - color: #858585; - border-left: 4px solid #e5e5e5; } - -img { - max-width: 100%; } - -a { - color: #4183c4; - text-decoration: none; } - a:hover, a:focus { - outline: 0; - text-decoration: underline; } - a.discouraged { - text-decoration: line-through; } - a.discouraged:hover, a.discouraged:focus { - text-decoration: underline line-through; } - -table { - background: #fff; - width: 100%; - border-collapse: collapse; - border-spacing: 0; - overflow: auto; - margin: 0 0 0.85em; } - -tr:nth-child(2n) { - background-color: #fbfbfb; } - -th, td { - padding: 6px 13px; - border: 1px solid #ddd; } - -hr { - height: 1px; - border: none; - background-color: #ddd; } - -pre { - margin: 0 0 1.275em; - padding: .85em 1em; - overflow: auto; - background: #f7f7f7; - font-size: .85em; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } - -code { - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } - -.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { - background: #f7f7f7; - padding: .2em; } - .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { - letter-spacing: -.2em; - content: "\00a0"; } - -pre code { - padding: 0; - white-space: pre; } - -.content-wrapper { - display: flex; - flex-direction: column; } - @media (min-width: 768px) { - .content-wrapper { - flex-direction: row; } } -.header { - display: flex; - padding: 8px; - font-size: 0.875em; - background: #444; - color: #999; } - -.header-col { - margin: 0; - padding: 0 8px; } - -.header-col--primary { - flex: 1; } - -.header-link { - color: #fff; } - -.header-icon { - padding-right: 2px; - vertical-align: -3px; - height: 16px; } - -.breadcrumbs { - font-size: 0.875em; - padding: 8px 16px; - margin: 0; - background: #fbfbfb; - border-bottom: 1px solid #ddd; } - -.carat { - height: 10px; - margin: 0 5px; } - -.navigation { - order: 2; } - @media (min-width: 768px) { - .navigation { - order: 1; - width: 25%; - max-width: 300px; - padding-bottom: 64px; - overflow: hidden; - word-wrap: normal; - background: #fbfbfb; - border-right: 1px solid #ddd; } } -.nav-groups { - list-style-type: none; - padding-left: 0; } - -.nav-group-name { - border-bottom: 1px solid #ddd; - padding: 8px 0 8px 16px; } - -.nav-group-name-link { - color: #333; } - -.nav-group-tasks { - margin: 8px 0; - padding: 0 0 0 8px; } - -.nav-group-task { - font-size: 1em; - list-style-type: none; - white-space: nowrap; } - -.nav-group-task-link { - color: #808080; } - -.main-content { - order: 1; } - @media (min-width: 768px) { - .main-content { - order: 2; - flex: 1; - padding-bottom: 60px; } } -.section { - padding: 0 32px; - border-bottom: 1px solid #ddd; } - -.section-content { - max-width: 834px; - margin: 0 auto; - padding: 16px 0; } - -.section-name { - color: #666; - display: block; } - .section-name p { - margin-bottom: inherit; } - -.declaration .highlight { - overflow-x: initial; - padding: 8px 0; - margin: 0; - background-color: transparent; - border: none; } - -.task-group-section { - border-top: 1px solid #ddd; } - -.task-group { - padding-top: 0px; } - -.task-name-container a[name]:before { - content: ""; - display: block; } - -.section-name-container { - position: relative; } - .section-name-container .section-name-link { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - margin-bottom: 0; } - .section-name-container .section-name { - position: relative; - pointer-events: none; - z-index: 1; } - .section-name-container .section-name a { - pointer-events: auto; } - -.item-container { - padding: 0; } - -.item { - padding-top: 8px; - width: 100%; - list-style-type: none; } - .item a[name]:before { - content: ""; - display: block; } - .item .token, .item .direct-link { - display: inline-block; - text-indent: -20px; - padding-left: 3px; - margin-left: 20px; - font-size: 1rem; } - .item .declaration-note { - font-size: .85em; - color: #808080; - font-style: italic; } - -.pointer-container { - border-bottom: 1px solid #ddd; - left: -23px; - padding-bottom: 13px; - position: relative; - width: 110%; } - -.pointer { - left: 21px; - top: 7px; - display: block; - position: absolute; - width: 12px; - height: 12px; - border-left: 1px solid #ddd; - border-top: 1px solid #ddd; - background: #fff; - transform: rotate(45deg); } - -.height-container { - display: none; - position: relative; - width: 100%; - overflow: hidden; } - .height-container .section { - background: #fff; - border: 1px solid #ddd; - border-top-width: 0; - padding-top: 10px; - padding-bottom: 5px; - padding: 8px 16px; } - -.aside, .language { - padding: 6px 12px; - margin: 12px 0; - border-left: 5px solid #dddddd; - overflow-y: hidden; } - .aside .aside-title, .language .aside-title { - font-size: 9px; - letter-spacing: 2px; - text-transform: uppercase; - padding-bottom: 0; - margin: 0; - color: #aaa; - -webkit-user-select: none; } - .aside p:last-child, .language p:last-child { - margin-bottom: 0; } - -.language { - border-left: 5px solid #cde9f4; } - .language .aside-title { - color: #4183c4; } - -.aside-warning, .aside-deprecated, .aside-unavailable { - border-left: 5px solid #ff6666; } - .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { - color: #ff0000; } - -.graybox { - border-collapse: collapse; - width: 100%; } - .graybox p { - margin: 0; - word-break: break-word; - min-width: 50px; } - .graybox td { - border: 1px solid #ddd; - padding: 5px 25px 5px 10px; - vertical-align: middle; } - .graybox tr td:first-of-type { - text-align: right; - padding: 7px; - vertical-align: top; - word-break: normal; - width: 40px; } - -.slightly-smaller { - font-size: 0.9em; } - -.footer { - padding: 8px 16px; - background: #444; - color: #ddd; - font-size: 0.8em; } - .footer p { - margin: 8px 0; } - .footer a { - color: #fff; } - -html.dash .header, html.dash .breadcrumbs, html.dash .navigation { - display: none; } - -html.dash .height-container { - display: block; } - -form[role=search] input { - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 24px; - padding: 0 10px; - margin: 0; - border: none; - border-radius: 1em; } - .loading form[role=search] input { - background: white url(../img/spinner.gif) center right 4px no-repeat; } - -form[role=search] .tt-menu { - margin: 0; - min-width: 300px; - background: #fbfbfb; - color: #333; - border: 1px solid #ddd; } - -form[role=search] .tt-highlight { - font-weight: bold; } - -form[role=search] .tt-suggestion { - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 0 8px; } - form[role=search] .tt-suggestion span { - display: table-cell; - white-space: nowrap; } - form[role=search] .tt-suggestion .doc-parent-name { - width: 100%; - text-align: right; - font-weight: normal; - font-size: 0.9em; - padding-left: 16px; } - -form[role=search] .tt-suggestion:hover, -form[role=search] .tt-suggestion.tt-cursor { - cursor: pointer; - background-color: #4183c4; - color: #fff; } - -form[role=search] .tt-suggestion:hover .doc-parent-name, -form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { - color: #fff; } diff --git a/custom_rules.html b/custom_rules.html deleted file mode 100644 index 6c46a9a8e..000000000 --- a/custom_rules.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - custom_rules Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Custom Rules

- -

Create custom rules by providing a regex string. Optionally specify what syntax kinds to match against, the severity level, and what message to display.

- -
    -
  • Identifier: custom_rules
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
- -
-
- - -
-
- - - diff --git a/cyclomatic_complexity.html b/cyclomatic_complexity.html deleted file mode 100644 index 74dc985ed..000000000 --- a/cyclomatic_complexity.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - cyclomatic_complexity Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Cyclomatic Complexity

- -

Complexity of function bodies should be limited.

- -
    -
  • Identifier: cyclomatic_complexity
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -10 -
    -error - -20 -
    -ignores_case_statements - -false -
  • -
-

Non Triggering Examples

-
func f1() {
-    if true {
-        for _ in 1..5 { }
-    }
-    if false { }
-}
-
-
func f(code: Int) -> Int {
-    switch code {
-    case 0: fallthrough
-    case 1: return 1
-    case 2: return 1
-    case 3: return 1
-    case 4: return 1
-    case 5: return 1
-    case 6: return 1
-    case 7: return 1
-    case 8: return 1
-    default: return 1
-    }
-}
-
-
func f1() {
-    if true {}; if true {}; if true {}; if true {}; if true {}; if true {}
-    func f2() {
-        if true {}; if true {}; if true {}; if true {}; if true {}
-    }
-}
-
-

Triggering Examples

-
↓func f1() {
-    if true {
-        if true {
-            if false {}
-        }
-    }
-    if false {}
-    let i = 0
-    switch i {
-        case 1: break
-        case 2: break
-        case 3: break
-        case 4: break
-        default: break
-    }
-    for _ in 1...5 {
-        guard true else {
-            return
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/deployment_target.html b/deployment_target.html deleted file mode 100644 index 6042b1add..000000000 --- a/deployment_target.html +++ /dev/null @@ -1,532 +0,0 @@ - - - - deployment_target Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Deployment Target

- -

Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.

- -
    -
  • Identifier: deployment_target
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -iOSApplicationExtension_deployment_target - -7.0 -
    -iOS_deployment_target - -7.0 -
    -macOSApplicationExtension_deployment_target - -10.9 -
    -macOS_deployment_target - -10.9 -
    -tvOSApplicationExtension_deployment_target - -9.0 -
    -tvOS_deployment_target - -9.0 -
    -watchOSApplicationExtension_deployment_target - -1.0 -
    -watchOS_deployment_target - -1.0 -
  • -
-

Non Triggering Examples

-
@available(iOS 12.0, *)
-class A {}
-
-
@available(iOSApplicationExtension 13.0, *)
-class A {}
-
-
@available(watchOS 4.0, *)
-class A {}
-
-
@available(watchOSApplicationExtension 4.0, *)
-class A {}
-
-
@available(swift 3.0.2)
-class A {}
-
-
class A {}
-
-
if #available(iOS 10.0, *) {}
-
-
if #available(iOS 10, *) {}
-
-
guard #available(iOS 12.0, *) else { return }
-
-
#if #unavailable(iOS 15.0) {}
-
-
#guard #unavailable(iOS 15.0) {} else { return }
-
-

Triggering Examples

-
↓@available(iOS 6.0, *)
-class A {}
-
-
↓@available(iOSApplicationExtension 6.0, *)
-class A {}
-
-
↓@available(iOS 7.0, *)
-class A {}
-
-
↓@available(iOS 6, *)
-class A {}
-
-
↓@available(iOS 6.0, macOS 10.12, *)
- class A {}
-
-
↓@available(macOS 10.12, iOS 6.0, *)
- class A {}
-
-
↓@available(macOS 10.7, *)
-class A {}
-
-
↓@available(macOSApplicationExtension 10.7, *)
-class A {}
-
-
↓@available(OSX 10.7, *)
-class A {}
-
-
↓@available(watchOS 0.9, *)
-class A {}
-
-
↓@available(watchOSApplicationExtension 0.9, *)
-class A {}
-
-
↓@available(tvOS 8, *)
-class A {}
-
-
↓@available(tvOSApplicationExtension 8, *)
-class A {}
-
-
if ↓#available(iOS 6.0, *) {}
-
-
if ↓#available(iOS 6, *) {}
-
-
guard ↓#available(iOS 6.0, *) else { return }
-
-
if ↓#unavailable(iOS 7.0) {}
-
-
if ↓#unavailable(iOS 6.9) {}
-
-
guard ↓#unavailable(iOS 7.0) {} else { return }
-
- -
-
- - -
-
- - - diff --git a/direct_return.html b/direct_return.html deleted file mode 100644 index 8991dc080..000000000 --- a/direct_return.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - direct_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Direct Return

- -

Directly return the expression instead of assigning it to a variable first

- -
    -
  • Identifier: direct_return
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    func f() -> Int {
-        let b = 2
-        let a = 1
-        return b
-    }
-
-
    struct S {
-        var a: Int {
-            var b = 1
-            b = 2
-            return b
-        }
-    }
-
-
    func f() -> Int {
-        let b = 2
-        f()
-        return b
-    }
-
-
    func f() -> Int {
-        { i in
-            let b = 2
-            return i
-        }(1)
-    }
-
-

Triggering Examples

-
    func f() -> Int {
-        let ↓b = 2
-        return b
-    }
-
-
    struct S {
-        var a: Int {
-            var ↓b = 1
-            // comment
-            return b
-        }
-    }
-
-
    func f() -> Bool {
-        let a = 1, ↓b = true
-        return b
-    }
-
-
    func f() -> Int {
-        { _ in
-            let ↓b = 2
-            return b
-        }(1)
-    }
-
-
    func f(i: Int) -> Int {
-        if i > 1 {
-            let ↓a = 2
-            return a
-        } else {
-            let ↓b = 2, a = 1
-            return b
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/discarded_notification_center_observer.html b/discarded_notification_center_observer.html deleted file mode 100644 index e33b14917..000000000 --- a/discarded_notification_center_observer.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - discarded_notification_center_observer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discarded Notification Center Observer

- -

When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later

- -
    -
  • Identifier: discarded_notification_center_observer
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
func foo() -> Any {
-    return nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
func foo() -> Any {
-    nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
var obs: [Any?] = []
-obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
var obs: [String: Any?] = []
-obs["foo"] = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
var obs: [Any?] = []
-obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
func foo(_ notif: Any) {
-   obs.append(notif)
-}
-foo(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
var obs: [NSObjectProtocol] = [
-   nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }),
-   nc.addObserver(forName: .CKAccountChanged, object: nil, queue: nil, using: { })
-]
-
-
names.map { self.notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block) }
-
-
f { return nc.addObserver(forName: $0, object: object, queue: queue, using: block) }
-
-

Triggering Examples

-
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
_ = ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
@discardableResult func foo() -> Any {
-   return ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
class C {
-    var i: Int {
-        set { ↓notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block) }
-        get {
-            ↓notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block)
-            return 2
-        }
-    }
-}
-
-
f {
-    ↓nc.addObserver(forName: $0, object: object, queue: queue) {}
-    return 2
-}
-
-
func foo() -> Any {
-    if cond {
-        ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/discouraged_assert.html b/discouraged_assert.html deleted file mode 100644 index 90033cc69..000000000 --- a/discouraged_assert.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - discouraged_assert Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Assert

- -

Prefer assertionFailure() and/or preconditionFailure() over assert(false)

- -
    -
  • Identifier: discouraged_assert
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
assert(true)
-
-
assert(true, "foobar")
-
-
assert(true, "foobar", file: "toto", line: 42)
-
-
assert(false || true)
-
-
XCTAssert(false)
-
-

Triggering Examples

-
↓assert(false)
-
-
↓assert(false, "foobar")
-
-
↓assert(false, "foobar", file: "toto", line: 42)
-
-
↓assert(   false    , "foobar")
-
- -
-
- - -
-
- - - diff --git a/discouraged_direct_init.html b/discouraged_direct_init.html deleted file mode 100644 index f15e994fa..000000000 --- a/discouraged_direct_init.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - discouraged_direct_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Direct Initialization

- -

Discouraged direct initialization of types that can be harmful

- -
    -
  • Identifier: discouraged_direct_init
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -types - -[“Bundle”, “Bundle.init”, “NSError”, “NSError.init”, “UIDevice”, “UIDevice.init”] -
  • -
-

Non Triggering Examples

-
let foo = UIDevice.current
-
-
let foo = Bundle.main
-
-
let foo = Bundle(path: "bar")
-
-
let foo = Bundle(identifier: "bar")
-
-
let foo = Bundle.init(path: "bar")
-
-
let foo = Bundle.init(identifier: "bar")
-
-
let foo = NSError(domain: "bar", code: 0)
-
-
let foo = NSError.init(domain: "bar", code: 0)
-
-
func testNSError()
-
-

Triggering Examples

-
↓UIDevice()
-
-
↓Bundle()
-
-
let foo = ↓UIDevice()
-
-
let foo = ↓Bundle()
-
-
let foo = ↓NSError()
-
-
let foo = bar(bundle: ↓Bundle(), device: ↓UIDevice(), error: ↓NSError())
-
-
↓UIDevice.init()
-
-
↓Bundle.init()
-
-
↓NSError.init()
-
-
let foo = ↓UIDevice.init()
-
-
let foo = ↓Bundle.init()
-
-
let foo = bar(bundle: ↓Bundle.init(), device: ↓UIDevice.init(), error: ↓NSError.init())
-
- -
-
- - -
-
- - - diff --git a/discouraged_none_name.html b/discouraged_none_name.html deleted file mode 100644 index 062242763..000000000 --- a/discouraged_none_name.html +++ /dev/null @@ -1,518 +0,0 @@ - - - - discouraged_none_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged None Name

- -

Enum cases and static members named none are discouraged as they can conflict with Optional<T>.none.

- -
    -
  • Identifier: discouraged_none_name
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum MyEnum {
-    case nOne
-}
-
-
enum MyEnum {
-    case _none
-}
-
-
enum MyEnum {
-    case none_
-}
-
-
enum MyEnum {
-    case none(Any)
-}
-
-
enum MyEnum {
-    case nonenone
-}
-
-
class MyClass {
-    class var nonenone: MyClass { MyClass() }
-}
-
-
class MyClass {
-    static var nonenone = MyClass()
-}
-
-
class MyClass {
-    static let nonenone = MyClass()
-}
-
-
struct MyStruct {
-    static var nonenone = MyStruct()
-}
-
-
struct MyStruct {
-    static let nonenone = MyStruct()
-}
-
-
struct MyStruct {
-    let none = MyStruct()
-}
-
-
struct MyStruct {
-    var none = MyStruct()
-}
-
-
class MyClass {
-    let none = MyClass()
-}
-
-
class MyClass {
-    var none = MyClass()
-}
-
-

Triggering Examples

-
enum MyEnum {
-    case ↓none
-}
-
-
enum MyEnum {
-    case a, ↓none
-}
-
-
enum MyEnum {
-    case ↓none, b
-}
-
-
enum MyEnum {
-    case a, ↓none, b
-}
-
-
enum MyEnum {
-    case a
-    case ↓none
-}
-
-
enum MyEnum {
-    case ↓none
-    case b
-}
-
-
enum MyEnum {
-    case a
-    case ↓none
-    case b
-}
-
-
class MyClass {
-    ↓static let none = MyClass()
-}
-
-
class MyClass {
-    ↓static let none: MyClass = MyClass()
-}
-
-
class MyClass {
-    ↓static var none: MyClass = MyClass()
-}
-
-
class MyClass {
-    ↓class var none: MyClass { MyClass() }
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none: MyStruct = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none: MyStruct = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var a = MyStruct(), none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct(), a = MyStruct()
-}
-
- -
-
- - -
-
- - - diff --git a/discouraged_object_literal.html b/discouraged_object_literal.html deleted file mode 100644 index 119ec8db8..000000000 --- a/discouraged_object_literal.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - discouraged_object_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Object Literal

- -

Prefer initializers over object literals

- -
    -
  • Identifier: discouraged_object_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -image_literal - -true -
    -color_literal - -true -
  • -
-

Non Triggering Examples

-
let image = UIImage(named: aVariable)
-
-
let image = UIImage(named: "interpolated \(variable)")
-
-
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
-
-
let image = NSImage(named: aVariable)
-
-
let image = NSImage(named: "interpolated \(variable)")
-
-
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
-
-

Triggering Examples

-
let image = ↓#imageLiteral(resourceName: "image.jpg")
-
-
let color = ↓#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
- -
-
- - -
-
- - - diff --git a/discouraged_optional_boolean.html b/discouraged_optional_boolean.html deleted file mode 100644 index 08fa63912..000000000 --- a/discouraged_optional_boolean.html +++ /dev/null @@ -1,774 +0,0 @@ - - - - discouraged_optional_boolean Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Optional Boolean

- -

Prefer non-optional booleans over optional booleans

- -
    -
  • Identifier: discouraged_optional_boolean
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var foo: Bool
-
-
var foo: [String: Bool]
-
-
var foo: [Bool]
-
-
let foo: Bool = true
-
-
let foo: Bool = false
-
-
let foo: [String: Bool] = [:]
-
-
let foo: [Bool] = []
-
-
var foo: Bool { return true }
-
-
let foo: Bool { return false }()
-
-
func foo() -> Bool {}
-
-
func foo() -> [String: Bool] {}
-
-
func foo() -> ([Bool]) -> String {}
-
-
func foo(input: Bool = true) {}
-
-
func foo(input: [String: Bool] = [:]) {}
-
-
func foo(input: [Bool] = []) {}
-
-
class Foo {
-    func foo() -> Bool {}
-}
-
-
class Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
class Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
struct Foo {
-    func foo() -> Bool {}
-}
-
-
struct Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
struct Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
enum Foo {
-    func foo() -> Bool {}
-}
-
-
enum Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
enum Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
class Foo {
-    func foo(input: Bool = true) {}
-}
-
-
class Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
class Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-
struct Foo {
-    func foo(input: Bool = true) {}
-}
-
-
struct Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
struct Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-
enum Foo {
-    func foo(input: Bool = true) {}
-}
-
-
enum Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
enum Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-

Triggering Examples

-
var foo: ↓Bool?
-
-
var foo: [String: ↓Bool?]
-
-
var foo: [↓Bool?]
-
-
let foo: ↓Bool? = nil
-
-
let foo: [String: ↓Bool?] = [:]
-
-
let foo: [↓Bool?] = []
-
-
let foo = ↓Optional.some(false)
-
-
let foo = ↓Optional.some(true)
-
-
var foo: ↓Bool? { return nil }
-
-
let foo: ↓Bool? { return nil }()
-
-
func foo() -> ↓Bool? {}
-
-
func foo() -> [String: ↓Bool?] {}
-
-
func foo() -> [↓Bool?] {}
-
-
static func foo() -> ↓Bool? {}
-
-
static func foo() -> [String: ↓Bool?] {}
-
-
static func foo() -> [↓Bool?] {}
-
-
func foo() -> (↓Bool?) -> String {}
-
-
func foo() -> ([Int]) -> ↓Bool? {}
-
-
func foo(input: ↓Bool?) {}
-
-
func foo(input: [String: ↓Bool?]) {}
-
-
func foo(input: [↓Bool?]) {}
-
-
static func foo(input: ↓Bool?) {}
-
-
static func foo(input: [String: ↓Bool?]) {}
-
-
static func foo(input: [↓Bool?]) {}
-
-
class Foo {
-    var foo: ↓Bool?
-}
-
-
class Foo {
-    var foo: [String: ↓Bool?]
-}
-
-
class Foo {
-    let foo: ↓Bool? = nil
-}
-
-
class Foo {
-    let foo: [String: ↓Bool?] = [:]
-}
-
-
class Foo {
-    let foo: [↓Bool?] = []
-}
-
-
struct Foo {
-    var foo: ↓Bool?
-}
-
-
struct Foo {
-    var foo: [String: ↓Bool?]
-}
-
-
struct Foo {
-    let foo: ↓Bool? = nil
-}
-
-
struct Foo {
-    let foo: [String: ↓Bool?] = [:]
-}
-
-
struct Foo {
-    let foo: [↓Bool?] = []
-}
-
-
class Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
class Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
class Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
class Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
class Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
class Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
class Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
class Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
class Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
struct Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
struct Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
struct Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
struct Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
struct Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
struct Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
enum Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
enum Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
enum Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
enum Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
enum Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
enum Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
class Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
class Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
class Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
class Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
class Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
class Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
struct Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
struct Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
struct Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
struct Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
struct Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
enum Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
enum Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
enum Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
enum Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
enum Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
_ = ↓Bool?.values()
-
- -
-
- - -
-
- - - diff --git a/discouraged_optional_collection.html b/discouraged_optional_collection.html deleted file mode 100644 index b5775a9bb..000000000 --- a/discouraged_optional_collection.html +++ /dev/null @@ -1,954 +0,0 @@ - - - - discouraged_optional_collection Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Optional Collection

- -

Prefer empty collection over optional collection

- -
    -
  • Identifier: discouraged_optional_collection
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var foo: [Int]
-
-
var foo: [String: Int]
-
-
var foo: Set<String>
-
-
var foo: [String: [String: Int]]
-
-
let foo: [Int] = []
-
-
let foo: [String: Int] = [:]
-
-
let foo: Set<String> = []
-
-
let foo: [String: [String: Int]] = [:]
-
-
var foo: [Int] { return [] }
-
-
func foo() -> [Int] {}
-
-
func foo() -> [String: String] {}
-
-
func foo() -> Set<Int> {}
-
-
func foo() -> ([Int]) -> String {}
-
-
func foo(input: [String] = []) {}
-
-
func foo(input: [String: String] = [:]) {}
-
-
func foo(input: Set<String> = []) {}
-
-
class Foo {
-    func foo() -> [Int] {}
-}
-
-
class Foo {
-    func foo() -> [String: String] {}
-}
-
-
class Foo {
-    func foo() -> Set<Int> {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
struct Foo {
-    func foo() -> [Int] {}
-}
-
-
struct Foo {
-    func foo() -> [String: String] {}
-}
-
-
struct Foo {
-    func foo() -> Set<Int> {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
enum Foo {
-    func foo() -> [Int] {}
-}
-
-
enum Foo {
-    func foo() -> [String: String] {}
-}
-
-
enum Foo {
-    func foo() -> Set<Int> {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
class Foo {
-    func foo(input: [String] = []) {}
-}
-
-
class Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
class Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-
struct Foo {
-    func foo(input: [String] = []) {}
-}
-
-
struct Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
struct Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-
enum Foo {
-    func foo(input: [String] = []) {}
-}
-
-
enum Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
enum Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-

Triggering Examples

-
var foo: ↓[Int]?
-
-
var foo: ↓[String: Int]?
-
-
var foo: ↓Set<String>?
-
-
let foo: ↓[Int]? = nil
-
-
let foo: ↓[String: Int]? = nil
-
-
let foo: ↓Set<String>? = nil
-
-
var foo: ↓[Int]? { return nil }
-
-
let foo: ↓[Int]? { return nil }()
-
-
func foo() -> ↓[T]? {}
-
-
func foo() -> ↓[String: String]? {}
-
-
func foo() -> ↓[String: [String: String]]? {}
-
-
func foo() -> [String: ↓[String: String]?] {}
-
-
func foo() -> ↓Set<Int>? {}
-
-
static func foo() -> ↓[T]? {}
-
-
static func foo() -> ↓[String: String]? {}
-
-
static func foo() -> ↓[String: [String: String]]? {}
-
-
static func foo() -> [String: ↓[String: String]?] {}
-
-
static func foo() -> ↓Set<Int>? {}
-
-
func foo() -> (↓[Int]?) -> String {}
-
-
func foo() -> ([Int]) -> ↓[String]? {}
-
-
func foo(input: ↓[String: String]?) {}
-
-
func foo(input: ↓[String: [String: String]]?) {}
-
-
func foo(input: [String: ↓[String: String]?]) {}
-
-
func foo(input: ↓[String: ↓[String: String]?]?) {}
-
-
func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-
-
func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-
-
static func foo(input: ↓[String: String]?) {}
-
-
static func foo(input: ↓[String: [String: String]]?) {}
-
-
static func foo(input: [String: ↓[String: String]?]) {}
-
-
static func foo(input: ↓[String: ↓[String: String]?]?) {}
-
-
static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-
-
static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-
-
class Foo {
-    var foo: ↓[Int]?
-}
-
-
class Foo {
-    var foo: ↓[String: Int]?
-}
-
-
class Foo {
-    var foo: ↓Set<String>?
-}
-
-
class Foo {
-    let foo: ↓[Int]? = nil
-}
-
-
class Foo {
-    let foo: ↓[String: Int]? = nil
-}
-
-
class Foo {
-    let foo: ↓Set<String>? = nil
-}
-
-
struct Foo {
-    var foo: ↓[Int]?
-}
-
-
struct Foo {
-    var foo: ↓[String: Int]?
-}
-
-
struct Foo {
-    var foo: ↓Set<String>?
-}
-
-
struct Foo {
-    let foo: ↓[Int]? = nil
-}
-
-
struct Foo {
-    let foo: ↓[String: Int]? = nil
-}
-
-
struct Foo {
-    let foo: ↓Set<String>? = nil
-}
-
-
class Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
class Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
class Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
class Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
class Foo {
-    func foo() -> [T]? {}
-}
-
-
class Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
class Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
class Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
class Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
class Foo {
-    static func foo() -> [T]? {}
-}
-
-
class Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
class Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
class Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
class Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
class Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
struct Foo {
-    func foo() -> [T]? {}
-}
-
-
struct Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
struct Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
struct Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
struct Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
struct Foo {
-    static func foo() -> [T]? {}
-}
-
-
struct Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
struct Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
enum Foo {
-    func foo() -> [T]? {}
-}
-
-
enum Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
enum Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
enum Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
enum Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
enum Foo {
-    static func foo() -> [T]? {}
-}
-
-
enum Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
enum Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
class Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
class Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
class Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
class Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
class Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
class Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
struct Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
struct Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
struct Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
struct Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
struct Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
struct Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
enum Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
enum Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
enum Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
enum Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
enum Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
enum Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Info.plist b/docsets/SwiftLintCore.docset/Contents/Info.plist deleted file mode 100644 index ba8254a4b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleIdentifier - com.jazzy.swiftlintcore - CFBundleName - SwiftLintCore - DocSetPlatformFamily - swiftlintcore - isDashDocset - - dashIndexFilePath - index.html - isJavaScriptEnabled - - DashDocSetFamily - dashtoc - DashDocSetFallbackURL - https://realm.github.io/SwiftLint/ - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes.html deleted file mode 100644 index 9e8424a80..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes.html +++ /dev/null @@ -1,652 +0,0 @@ - - - - Classes Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Classes

-

The following classes are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter.html deleted file mode 100644 index 61b7bb4c4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - CodeIndentingRewriter Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CodeIndentingRewriter

-
-
- -
public class CodeIndentingRewriter : SyntaxRewriter
- -
-
-

Rewriter that indents or unindents a syntax piece including comments and nested -AST nodes (e.g. a code block in a code block).

- - -
-
- -
-
-
-
    -
  • -
    - - - - IndentationStyle - -
    -
    -
    -
    -
    -
    -

    Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and -how many of them.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum IndentationStyle
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(style:) - -
    -
    -
    -
    -
    -
    -

    Initializer accepting an indentation style.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(style: IndentationStyle = .indentSpaces(4))
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - style - - -
    -

    Indentation style. The default is indentation by 4 spaces.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override public func visit(_ token: TokenSyntax) -> TokenSyntax
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter/IndentationStyle.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter/IndentationStyle.html deleted file mode 100644 index 3ec611f37..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CodeIndentingRewriter/IndentationStyle.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - IndentationStyle Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

IndentationStyle

-
-
- -
public enum IndentationStyle
- -
-
-

Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and -how many of them.

- - -
-
- -
-
-
-
    -
  • -
    - - - - indentSpaces(_:) - -
    -
    -
    -
    -
    -
    -

    Indentation with a number of spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indentSpaces(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - unindentSpaces(_:) - -
    -
    -
    -
    -
    -
    -

    Reverse indentation of a number of spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case unindentSpaces(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - indentTabs(_:) - -
    -
    -
    -
    -
    -
    -

    Indentation with a number of tabs

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indentTabs(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - unindentTabs(_:) - -
    -
    -
    -
    -
    -
    -

    Reverse indentation of a number of tabs.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case unindentTabs(Int)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CustomRuleTimer.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CustomRuleTimer.html deleted file mode 100644 index b707fe3dc..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/CustomRuleTimer.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - CustomRuleTimer Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CustomRuleTimer

-
-
- -
public final class CustomRuleTimer
- -
-
-

Utility to measure the time spent in each custom rule.

- - -
-
- -
-
-
-
    -
  • -
    - - - - shared - -
    -
    -
    -
    -
    -
    -

    Singleton.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let shared: CustomRuleTimer
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - activate() - -
    -
    -
    -
    -
    -
    -

    Tell the timer it should record time spent in rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func activate()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - dump() - -
    -
    -
    -
    -
    -
    -

    Return all time spent for each custom rule, keyed by rule ID.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func dump() -> [String : TimeInterval]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/DeclaredIdentifiersTrackingVisitor.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/DeclaredIdentifiersTrackingVisitor.html deleted file mode 100644 index 2c56a4c6d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/DeclaredIdentifiersTrackingVisitor.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - DeclaredIdentifiersTrackingVisitor Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

DeclaredIdentifiersTrackingVisitor

-
-
- -
open class DeclaredIdentifiersTrackingVisitor<Configuration: RuleConfiguration>:
-        ViolationsSyntaxVisitor<Configuration>
- -
-
-

A specialized ViolationsSyntaxVisitor that tracks declared identifiers per scope while traversing the AST.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Scope - -
    -
    -
    -
    -
    -
    -

    A type that remembers the declared identifiers (in order) up to the current position in the code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public typealias Scope = Stack<Set<String>>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - scope - -
    -
    -
    -
    -
    -
    -

    The hierarchical stack of identifiers declared up to the current position in the code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var scope: Scope
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initializer.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile, scope: Scope = Scope())
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    - - scope - - -
    -

    A (potentially already pre-filled) scope to collect identifiers into.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Indicate whether a given identifier is in scope.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hasSeenDeclaration(for identifier: String) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    An identifier.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: CodeBlockItemListSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: CodeBlockItemListSyntax)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: VariableDeclSyntax)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitPost(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitPost(_ node: GuardStmtSyntax)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/LinterCache.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/LinterCache.html deleted file mode 100644 index 91c9faae0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/LinterCache.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - LinterCache Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

LinterCache

-
-
- -
public final class LinterCache
- -
-
-

A persisted cache for storing and retrieving linter results.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(configuration: Configuration, fileManager: some LintableFileManager = FileManager.default)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    The SwiftLint configuration for which this cache will be used.

    -
    -
    - - fileManager - - -
    -

    The file manager to use to read lintable file information.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - save() - -
    -
    -
    -
    -
    -
    -

    Persists the cache to disk.

    -
    -

    Throws

    - Throws if the linter cache doesn’t have a location value, if the cache couldn’t be serialized, or if - the contents couldn’t be written to disk. - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func save() throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleRegistry.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleRegistry.html deleted file mode 100644 index c6dc68403..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleRegistry.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - RuleRegistry Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleRegistry

-
-
- -
public final class RuleRegistry
- -
-
-

Container to register and look up SwiftLint rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - shared - -
    -
    -
    -
    -
    -
    -

    Shared rule registry instance.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let shared: RuleRegistry
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - list - -
    -
    -
    -
    -
    -
    -

    Rule list associated with this registry. Lazily created, and -immutable once looked up.

    -
    -

    Note

    - Adding registering more rules after this was first - accessed will not work. - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) lazy var list: RuleList { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - register(rules:) - -
    -
    -
    -
    -
    -
    -

    Register rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func register(rules: [any Rule.Type])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to register.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - rule(forID:) - -
    -
    -
    -
    -
    -
    -

    Look up a rule for a given ID.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func rule(forID id: String) -> (any Rule.Type)?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - id - - -
    -

    The ID for the rule to look up.

    -
    -
    -
    -
    -

    Return Value

    -

    The rule matching the specified ID, if one was found.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleStorage.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleStorage.html deleted file mode 100644 index 509ab948e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/RuleStorage.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - RuleStorage Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleStorage

-
-
- -
public class RuleStorage : CustomStringConvertible
- -
-
-

A storage mechanism for aggregating the results of CollectingRules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    Creates a RuleStorage with no initial stored data.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html deleted file mode 100644 index 8c6dcdff5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html +++ /dev/null @@ -1,890 +0,0 @@ - - - - SwiftLintFile Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintFile

-
-
- -
public final class SwiftLintFile
-
extension SwiftLintFile: Equatable, Hashable
- -
-
-

A unit of Swift source code, either on disk or in memory.

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The underlying SourceKitten file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: File
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - id - -
    -
    -
    -
    -
    -
    -

    The associated unique identifier for this file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let id: UUID
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isTestFile - -
    -
    -
    -
    -
    -
    -

    Whether or not this is a file generated for testing purposes.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var isTestFile: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isVirtual - -
    -
    -
    -
    -
    -
    -

    A file is virtual if it is not backed by a filesystem path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var isVirtual: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(file:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile with a SourceKitten File.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: File)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    A file from SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(path:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile by specifying its path on disk. -Fails if the file does not exist.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init?(path: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - path - - -
    -

    The path to a file on disk. Relative and absolute paths supported.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this -one does not read its contents immediately, but rather traps at runtime when attempting to access its contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init(pathDeferringReading path: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - path - - -
    -

    The path to a file on disk. Relative and absolute paths supported.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(contents:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public convenience init(contents: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - contents - - -
    -

    The contents of the file.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - path - -
    -
    -
    -
    -
    -
    -

    The path on disk for this file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var path: String? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - contents - -
    -
    -
    -
    -
    -
    -

    The file’s contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var contents: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - stringView - -
    -
    -
    -
    -
    -
    -

    A string view into the contents of this file optimized for string manipulation operations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var stringView: StringView { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - lines - -
    -
    -
    -
    -
    -
    -

    The parsed lines for this file’s contents.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var lines: [Line] { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Hashable Conformance -

-
-
-
    -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: SwiftLintFile, rhs: SwiftLintFile) -> Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxRewriter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxRewriter.html deleted file mode 100644 index d92bf2ff2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxRewriter.html +++ /dev/null @@ -1,621 +0,0 @@ - - - - ViolationsSyntaxRewriter Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationsSyntaxRewriter

-
-
- -
open class ViolationsSyntaxRewriter<Configuration> : SyntaxRewriter where Configuration : RuleConfiguration
- -
-
-

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

- - -
-
- -
-
-
-
    -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    A rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let configuration: Configuration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file from which the traversed syntax tree stems from.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - locationConverter - -
    -
    -
    -
    -
    -
    -

    A converter of positions in the traversed source file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var locationConverter: SourceLocationConverter { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - disabledRegions - -
    -
    -
    -
    -
    -
    -

    The regions in the traversed file that are disabled by a command.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var disabledRegions: [SourceRange] { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - correctionPositions - -
    -
    -
    -
    -
    -
    -

    Positions in a source file where corrections were applied.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var correctionPositions: [AbsolutePosition]
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initilizer for a ViolationsSyntaxRewriter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - visitAny(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visitAny(_ node: Syntax) -> Syntax?
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html deleted file mode 100644 index f2c914255..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html +++ /dev/null @@ -1,913 +0,0 @@ - - - - ViolationsSyntaxVisitor Class Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationsSyntaxVisitor

-
-
- -
open class ViolationsSyntaxVisitor<Configuration> : SyntaxVisitor where Configuration : RuleConfiguration
- -
-
-

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

- - -
-
- -
-
-
-
    -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    A rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let configuration: Configuration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file from which the traversed syntax tree stems from.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - locationConverter - -
    -
    -
    -
    -
    -
    -

    A source location converter associated with the syntax tree being traversed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public lazy var locationConverter: SourceLocationConverter { get set }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Initializer for a ViolationsSyntaxVisitor.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -public init(configuration: Configuration, file: SwiftLintFile)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - configuration - - -
    -

    Configuration of a rule.

    -
    -
    - - file - - -
    -

    File from which the syntax tree stems from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - violations - -
    -
    -
    -
    -
    -
    -

    Positions in a source file where violations should be reported.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violations: [ReasonedRuleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - violationCorrections - -
    -
    -
    -
    -
    -
    -

    Ranges of violations to be used in rewriting (see SwiftSyntaxCorrectableRule). It is not mandatory to fill -this list while traversing the AST, especially not if the rule is not correctable or provides a custom rewriter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violationCorrections: [ViolationCorrection]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - skippableDeclarations - -
    -
    -
    -
    -
    -
    -

    List of declaration types that shall be skipped while traversing the AST.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    open var skippableDeclarations: [any DeclSyntaxProtocol.Type] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ActorDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ExtensionDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: InitializerDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: SubscriptDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - visit(_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    override open func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums.html deleted file mode 100644 index 40089c26b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums.html +++ /dev/null @@ -1,656 +0,0 @@ - - - - Enumerations Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Enumerations

-

The following enumerations are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html deleted file mode 100644 index cc2a53283..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html +++ /dev/null @@ -1,703 +0,0 @@ - - - - AccessControlLevel Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AccessControlLevel

-
-
- -
public enum AccessControlLevel : String, CustomStringConvertible
-
extension AccessControlLevel: Comparable
- -
-
-

The accessibility of a Swift source declaration.

- - - -
-
- -
-
-
-
    -
  • -
    - - - - private - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s immediate lexical scope.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `private` = "source.lang.swift.accessibility.private"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - fileprivate - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `fileprivate` = "source.lang.swift.accessibility.fileprivate"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - internal - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `internal` = "source.lang.swift.accessibility.internal"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - package - -
    -
    -
    -
    -
    -
    -

    Accessible by all the modules defined in the same Swift package.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case package = "source.lang.swift.accessibility.package"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - public - -
    -
    -
    -
    -
    -
    -

    Accessible by the declaration’s same program.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case `public` = "source.lang.swift.accessibility.public"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - open - -
    -
    -
    -
    -
    -
    -

    Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case open = "source.lang.swift.accessibility.open"
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(description:) - -
    -
    -
    -
    -
    -
    -

    Initializes an access control level by its Swift source keyword value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init?(description value: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The value used to describe this level in Swift source code.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isPrivate - -
    -
    -
    -
    -
    -
    -

    Returns true if is private or fileprivate

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var isPrivate: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: AccessControlLevel, rhs: AccessControlLevel) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html deleted file mode 100644 index 795f88e0c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - ExecutableInfo Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ExecutableInfo

-
-
- -
public enum ExecutableInfo
- -
-
-

Information about this executable.

- - -
-
- -
-
-
-
    -
  • -
    - - - - buildID - -
    -
    -
    -
    -
    -
    -

    A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let buildID: String?
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/Issue.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/Issue.html deleted file mode 100644 index 4160cf5f0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/Issue.html +++ /dev/null @@ -1,1160 +0,0 @@ - - - - Issue Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Issue

-
-
- -
public enum Issue : LocalizedError, Equatable
- -
-
-

All possible SwiftLint issues which are printed as warnings by default.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    The configuration didn’t match internal expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidConfiguration(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Issued when an option is deprecated. Suggests an alternative optionally.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case deprecatedConfigurationOption(ruleID: String, key: String, alternative: String? = nil)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Used in configuration parsing when no changes have been applied. Use only internally!

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case nothingApplied(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Rule is listed multiple times in the configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case listedMultipleTime(ruleID: String, times: Int)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    An identifier old has been renamed to new.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case renamedIdentifier(old: String, new: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Some configuration keys are invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidConfigurationKeys(ruleID: String, keys: Set<String>)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalidRuleIDs(_:) - -
    -
    -
    -
    -
    -
    -

    Used rule IDs are invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalidRuleIDs(Set<String>)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not present in only_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotPresentInOnlyRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is disabled.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDisabledInDisabledRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is disabled in the parent configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDisabledInParentConfiguration(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not enabled in opt_in_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotEnabledInOptInRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Found a rule configuration for a rule that is not enabled in parent only_rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleNotEnabledInParentOnlyRules(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - genericWarning(_:) - -
    -
    -
    -
    -
    -
    -

    A generic warning specified by a string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case genericWarning(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - genericError(_:) - -
    -
    -
    -
    -
    -
    -

    A generic error specified by a string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case genericError(String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A deprecation warning for a rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case ruleDeprecated(ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The initial configuration file was not found.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case initialFileNotFound(path: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - fileNotFound(path:) - -
    -
    -
    -
    -
    -
    -

    A file at specified path was not found.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotFound(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path is not readable or cannot be opened.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotReadable(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path is not writable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case fileNotWritable(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The file at path cannot be indexed by a specific rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case indexingError(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    No arguments were provided to compile a file at path within a specific rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case missingCompilerArguments(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Cursor information cannot be extracted from a specific location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case missingCursorInfo(path: String?, ruleID: String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yamlParsing(_:) - -
    -
    -
    -
    -
    -
    -

    An error that occurred when parsing YAML.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case yamlParsing(String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    The baseline file at path is not readable or cannot be opened.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case baselineNotReadable(path: String)
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Flag to enable warnings for deprecations being printed to the console. Printing is enabled by default.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var printDeprecationWarnings: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - print() - -
    -
    -
    -
    -
    -
    -

    Print the issue to the console.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func print()
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/OptionType.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/OptionType.html deleted file mode 100644 index deaa759dd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/OptionType.html +++ /dev/null @@ -1,898 +0,0 @@ - - - - OptionType Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

OptionType

-
-
- -
public enum OptionType : Equatable
-
extension OptionType: Documentable
- -
-
-

Type of an option.

- - -
-
- -
-
-
-
    -
  • -
    - - - - empty - -
    -
    -
    -
    -
    -
    -

    An irrelevant option. It will be ignored in documentation serialization.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case empty
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - flag(_:) - -
    -
    -
    -
    -
    -
    -

    A boolean flag.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case flag(Bool)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - string(_:) - -
    -
    -
    -
    -
    -
    -

    A string option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case string(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - symbol(_:) - -
    -
    -
    -
    -
    -
    -

    Like a string option but without quotes in the serialized output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case symbol(String)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - integer(_:) - -
    -
    -
    -
    -
    -
    -

    An integer option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case integer(Int)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - float(_:) - -
    -
    -
    -
    -
    -
    -

    A floating point number option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case float(Double)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity(_:) - -
    -
    -
    -
    -
    -
    -

    Special option for a ViolationSeverity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case severity(ViolationSeverity)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - list(_:) - -
    -
    -
    -
    -
    -
    -

    A list of options.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case list([OptionType])
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - nested(_:) - -
    -
    -
    -
    -
    -
    -

    An option which is another set of configuration options to be nested in the serialized output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case nested(RuleConfigurationDescription)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Result builder -

-
-
-
    -
  • -
    - - - - =>(_:_:) - -
    -
    -
    -
    -
    -
    -

    Operator enabling an easy way to create a configuration option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func => (key: String, value: OptionType) -> RuleConfigurationOption
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - key - - -
    -

    Name of the option.

    -
    -
    - - value - - -
    -

    Value of the option.

    -
    -
    -
    -
    -

    Return Value

    -

    A configuration option built up by the given data.

    -
    - -
    -
    -
  • -
  • -
    - - - - nest(_:) - -
    -
    -
    -
    -
    -
    -

    Create an option defined by nested configuration description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func nest(@RuleConfigurationDescriptionBuilder _ description: () -> RuleConfigurationDescription) -> OptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - description - - -
    -

    A configuration description buildable by applying the result builder syntax.

    -
    -
    -
    -
    -

    Return Value

    -

    A configuration option with a value being another configuration description.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html deleted file mode 100644 index 194bd2d30..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - RuleIdentifier Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleIdentifier

-
-
- -
public enum RuleIdentifier : Hashable, ExpressibleByStringLiteral
- -
-
-

An identifier representing a SwiftLint rule, or all rules.

- - -
-
- -
-
-
-
- - -
- -

Values -

-
-
-
    -
  • -
    - - - - all - -
    -
    -
    -
    -
    -
    -

    Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in -disabling all SwiftLint rules in a given file by adding a // swiftlint:disable all comment at the top of the -file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case all
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - single(identifier:) - -
    -
    -
    -
    -
    -
    -

    Represents a single SwiftLint rule with the specified identifier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case single(identifier: String)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Properties -

-
-
-
    -
  • -
    - - - - stringRepresentation - -
    -
    -
    -
    -
    -
    -

    The spelling of the string for this idenfitier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var stringRepresentation: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Initializers -

-
-
-
    -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleIdentifier by its string representation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ value: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The string representation.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

ExpressibleByStringLiteral Conformance -

-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleKind.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleKind.html deleted file mode 100644 index 9a2f3ae84..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleKind.html +++ /dev/null @@ -1,530 +0,0 @@ - - - - RuleKind Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleKind

-
-
- -
public enum RuleKind : String, Codable, Sendable
- -
-
-

All the possible rule kinds (categories).

- - -
-
- -
-
-
-
    -
  • -
    - - - - lint - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate Swift source conventions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case lint
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - idiomatic - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate common practices in the Swift community.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case idiomatic
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - style - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate stylistic choices.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case style
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - metrics - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate magnitudes or measurements of Swift source.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case metrics
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - performance - -
    -
    -
    -
    -
    -
    -

    Describes rules that validate that code patterns with poor performance are avoided.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case performance
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleListError.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleListError.html deleted file mode 100644 index dd2e1bbf5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/RuleListError.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - RuleListError Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleListError

-
-
- -
public enum RuleListError : Error
- -
-
-

All possible rule list configuration errors.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    The rule list contains more than one configuration for the specified rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case duplicatedConfigurations(rule: any Rule.Type)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html deleted file mode 100644 index 38328d28a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - SwiftExpressionKind Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftExpressionKind

-
-
- -
public enum SwiftExpressionKind : String
- -
-
-

The kind of expression for a contiguous set of Swift source tokens.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html deleted file mode 100644 index a6e100889..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - ViolationSeverity Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationSeverity

-
-
- -
public enum ViolationSeverity : String, Comparable, Codable, InlinableOptionType
- -
-
-

The magnitude of a StyleViolation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case warning
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case error
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Comparable -

-
-
-
    -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: ViolationSeverity, rhs: ViolationSeverity) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions.html deleted file mode 100644 index 83be51062..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - Extensions Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Extensions

-

The following extensions are available globally.

- -
-
- -
-
-
- -
-
-
- - -
- -

AcceptableByConfigurationElement conformances -

-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Array.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Array.html deleted file mode 100644 index e23f5dd84..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Array.html +++ /dev/null @@ -1,860 +0,0 @@ - - - - Array Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Array

-
-
- -
public extension Array where Element == Example
-
extension Array: AcceptableByConfigurationElement where Element: AcceptableByConfigurationElement
-
public extension Array where Element == SwiftLintSyntaxToken
-
public extension Array where Element == ReasonedRuleViolation
-
public extension Array where Element == any DeclSyntaxProtocol.Type
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Element == Example -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip wrapping in comment tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipWrappingInCommentTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip wrapping in string tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipWrappingInStringTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip multi-byte offset tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipMultiByteOffsetTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Make these examples skip disable command tests.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func skipDisableCommandTests() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Remove all violation markers from the examples.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func removingViolationMarker() -> Array<Element>
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element: AcceptableByConfigurationElement -

-
-
- -
-
-
- - -
- -

Available where Element == SwiftLintSyntaxToken -

-
-
-
    -
  • -
    - - - - kinds - -
    -
    -
    -
    -
    -
    -

    The kinds for these tokens.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var kinds: [SyntaxKind] { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element == ReasonedRuleViolation -

-
-
-
    -
  • -
    - - - - append(_:) - -
    -
    -
    -
    -
    -
    -

    Append a minimal violation for the specified position.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func append(_ position: AbsolutePosition)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - position - - -
    -

    The position for the violation to append.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - append(contentsOf:) - -
    -
    -
    -
    -
    -
    -

    Append minimal violations for the specified positions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func append(contentsOf positions: [AbsolutePosition])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - positions - - -
    -

    The positions for the violations to append.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element == anyDeclSyntaxProtocol.Type -

-
-
-
    -
  • -
    - - - - all - -
    -
    -
    -
    -
    -
    -

    All visitable declaration syntax types.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static let all: `Self`
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - allExcept(_:) - -
    -
    -
    -
    -
    -
    -

    All declarations except for the specified ones.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func allExcept(_ declarations: Element...) -> Array<Element>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - declarations - - -
    -

    The declarations to exclude from all declarations.

    -
    -
    -
    -
    -

    Return Value

    -

    All declarations except for the specified ones.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Bool.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Bool.html deleted file mode 100644 index 447de6b67..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Bool.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Bool Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Bool

-
-
- -
extension Bool: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Double.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Double.html deleted file mode 100644 index a69d97644..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Double.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Double Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Double

-
-
- -
extension Double: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Int.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Int.html deleted file mode 100644 index b9dbd552a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Int.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - Int Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Int

-
-
- -
extension Int: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Optional.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Optional.html deleted file mode 100644 index 14ba0b6f8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Optional.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Optional Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Optional

-
-
- -
extension Optional: AcceptableByConfigurationElement where Wrapped: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Wrapped: AcceptableByConfigurationElement -

-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Set.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Set.html deleted file mode 100644 index 9fb12858e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/Set.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - Set Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Set

-
-
- -
extension Set: AcceptableByConfigurationElement where Element: AcceptableByConfigurationElement & Comparable
- -
-
- -
-
- -
-
-
-
- - -
- -

Available where Element: AcceptableByConfigurationElement & Comparable -

-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/String.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/String.html deleted file mode 100644 index e809bba93..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Extensions/String.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - String Extension Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

String

-
-
- -
extension String: AcceptableByConfigurationElement
- -
-
- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Functions.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Functions.html deleted file mode 100644 index ff3338341..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Functions.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - Functions Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Functions

-

The following functions are available globally.

- -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any -known reporters.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func reporterFrom(identifier: String?) -> any Reporter.Type
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    The identifier corresponding to the reporter.

    -
    -
    -
    -
    -

    Return Value

    -

    The reporter type.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Global Variables.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Global Variables.html deleted file mode 100644 index 798997968..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Global Variables.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - Global Variables Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Global Variables

-

The following global variables are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - reportersList - -
    -
    -
    -
    -
    -
    -

    The reporters list containing all the reporters built into SwiftLint.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reportersList: [any Reporter.Type]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - coreRules - -
    -
    -
    -
    -
    -
    -

    The rule list containing all available rules built into SwiftLintCore.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let coreRules: [any Rule.Type]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Guides.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Guides.html deleted file mode 100644 index 5bfea6146..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Guides.html +++ /dev/null @@ -1,2521 +0,0 @@ - - - - Guides Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Guides

-

The following guides are available globally.

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols.html deleted file mode 100644 index f7a675132..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols.html +++ /dev/null @@ -1,952 +0,0 @@ - - - - Protocols Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Protocols

-

The following protocols are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - Documentable - -
    -
    -
    -
    -
    -
    -

    A type that can be converted into a human-readable representation.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Documentable
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Property wrapper -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Type of an object that can be used as a configuration element.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - InlinableOptionType - -
    -
    -
    -
    -
    -
    -

    An option type that can appear inlined into its using configuration.

    - -

    The ConfigurationElement must opt into this behavior. In this case, the option does not have a key. This is -almost exclusively useful for common RuleConfigurations that are used in many other rules as child -configurations.

    -
    -

    Warning

    -

    A type conforming to this protocol is assumed to throw an issue in its apply method only when it’s -absolutely clear that there is an error in the YAML configuration passed in. Since it may be used in a nested -context and doesn’t know about the outer configuration, it’s not always clear if a certain key-value is really -unacceptable.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol InlinableOptionType : AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ASTRule - -
    -
    -
    -
    -
    -
    -

    A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s -structure, validating the rule recursively in nested source bodies.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol ASTRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Interface providing access to a cache description.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CacheDescriptionProvider
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - AnyCollectingRule - -
    -
    -
    -
    -
    -
    -

    Type-erased protocol used to check whether a rule is collectable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AnyCollectingRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CollectingRule - -
    -
    -
    -
    -
    -
    -

    A rule that requires knowledge of all other files being linted.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CollectingRule : AnyCollectingRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Reporter - -
    -
    -
    -
    -
    -
    -

    An interface for reporting violations as strings.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Reporter : CustomStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Rule - -
    -
    -
    -
    -
    -
    -

    An executable value that can identify issues (violations) in Swift source code.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - OptInRule - -
    -
    -
    -
    -
    -
    -

    A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol OptInRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CorrectableRule - -
    -
    -
    -
    -
    -
    -

    A rule that can correct violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol CorrectableRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with -updated content.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SubstitutionCorrectableRule : CorrectableRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SourceKitFreeRule - -
    -
    -
    -
    -
    -
    -

    A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SourceKitFreeRule : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - AnalyzerRule - -
    -
    -
    -
    -
    -
    -

    A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like -static analysis than syntactic checks.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol AnalyzerRule : OptInRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleConfiguration - -
    -
    -
    -
    -
    -
    -

    A configuration value for a rule to allow users to modify its behavior.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol RuleConfiguration : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A configuration for a rule that allows to configure at least the severity.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SeverityBasedRuleConfiguration : RuleConfiguration
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SwiftSyntaxCorrectableRule : CorrectableRule, SwiftSyntaxRule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftSyntaxRule - -
    -
    -
    -
    -
    -
    -

    A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public protocol SwiftSyntaxRule : SourceKitFreeRule
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/ASTRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/ASTRule.html deleted file mode 100644 index 2bed74d41..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/ASTRule.html +++ /dev/null @@ -1,644 +0,0 @@ - - - - ASTRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ASTRule

-
-
- -
public protocol ASTRule : Rule
- -
-
-

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s -structure, validating the rule recursively in nested source bodies.

- - -
-
- -
-
-
-
    -
  • -
    - - - - KindType - -
    -
    -
    -
    -
    -
    -

    The kind of token being recursed over.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype KindType : RawRepresentable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, kind: KindType, dictionary: SourceKittenDictionary) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - kind - - -
    -

    The kind of token being recursed over.

    -
    -
    - - dictionary - - -
    -

    The dictionary for an AST subset to validate.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - kind(from:) - -
    -
    -
    -
    -
    -
    -

    Get the kind from the specified dictionary.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func kind(from dictionary: SourceKittenDictionary) -> KindType?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - dictionary - - -
    -

    The SourceKittenDictionary representing the source structure from which to extract the - kind.

    -
    -
    -
    -
    -

    Return Value

    -

    The kind from the specified dictionary, if one was found.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:dictionary:) - - - Extension method - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, dictionary: SourceKittenDictionary) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - dictionary - - -
    -

    The dictionary for an AST subset to validate.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AcceptableByConfigurationElement.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AcceptableByConfigurationElement.html deleted file mode 100644 index 39f08007d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AcceptableByConfigurationElement.html +++ /dev/null @@ -1,591 +0,0 @@ - - - - AcceptableByConfigurationElement Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AcceptableByConfigurationElement

-
-
- -
public protocol AcceptableByConfigurationElement
- -
-
-

Type of an object that can be used as a configuration element.

- - -
-
- -
-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Initializer taking a value from a configuration to create an element of Self.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(fromAny value: Any, context ruleID: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value from a configuration.

    -
    -
    - - ruleID - - -
    -

    The rule’s identifier in which context the configuration parsing runs.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - asOption() - -
    -
    -
    -
    -
    -
    -

    Make the object an option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asOption() -> OptionType
    - -
    -
    -
    -

    Return Value

    -

    Option representing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - asDescription(with:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Make the object a description.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asDescription(with key: String) -> RuleConfigurationDescription
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - key - - -
    -

    Name of the option to be put into the description.

    -
    -
    -
    -
    -

    Return Value

    -

    Configuration description of this object.

    -
    - -
    -
    -
  • -
  • -
    - - - - apply(_:ruleID:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Update the object.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func apply(_ value: Any?, ruleID: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    New underlying data for the object.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html deleted file mode 100644 index a883e92e9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - AnalyzerRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

AnalyzerRule

-
-
- -
public protocol AnalyzerRule : OptInRule
- -
-
-

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like -static analysis than syntactic checks.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CacheDescriptionProvider.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CacheDescriptionProvider.html deleted file mode 100644 index a6160966c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CacheDescriptionProvider.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - CacheDescriptionProvider Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CacheDescriptionProvider

-
-
- -
public protocol CacheDescriptionProvider
- -
-
-

Interface providing access to a cache description.

- - -
-
- -
-
-
-
    -
  • -
    - - - - cacheDescription - -
    -
    -
    -
    -
    -
    -

    The cache description which will be used to determine if a previous -cached value is still valid given the new cache value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CollectingRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CollectingRule.html deleted file mode 100644 index 7964aa8e9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CollectingRule.html +++ /dev/null @@ -1,815 +0,0 @@ - - - - CollectingRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CollectingRule

-
-
- -
public protocol CollectingRule : AnyCollectingRule
- -
-
-

A rule that requires knowledge of all other files being linted.

- - -
-
- -
-
-
-
    -
  • -
    - - - - FileInfo - -
    -
    -
    -
    -
    -
    -

    The kind of information to collect for each file being linted for this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype FileInfo
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, compilerArguments: [String]) -> FileInfo
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    The collected file information.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:) - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile) -> FileInfo
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    -
    -
    -

    Return Value

    -

    The collected file information.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:collectedInfo:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile: FileInfo],
    -              compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - collectedInfo - - -
    -

    All collected info for all files.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile : FileInfo]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - collectedInfo - - -
    -

    All collected info for all files.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:into:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:using:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:compilerArguments:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CorrectableRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CorrectableRule.html deleted file mode 100644 index 8c0a425cf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/CorrectableRule.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - CorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CorrectableRule

-
-
- -
public protocol CorrectableRule : Rule
- -
-
-

A rule that can correct violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - correct(file:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Attempts to correct the violations to this rule in the specified file.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

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

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to correct violations.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:) - -
    -
    -
    -
    -
    -
    -

    Attempts to correct the violations to this rule in the specified file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

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

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to correct violations.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:using:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    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, using storage: RuleStorage, compilerArguments: [String]) -> [Correction]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Documentable.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Documentable.html deleted file mode 100644 index dd2fc66e8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Documentable.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - Documentable Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Documentable

-
-
- -
public protocol Documentable
- -
-
-

A type that can be converted into a human-readable representation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    -

    Convert an object to Markdown.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func markdown() -> String
    - -
    -
    -
    -

    Return Value

    -

    A Markdown string describing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    -

    Convert an object to a single line string.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func oneLiner() -> String
    - -
    -
    -
    -

    Return Value

    -

    A “one liner” describing the object.

    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    -

    Indicate if the item has some content that is useful to document.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    -

    Convert an object to YAML as used in .swiftlint.yml.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func yaml() -> String
    - -
    -
    -
    -

    Return Value

    -

    A YAML snippet that can be used in configuration files.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Reporter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Reporter.html deleted file mode 100644 index d8df8311b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Reporter.html +++ /dev/null @@ -1,554 +0,0 @@ - - - - Reporter Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Reporter

-
-
- -
public protocol Reporter : CustomStringConvertible
- -
-
-

An interface for reporting violations as strings.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The unique identifier for this reporter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var identifier: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isRealtime - -
    -
    -
    -
    -
    -
    -

    Whether or not this reporter can output incrementally as violations are found or if all violations must be -collected before generating the report.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var isRealtime: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A more detailed description of the reporter’s output.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    For CustomStringConvertible conformance.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - generateReport(_:) - -
    -
    -
    -
    -
    -
    -

    Return a string with the report for the specified violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static func generateReport(_ violations: [StyleViolation]) -> String
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations to report.

    -
    -
    -
    -
    -

    Return Value

    -

    The report.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Rule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Rule.html deleted file mode 100644 index ccb68aad9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/Rule.html +++ /dev/null @@ -1,1093 +0,0 @@ - - - - Rule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Rule

-
-
- -
public protocol Rule
- -
-
-

An executable value that can identify issues (violations) in Swift source code.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Description - -
    -
    -
    -
    -
    -
    -

    The rule’s description type.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype Description : Documentable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ConfigurationType - -
    -
    -
    -
    -
    -
    -

    The type of the configuration used to configure this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype ConfigurationType : RuleConfiguration
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A verbose description of many of this rule’s properties.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var description: RuleDescription { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configurationDescription - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    A description of how this rule has been configured to run. It can be built using the annotated result builder.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @RuleConfigurationDescriptionBuilder
    -var configurationDescription: Description { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    This rule’s configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var configuration: ConfigurationType { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - shouldLintEmptyFiles - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Whether this rule should be used on empty files. Defaults to false.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var shouldLintEmptyFiles: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    A default initializer for rules. All rules need to be trivially initializable.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(configuration:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Creates a rule by applying its configuration.

    -
    -

    Throws

    -

    Throws if the configuration didn’t match the expected format.

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(configuration: Any) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - configuration - - -
    -

    The untyped configuration value to apply.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and returns any violations to the rule’s expectations.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file and returns any violations to the rule’s expectations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - isEqualTo(_:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Whether or not the specified rule is equivalent to the current rule.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func isEqualTo(_ rule: any Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule value to compare against.

    -
    -
    -
    -
    -

    Return Value

    -

    Whether or not the specified rule is equivalent to the current rule.

    -
    - -
    -
    -
  • -
  • -
    - - - - collectInfo(for:into:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

    -
    -

    Note

    -

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

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to collect info.

    -
    -
    - - storage - - -
    -

    The storage object where collected info should be saved.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:using:compilerArguments:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s -expectations.

    -
    -

    Note

    -

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

    - -
    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to execute the rule.

    -
    -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    - - compilerArguments - - -
    -

    The compiler arguments needed to compile this file.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations to the rule’s expectations.

    -
    - -
    -
    -
  • -
  • -
    - - - - cacheDescription - - - Extension method - -
    -
    -
    -
    -
    -
    -

    The cache description which will be used to determine if a previous -cached value is still valid given the new cache value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - identifier - - - Extension method - -
    -
    -
    -
    -
    -
    -

    The rule’s unique identifier which is the same as Rule.description.identifier.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    static var identifier: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html deleted file mode 100644 index b3ded1bbb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html +++ /dev/null @@ -1,535 +0,0 @@ - - - - RuleConfiguration Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfiguration

-
-
- -
public protocol RuleConfiguration : Equatable
- -
-
-

A configuration value for a rule to allow users to modify its behavior.

- - -
-
- -
-
-
-
    -
  • -
    - - - - Parent - -
    -
    -
    -
    -
    -
    -

    The type of the rule that’s using this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    associatedtype Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - parameterDescription - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    A description for this configuration’s parameters. It can be built using the annotated result builder.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @RuleConfigurationDescriptionBuilder
    -var parameterDescription: RuleConfigurationDescription? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    -

    Apply an untyped configuration to the current value.

    -
    -

    Throws

    -

    Throws if the configuration is not in the expected format.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    mutating func apply(configuration: Any) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - configuration - - -
    -

    The untyped configuration value to apply.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - supportedKeys - - - Extension method - -
    -
    -
    -
    -
    -
    -

    All keys supported by this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    var supportedKeys: Set<String> { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html deleted file mode 100644 index 7ffcf2d52..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - SeverityBasedRuleConfiguration Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityBasedRuleConfiguration

-
-
- -
public protocol SeverityBasedRuleConfiguration : RuleConfiguration
- -
-
-

A configuration for a rule that allows to configure at least the severity.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SubstitutionCorrectableRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SubstitutionCorrectableRule.html deleted file mode 100644 index c6b54d70f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SubstitutionCorrectableRule.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - SubstitutionCorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SubstitutionCorrectableRule

-
-
- -
public protocol SubstitutionCorrectableRule : CorrectableRule
- -
-
-

A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with -updated content.

- - -
-
- -
-
-
-
    -
  • -
    - - - - violationRanges(in:) - -
    -
    -
    -
    -
    -
    -

    Returns the NSString-based NSRanges to be replaced in the specified file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func violationRanges(in file: SwiftLintFile) -> [NSRange]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file in which to find ranges of violations for this rule.

    -
    -
    -
    -
    -

    Return Value

    -

    The NSString-based NSRanges to be replaced in the specified file.

    -
    - -
    -
    -
  • -
  • -
    - - - - substitution(for:in:) - -
    -
    -
    -
    -
    -
    -

    Returns the substitution to apply for the given range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func substitution(for violationRange: NSRange, in file: SwiftLintFile) -> (NSRange, String)?
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - violationRange - - -
    -

    The NSString-based NSRange of the violation that should be replaced.

    -
    -
    - - file - - -
    -

    The file in which the violation should be replaced.

    -
    -
    -
    -
    -

    Return Value

    -

    The range of the correction and its contents, if one could be computed.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func correct(file: SwiftLintFile) -> [Correction]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxCorrectableRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxCorrectableRule.html deleted file mode 100644 index 4e4ff2826..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxCorrectableRule.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - SwiftSyntaxCorrectableRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftSyntaxCorrectableRule

-
-
- -
public protocol SwiftSyntaxCorrectableRule : CorrectableRule, SwiftSyntaxRule
- -
-
-

A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html deleted file mode 100644 index 5b6892f68..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - SwiftSyntaxRule Protocol Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftSyntaxRule

-
-
- -
public protocol SwiftSyntaxRule : SourceKitFreeRule
- -
-
-

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

- - -
-
- -
-
-
-
    -
  • -
    - - - - makeVisitor(file:) - -
    -
    -
    -
    -
    -
    -

    Produce a ViolationsSyntaxVisitor for the given file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor<ConfigurationType>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file for which to produce the visitor.

    -
    -
    -
    -
    -

    Return Value

    -

    A ViolationsSyntaxVisitor for the given file.

    -
    - -
    -
    -
  • -
  • -
    - - - - makeViolation(file:violation:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Produce a violation for the given file and absolute position.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func makeViolation(file: SwiftLintFile, violation: ReasonedRuleViolation) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for which to produce the violation.

    -
    -
    - - violation - - -
    -

    A violation in the file.

    -
    -
    -
    -
    -

    Return Value

    -

    A violation for the given file and absolute position.

    -
    - -
    -
    -
  • -
  • -
    - - - - preprocess(file:) - - - Default implementation - -
    -
    -
    -
    -
    -
    -

    Gives a chance for the rule to do some pre-processing on the syntax tree. -One typical example is using SwiftOperators to “fold” the tree, resolving operators precedence. -This can also be used to skip validation in a given file. -By default, it just returns the file’s syntaxTree.

    - -
    -

    Default Implementation

    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func preprocess(file: SwiftLintFile) -> SourceFileSyntax?
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - file - - -
    -

    The file to run pre-processing on.

    -
    -
    -
    -
    -

    Return Value

    -

    The tree that will be used to check for violations. If nil, this rule will return no violations.

    -
    - -
    -
    -
  • -
  • -
    - - - - validate(file:) - - - Extension method - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @inlinable
    -func validate(file: SwiftLintFile) -> [StyleViolation]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Rules.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Rules.html deleted file mode 100644 index c6303462c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Rules.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - Rules Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Rules

- -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs.html deleted file mode 100644 index 4304abfd9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs.html +++ /dev/null @@ -1,1404 +0,0 @@ - - - - Structures Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Structures

-

The following structures are available globally.

- -
-
- -
-
-
-
    -
  • -
    - - - - RuleListDocumentation - -
    -
    -
    -
    -
    -
    -

    User-facing documentation for a SwiftLint RuleList.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleListDocumentation
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Stack - -
    -
    -
    -
    -
    -
    -

    A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Stack<Element>
    -
    extension Stack: CustomDebugStringConvertible where Element: CustomDebugStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Baseline - -
    -
    -
    -
    -
    -
    -

    A set of violations that can be used to filter newly detected violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Baseline : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which -case it’s active.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct ChildOptionSeverityConfiguration<Parent> : RuleConfiguration, AcceptableByConfigurationElement where Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Command - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Command : Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Configuration - -
    -
    -
    -
    -
    -
    -

    The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Configuration
    -
    extension Configuration: Hashable
    -
    extension Configuration: CustomStringConvertible
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Correction - -
    -
    -
    -
    -
    -
    -

    A value describing a SwiftLint violation that was corrected.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Correction : Equatable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Example - -
    -
    -
    -
    -
    -
    -

    Captures code and context information for an example of a triggering or -non-triggering style

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Example : Sendable
    -
    extension Example: Hashable
    -
    extension Example: Comparable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Linter - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Linter
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - CollectedLinter - -
    -
    -
    -
    -
    -
    -

    Represents a file that can compute style violations and corrections for a list of rules.

    - -

    A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct CollectedLinter
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Location - -
    -
    -
    -
    -
    -
    -

    The placement of a segment of Swift in a collection of source files.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Location : CustomStringConvertible, Comparable, Codable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Region - -
    -
    -
    -
    -
    -
    -

    A contiguous region of Swift source code.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Region : Equatable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Description of a rule configuration.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleConfigurationDescription : Equatable
    -
    extension RuleConfigurationDescription: Documentable
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    A single option of a RuleConfigurationDescription.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleConfigurationOption : Equatable
    -
    extension RuleConfigurationOption: Documentable
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Result builder -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    A result builder creating configuration descriptions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @resultBuilder
    -public struct RuleConfigurationDescriptionBuilder
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Property wrapper -

-
-
-
    -
  • -
    - - - - ConfigurationElement - -
    -
    -
    -
    -
    -
    -

    A single parameter of a rule configuration.

    - -

    Apply it to a simple (e.g. boolean) property like

    -
    @ConfigurationElement
    -var property = true
    -
    - -

    to add a (boolean) option to a configuration. The name of the option will be inferred from the name of the property. -In this case, it’s just property. CamelCase names will translated into snake_case, i.e. myOption is going to be -translated into my_option in the .swiftlint.yml configuration file.

    - -

    This mechanism may be overwritten with an explicitly set key:

    -
    @ConfigurationElement(key: "foo_bar")
    -var property = true
    -
    - -

    If the wrapped element is an InlinableOptionType, there are three ways to represent it in the documentation:

    - -
      -
    1. It can be inlined into the parent configuration. For that, add the parameter inline: true. E.g. -swift -@ConfigurationElement(inline: true) -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will be documented as a linear list: - -warning: 1 -error: 2 -
    2. -
    3. It can be represented as a separate nested configuration. In this case, it must not have set the inline flag to -true. E.g. -swift -@ConfigurationElement -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will have a nested configuration section: - -levels: warning: 1 - error: 2 -
    4. -
    5. As mentioned in the beginning, the implict key inference meachnism can be overruled by specifying a key as in: -swift -@ConfigurationElement(key: "foo") -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -It will appear in the documentation as: - -foo: warning: 1 - error: 2 -
    6. -
    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @propertyWrapper
    -public struct ConfigurationElement<T> : Equatable where T : Equatable, T : AcceptableByConfigurationElement
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SeverityConfiguration - -
    -
    -
    -
    -
    -
    -

    A rule configuration that allows specifying the desired severity level for violations.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SeverityConfiguration<Parent> : SeverityBasedRuleConfiguration, InlinableOptionType where Parent : Rule
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleDescription - -
    -
    -
    -
    -
    -
    -

    A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleDescription : Equatable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleList - -
    -
    -
    -
    -
    -
    -

    A list of available SwiftLint rules.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleList
    -
    extension RuleList: Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - RuleParameter - -
    -
    -
    -
    -
    -
    -

    A configuration parameter for rules.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct RuleParameter<T> : Equatable where T : Equatable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - StyleViolation - -
    -
    -
    -
    -
    -
    -

    A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct StyleViolation : CustomStringConvertible, Codable, Hashable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftLintSyntaxMap - -
    -
    -
    -
    -
    -
    -

    Represents a Swift file’s syntax information.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftLintSyntaxMap
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftLintSyntaxToken - -
    -
    -
    -
    -
    -
    -

    A SwiftLint-aware Swift syntax token.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftLintSyntaxToken
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - SwiftVersion - -
    -
    -
    -
    -
    -
    -

    A value describing the version of the Swift compiler.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct SwiftVersion : RawRepresentable, Codable, Comparable, Sendable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Version - -
    -
    -
    -
    -
    -
    -

    A type describing the SwiftLint version.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public struct Version
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

YamlParser -

-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Baseline.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Baseline.html deleted file mode 100644 index 159ac9f85..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Baseline.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - Baseline Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Baseline

-
-
- -
public struct Baseline : Equatable
- -
-
-

A set of violations that can be used to filter newly detected violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - violations - -
    -
    -
    -
    -
    -
    -

    The stored violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var violations: [StyleViolation] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(fromPath:) - -
    -
    -
    -
    -
    -
    -

    Creates a Baseline from a saved file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(fromPath path: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - fromPath - - -
    -

    The path to read from.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(violations:) - -
    -
    -
    -
    -
    -
    -

    Creates a Baseline from a list of violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(violations: [StyleViolation])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations for the baseline.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - write(toPath:) - -
    -
    -
    -
    -
    -
    -

    Writes a Baseline to disk in JSON format.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func write(toPath path: String) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - toPath - - -
    -

    The path to write to.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - filter(_:) - -
    -
    -
    -
    -
    -
    -

    Filters out violations that are present in the Baseline.

    - -

    Assumes that all violations are from the same file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func filter(_ violations: [StyleViolation]) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - violations - - -
    -

    The violations to filter.

    -
    -
    -
    -
    -

    Return Value

    -

    The new violations.

    -
    - -
    -
    -
  • -
  • -
    - - - - compare(_:) - -
    -
    -
    -
    -
    -
    -

    Returns the violations that are present in another Baseline, but not in this one.

    - -

    The violations are filtered using the same algorithm as the filter method above.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func compare(_ otherBaseline: Baseline) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - otherBaseline - - -
    -

    The other Baseline.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ChildOptionSeverityConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ChildOptionSeverityConfiguration.html deleted file mode 100644 index 81c78cb05..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ChildOptionSeverityConfiguration.html +++ /dev/null @@ -1,560 +0,0 @@ - - - - ChildOptionSeverityConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ChildOptionSeverityConfiguration

-
-
- -
public struct ChildOptionSeverityConfiguration<Parent> : RuleConfiguration, AcceptableByConfigurationElement where Parent : Rule
- -
-
-

A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which -case it’s active.

- - -
-
- -
-
-
-
    -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Configuration with a warning severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var error: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Configuration with an error severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var warning: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - off - -
    -
    -
    -
    -
    -
    -

    Configuration disabling an option.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var off: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The ChildOptionSeverityConfiguration mapped to a usually used ViolationSeverity. It’s nil if the option -is set to off.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var severity: ViolationSeverity? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - asOption() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func asOption() -> OptionType
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/CollectedLinter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/CollectedLinter.html deleted file mode 100644 index e18139ac5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/CollectedLinter.html +++ /dev/null @@ -1,633 +0,0 @@ - - - - CollectedLinter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

CollectedLinter

-
-
- -
public struct CollectedLinter
- -
-
-

Represents a file that can compute style violations and corrections for a list of rules.

- -

A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file to lint with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Computes or retrieves style violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func styleViolations(using storage: RuleStorage) -> [StyleViolation]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations found by this linter.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Computes or retrieves style violations and the time spent executing each rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func styleViolationsAndRuleTimes(using storage: RuleStorage)
    -    -> ([StyleViolation], [(id: String, time: Double)])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All style violations found by this linter, and the time spent executing each rule.

    -
    - -
    -
    -
  • -
  • -
    - - - - correct(using:) - -
    -
    -
    -
    -
    -
    -

    Applies corrections for all rules to this file, returning performed corrections.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func correct(using storage: RuleStorage) -> [Correction]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - storage - - -
    -

    The storage object containing all collected info.

    -
    -
    -
    -
    -

    Return Value

    -

    All corrections that were applied.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Formats the file associated with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func format(useTabs: Bool, indentWidth: Int)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - useTabs - - -
    -

    Should the file be formatted using tabs?

    -
    -
    - - indentWidth - - -
    -

    How many spaces should be used per indentation level.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command.html deleted file mode 100644 index 6e988e151..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command.html +++ /dev/null @@ -1,777 +0,0 @@ - - - - Command Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Command

-
-
- -
public struct Command : Equatable
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - Action - -
    -
    -
    -
    -
    -
    -

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

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum Action : String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - Modifier - -
    -
    -
    -
    -
    -
    -

    The modifier for a command, used to modify its scope.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum Modifier : String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - action - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let action: Action
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleIdentifiers - -
    -
    -
    -
    -
    -
    -

    The identifiers for the rules associated with this command.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleIdentifiers: Set<RuleIdentifier>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let line: Int
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - character - -
    -
    -
    -
    -
    -
    -

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

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let character: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - modifier - -
    -
    -
    -
    -
    -
    -

    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.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Action.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Action.html deleted file mode 100644 index a4e0d2532..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Action.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - Action Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Action

-
-
- -
public enum Action : String
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - enable - -
    -
    -
    -
    -
    -
    -

    The rule(s) associated with this command should be enabled by the SwiftLint engine.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case enable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - disable - -
    -
    -
    -
    -
    -
    -

    The rule(s) associated with this command should be disabled by the SwiftLint engine.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case disable
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalid - -
    -
    -
    -
    -
    -
    -

    The action string was invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalid
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Modifier.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Modifier.html deleted file mode 100644 index f21fc5a9b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Command/Modifier.html +++ /dev/null @@ -1,500 +0,0 @@ - - - - Modifier Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Modifier

-
-
- -
public enum Modifier : String
- -
-
-

The modifier for a command, used to modify its scope.

- - -
-
- -
-
-
-
    -
  • -
    - - - - previous - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the line preceding its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case previous
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - this - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the same line as its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case this
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - next - -
    -
    -
    -
    -
    -
    -

    The command should only apply to the line following its definition.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case next
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - invalid - -
    -
    -
    -
    -
    -
    -

    The modifier string was invalid.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    case invalid
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Configuration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Configuration.html deleted file mode 100644 index 502be44cb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Configuration.html +++ /dev/null @@ -1,1087 +0,0 @@ - - - - Configuration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Configuration

-
-
- -
public struct Configuration
-
extension Configuration: Hashable
-
extension Configuration: CustomStringConvertible
- -
-
-

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

- - -
-
- -
-
-
-
- - -
- -

Properties: Static -

-
-
-
    -
  • -
    - - - - default - -
    -
    -
    -
    -
    -
    -

    The default Configuration resulting from an empty configuration file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var `default`: Configuration { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - defaultFileName - -
    -
    -
    -
    -
    -
    -

    The default file name to look for user-defined configurations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let defaultFileName: String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public Instance -

-
-
-
    -
  • -
    - - - - includedPaths - -
    -
    -
    -
    -
    -
    -

    The paths that should be included when linting

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var includedPaths: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excludedPaths - -
    -
    -
    -
    -
    -
    -

    The paths that should be excluded when linting

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var excludedPaths: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - indentation - -
    -
    -
    -
    -
    -
    -

    The style to use when indenting Swift source code.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let indentation: IndentationStyle
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warningThreshold - -
    -
    -
    -
    -
    -
    -

    The threshold for the number of warnings to tolerate before treating the lint as having failed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let warningThreshold: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reporter - -
    -
    -
    -
    -
    -
    -

    The identifier for the Reporter to use to report style violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reporter: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - cachePath - -
    -
    -
    -
    -
    -
    -

    The location of the persisted cache to use with this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let cachePath: String?
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let allowZeroLintableFiles: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - strict - -
    -
    -
    -
    -
    -
    -

    Treat warnings as errors

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let strict: Bool
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    This value is true iff the --config parameter was used to specify (a) configuration file(s) -In particular, this means that the value is also true if the --config parameter -was used to explicitly specify the default .swiftlint.yml as the configuration file

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var basedOnCustomConfigurationFiles: Bool { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public Computed -

-
-
-
    -
  • -
    - - - - rules - -
    -
    -
    -
    -
    -
    -

    All rules enabled in this configuration

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rules: [any Rule] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - rootDirectory - -
    -
    -
    -
    -
    -
    -

    The root directory is the directory that included & excluded paths relate to. -By default, the root directory is the current working directory, -but during some merging algorithms it may be used differently. -The rootDirectory also serves as the stopping point when searching for nested configs along the file hierarchy.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rootDirectory: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - rulesMode - -
    -
    -
    -
    -
    -
    -

    The rules mode used for this configuration.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var rulesMode: RulesMode { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Public -

-
-
-
    -
  • - -
    -
    -
    -
    -
    -

    Creates a Configuration with convenience parameters.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(
    -    configurationFiles: [String], // No default value here to avoid ambiguous Configuration() initializer
    -    enableAllRules: Bool = false,
    -    cachePath: String? = nil,
    -    ignoreParentAndChildConfigs: Bool = false,
    -    mockedNetworkResults: [String: String] = [:],
    -    useDefaultConfigOnFailure: Bool? = nil // swiftlint:disable:this discouraged_optional_boolean
    -)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - configurationFiles - - -
    -

    The path on disk to one or multiple configuration files. If this array - is empty, the default .swiftlint.yml file will be used.

    -
    -
    - - enableAllRules - - -
    -

    Enable all available rules.

    -
    -
    - - cachePath - - -
    -

    The location of the persisted cache to use whith this configuration.

    -
    -
    - - ignoreParentAndChildConfigs - - -
    -

    If true, child and parent config references will be ignored.

    -
    -
    - - mockedNetworkResults - - -
    -

    For testing purposes only. Instead of loading the specified urls, - the mocked value will be used. Example: [“http://mock.com”: “content”]

    -
    -
    - - useDefaultConfigOnFailure - - -
    -

    If this value is specified, it will override the normal behavior. - This is only intended for tests checking whether invalid configs fail.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Hashable -

-
-
-
    -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: Configuration, rhs: Configuration) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

CustomStringConvertible -

-
-
-
    -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement.html deleted file mode 100644 index 66b9aa4f2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement.html +++ /dev/null @@ -1,876 +0,0 @@ - - - - ConfigurationElement Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ConfigurationElement

-
-
- -
@propertyWrapper
-public struct ConfigurationElement<T> : Equatable where T : Equatable, T : AcceptableByConfigurationElement
- -
-
-

A single parameter of a rule configuration.

- -

Apply it to a simple (e.g. boolean) property like

-
@ConfigurationElement
-var property = true
-
- -

to add a (boolean) option to a configuration. The name of the option will be inferred from the name of the property. -In this case, it’s just property. CamelCase names will translated into snake_case, i.e. myOption is going to be -translated into my_option in the .swiftlint.yml configuration file.

- -

This mechanism may be overwritten with an explicitly set key:

-
@ConfigurationElement(key: "foo_bar")
-var property = true
-
- -

If the wrapped element is an InlinableOptionType, there are three ways to represent it in the documentation:

- -
    -
  1. It can be inlined into the parent configuration. For that, add the parameter inline: true. E.g. -swift -@ConfigurationElement(inline: true) -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will be documented as a linear list: - -warning: 1 -error: 2 -
  2. -
  3. It can be represented as a separate nested configuration. In this case, it must not have set the inline flag to -true. E.g. -swift -@ConfigurationElement -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -will have a nested configuration section: - -levels: warning: 1 - error: 2 -
  4. -
  5. As mentioned in the beginning, the implict key inference meachnism can be overruled by specifying a key as in: -swift -@ConfigurationElement(key: "foo") -var levels = SeverityLevelsConfiguration(warning: 1, error: 2) - -It will appear in the documentation as: - -foo: warning: 1 - error: 2 -
  6. -
- - -
-
- -
-
-
-
    -
  • -
    - - - - DeprecationNotice - -
    -
    -
    -
    -
    -
    -

    A deprecation notice.

    - - See more -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public enum DeprecationNotice
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - wrappedValue - -
    -
    -
    -
    -
    -
    -

    Wrapped option value.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var wrappedValue: T { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - projectedValue - -
    -
    -
    -
    -
    -
    -

    The wrapper itself providing access to all its data. This field can only be accessed by the -element’s name prefixed with a $.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var projectedValue: ConfigurationElement { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - key - -
    -
    -
    -
    -
    -
    -

    Name of this configuration entry.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var key: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - inline - -
    -
    -
    -
    -
    -
    -

    Whether this configuration element will be inlined into its description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let inline: Bool
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Default constructor.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T,
    -            key: String,
    -            deprecationNotice: DeprecationNotice? = nil,
    -            postprocessor: @escaping (inout T) -> Void = { _ in })
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - key - - -
    -

    Optional name of the option. If not specified, it will be inferred from the attributed property.

    -
    -
    - - deprecationNotice - - -
    -

    An optional deprecation notice in case an option is outdated and/or has been replaced by - an alternative.

    -
    -
    - - postprocessor - - -
    -

    Function to be applied to the wrapped value after parsing to validate and modify it.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(key:) - -
    -
    -
    -
    -
    -
    -

    Constructor for optional values.

    - -

    It allows to skip explicit initialization of the property with nil.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init<Wrapped>(key: String) where T == Wrapped?, Wrapped : Equatable, Wrapped : AcceptableByConfigurationElement
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - key - - -
    -

    Optional name of the option. If not specified, it will be inferred from the attributed property.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Constructor for an InlinableOptionType without a key.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T, inline: Bool) where T : InlinableOptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - inline - - -
    -

    If true, the option will be handled as it would be part of its parent. All of its options - will be inlined. Otherwise, it will be treated as a normal nested configuration with its name - inferred from the name of the attributed property.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Constructor for an InlinableOptionType with a name. The configuration will explicitly not be inlined.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(wrappedValue value: T, key: String) where T : InlinableOptionType
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - value - - -
    -

    Value to be wrapped.

    -
    -
    - - key - - -
    -

    Name of the option.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: ConfigurationElement, rhs: ConfigurationElement) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement/DeprecationNotice.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement/DeprecationNotice.html deleted file mode 100644 index 1e539f65d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ConfigurationElement/DeprecationNotice.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - DeprecationNotice Enumeration Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

DeprecationNotice

-
-
- -
public enum DeprecationNotice
- -
-
-

A deprecation notice.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Correction.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Correction.html deleted file mode 100644 index 858dc7f71..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Correction.html +++ /dev/null @@ -1,531 +0,0 @@ - - - - Correction Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Correction

-
-
- -
public struct Correction : Equatable, Sendable
- -
-
-

A value describing a SwiftLint violation that was corrected.

- - -
-
- -
-
-
-
    -
  • -
    - - - - ruleDescription - -
    -
    -
    -
    -
    -
    -

    The description of the rule for which this correction was applied.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleDescription: RuleDescription
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - location - -
    -
    -
    -
    -
    -
    -

    The location of the original violation that was corrected.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let location: Location
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - consoleDescription - -
    -
    -
    -
    -
    -
    -

    The console-printable description for this correction.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var consoleDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Memberwise initializer.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(ruleDescription: RuleDescription, location: Location)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - ruleDescription - - -
    -

    The description of the rule for which this correction was applied.

    -
    -
    - - location - - -
    -

    The location of the original violation that was corrected.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Example.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Example.html deleted file mode 100644 index c30785c30..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Example.html +++ /dev/null @@ -1,923 +0,0 @@ - - - - Example Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Example

-
-
- -
public struct Example : Sendable
-
extension Example: Hashable
-
extension Example: Comparable
- -
-
-

Captures code and context information for an example of a triggering or -non-triggering style

- - -
-
- -
-
-
-
    -
  • -
    - - - - code - -
    -
    -
    -
    -
    -
    -

    The contents of the example

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var code: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - configuration - -
    -
    -
    -
    -
    -
    -

    The untyped configuration to apply to the rule, if deviating from the default configuration. -The structure should match what is expected as a configuration value for the rule being tested.

    - -

    For example, if the following YAML would be used to configure the rule:

    -
    severity: warning
    -
    - -

    Then the equivalent configuration value would be ["severity": "warning"].

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var configuration: [String : any Sendable]? { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - testMultiByteOffsets - -
    -
    -
    -
    -
    -
    -

    Whether the example should be tested by prepending multibyte grapheme clusters

    -
    -

    See also

    - addEmoji(_:) - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var testMultiByteOffsets: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - testOnLinux - -
    -
    -
    -
    -
    -
    -

    Whether the example should be tested on Linux

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var testOnLinux: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The path to the file where the example was created

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var file: StaticString { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

    The line in the file where the example was created

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var line: UInt
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Create a new Example with the specified code, file, and line.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    init(_ code: String, configuration: [String: any Sendable]? = nil, testMultiByteOffsets: Bool = true,
    -     testWrappingInComment: Bool = true, testWrappingInString: Bool = true, testDisableCommand: Bool = true,
    -     testOnLinux: Bool = true, file: StaticString = #file, line: UInt = #line,
    -     excludeFromDocumentation: Bool = false)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - code - - -
    -

    The contents of the example.

    -
    -
    - - configuration - - -
    -

    The untyped configuration to apply to the rule, if deviating from the default - configuration.

    -
    -
    - - testMultibyteOffsets - - -
    -

    Whether the example should be tested by prepending multibyte grapheme clusters.

    -
    -
    - - testWrappingInComment - - -
    -

    Whether test shall verify that the example wrapped in a comment doesn’t trigger.

    -
    -
    - - testWrappingInString - - -
    -

    Whether tests shall verify that the example wrapped into a string doesn’t trigger.

    -
    -
    - - testDisableCommand - - -
    -

    Whether tests shall verify that the disabled rule (comment in the example) doesn’t - trigger.

    -
    -
    - - testOnLinux - - -
    -

    Whether the example should be tested on Linux.

    -
    -
    - - file - - -
    -

    The path to the file where the example is located. - Defaults to the file where this initializer is called.

    -
    -
    - - line - - -
    -

    The line in the file where the example is located. - Defaults to the line where this initializer is called.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(code:) - -
    -
    -
    -
    -
    -
    -

    Returns the same example, but with the code that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func with(code: String) -> Example
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - code - - -
    -

    the new code to use in the modified example

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Returns a copy of the Example with all instances of the “↓” character removed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func removingViolationMarkers() -> Example
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - focused() - -
    -
    -
    -
    -
    -
    -

    Makes the current example focused. This is for debugging purposes only.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func focused() -> Example
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: Example, rhs: Example) -> Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: Example, rhs: Example) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Linter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Linter.html deleted file mode 100644 index a80ae0274..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Linter.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - Linter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Linter

-
-
- -
public struct Linter
- -
-
-

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

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file to lint with this linter.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: SwiftLintFile
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - isCollecting - -
    -
    -
    -
    -
    -
    -

    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.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - collect(into:) - -
    -
    -
    -
    -
    -
    -

    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.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Location.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Location.html deleted file mode 100644 index 552e49f33..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Location.html +++ /dev/null @@ -1,831 +0,0 @@ - - - - Location Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Location

-
-
- -
public struct Location : CustomStringConvertible, Comparable, Codable, Sendable
- -
-
-

The placement of a segment of Swift in a collection of source files.

- - -
-
- -
-
-
-
    -
  • -
    - - - - file - -
    -
    -
    -
    -
    -
    -

    The file path on disk for this location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let file: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - line - -
    -
    -
    -
    -
    -
    -

    The line offset in the file for this location. 1-indexed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let line: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - character - -
    -
    -
    -
    -
    -
    -

    The character offset in the file for this location. 1-indexed.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let character: Int?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A lossless printable description of this location.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - relativeFile - -
    -
    -
    -
    -
    -
    -

    The file path for this location relative to the current working directory.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var relativeFile: String? { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: String?, line: Int? = nil, character: Int? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - file - - -
    -

    The file path on disk for this location.

    -
    -
    - - line - - -
    -

    The line offset in the file for this location. 1-indexed.

    -
    -
    - - character - - -
    -

    The character offset in the file for this location. 1-indexed.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a byte-offset into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, byteOffset offset: ByteCount)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - offset - - -
    -

    The offset in bytes into the file for this location.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(file:position:) - -
    -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, position: AbsolutePosition)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - position - - -
    -

    The absolute position returned from SwiftSyntax.

    -
    -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file. -Fails if the specified offset was not a valid location in the file.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(file: SwiftLintFile, characterOffset offset: Int)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - file - - -
    -

    The file for this location.

    -
    -
    - - offset - - -
    -

    The offset in UTF8 fragments into the file for this location.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Comparable -

-
-
-
    -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: Location, rhs: Location) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html deleted file mode 100644 index 5269752d2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - ReasonedRuleViolation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ReasonedRuleViolation

-
-
- -
public struct ReasonedRuleViolation : Comparable, Hashable
- -
-
-

A violation produced by ViolationsSyntaxVisitors.

- - -
-
- -
-
-
-
    -
  • -
    - - - - position - -
    -
    -
    -
    -
    -
    -

    The violation’s position.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let position: AbsolutePosition
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reason - -
    -
    -
    -
    -
    -
    -

    A specific reason for the violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reason: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The violation’s severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let severity: ViolationSeverity?
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a ReasonedRuleViolation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(position: AbsolutePosition, reason: String? = nil, severity: ViolationSeverity? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - position - - -
    -

    The violations position in the analyzed source file.

    -
    -
    - - reason - - -
    -

    The reason for the violation if different from the rule’s description.

    -
    -
    - - severity - - -
    -

    The severity of the violation if different from the rule’s default configured severity.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - <(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func < (lhs: `Self`, rhs: `Self`) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RegexConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RegexConfiguration.html deleted file mode 100644 index e4c2319f5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RegexConfiguration.html +++ /dev/null @@ -1,788 +0,0 @@ - - - - RegexConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RegexConfiguration

-
-
- -
public struct RegexConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration, Hashable,
-                                                CacheDescriptionProvider, InlinableOptionType
- -
-
-

A rule configuration used for defining custom rules in yaml.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The identifier for this custom rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let identifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - name - -
    -
    -
    -
    -
    -
    -

    The name for this custom rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var name: String?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - message - -
    -
    -
    -
    -
    -
    -

    The message to be presented when producing violations.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var message: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - included - -
    -
    -
    -
    -
    -
    -

    Regular expressions to include when matching the file path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var included: [NSRegularExpression]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excluded - -
    -
    -
    -
    -
    -
    -

    Regular expressions to exclude when matching the file path.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var excluded: [NSRegularExpression]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - excludedMatchKinds - -
    -
    -
    -
    -
    -
    -

    The syntax kinds to exclude from matches. If the regex matched syntax kinds from this list, it would -be ignored and not count as a rule violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var excludedMatchKinds: Set<SyntaxKind>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severityConfiguration - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var severityConfiguration: SeverityConfiguration<Parent> { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - captureGroup - -
    -
    -
    -
    -
    -
    -

    The index of the regex capture group to match.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var captureGroup: Int
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - cacheDescription - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var cacheDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    The RuleDescription for the custom rule defined here.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: RuleDescription { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(identifier:) - -
    -
    -
    -
    -
    -
    -

    Create a RegexConfiguration with the specified identifier, with other properties to be set later.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(identifier: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - identifier - - -
    -

    The rule identifier to use.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Region.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Region.html deleted file mode 100644 index 64d321516..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Region.html +++ /dev/null @@ -1,811 +0,0 @@ - - - - Region Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Region

-
-
- -
public struct Region : Equatable
- -
-
-

A contiguous region of Swift source code.

- - -
-
- -
-
-
-
    -
  • -
    - - - - start - -
    -
    -
    -
    -
    -
    -

    The location describing the start of the region. All locations that are less than this value -(earlier in the source file) are not contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let start: Location
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - end - -
    -
    -
    -
    -
    -
    -

    The location describing the end of the region. All locations that are greater than this value -(later in the source file) are not contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let end: Location
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    All SwiftLint rule identifiers that are disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let disabledRuleIdentifiers: Set<RuleIdentifier>
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a Region by setting explicit values for all its properties.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(start: Location, end: Location, disabledRuleIdentifiers: Set<RuleIdentifier>)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - start - - -
    -

    The region’s starting location.

    -
    -
    - - end - - -
    -

    The region’s ending location.

    -
    -
    - - disabledRuleIdentifiers - - -
    -

    All SwiftLint rule identifiers that are disabled in this region.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - contains(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specific location is contained in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func contains(_ location: Location) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - location - - -
    -

    The location to check for containment.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specific location is contained in this region.

    -
    - -
    -
    -
  • -
  • -
    - - - - isRuleEnabled(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specified rule is enabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func isRuleEnabled(_ rule: some Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule whose status should be determined.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rule is enabled in this region.

    -
    - -
    -
    -
  • -
  • -
    - - - - isRuleDisabled(_:) - -
    -
    -
    -
    -
    -
    -

    Whether the specified rule is disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func isRuleDisabled(_ rule: some Rule) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule whose status should be determined.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rule is disabled in this region.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Whether the given rules are disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func areRulesDisabled(ruleIDs: [String]) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - ruleIDs - - -
    -

    A list of rule IDs. Typically all identifiers of a single rule.

    -
    -
    -
    -
    -

    Return Value

    -

    True if the specified rules are disabled in this region.

    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Returns the deprecated rule aliases that are disabling the specified rule in this region. -Returns the empty set if the rule isn’t disabled in this region.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func deprecatedAliasesDisabling(rule: some Rule) -> Set<String>
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rule - - -
    -

    The rule to check.

    -
    -
    -
    -
    -

    Return Value

    -

    Deprecated rule aliases.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationDescription.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationDescription.html deleted file mode 100644 index 92d3aff93..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationDescription.html +++ /dev/null @@ -1,497 +0,0 @@ - - - - RuleConfigurationDescription Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfigurationDescription

-
-
- -
public struct RuleConfigurationDescription : Equatable
-
extension RuleConfigurationDescription: Documentable
- -
-
-

Description of a rule configuration.

- - -
-
- -
-
-
-
    -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationOption.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationOption.html deleted file mode 100644 index 8e7160a9d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleConfigurationOption.html +++ /dev/null @@ -1,527 +0,0 @@ - - - - RuleConfigurationOption Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleConfigurationOption

-
-
- -
public struct RuleConfigurationOption : Equatable
-
extension RuleConfigurationOption: Documentable
- -
-
-

A single option of a RuleConfigurationDescription.

- - -
-
- -
-
-
-
    -
  • -
    - - - - noOptions - -
    -
    -
    -
    -
    -
    -

    An option serving as a marker for an empty configuration description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let noOptions: RuleConfigurationOption
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - hasContent - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var hasContent: Bool { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - markdown() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func markdown() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - oneLiner() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func oneLiner() -> String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - yaml() - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func yaml() -> String
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleDescription.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleDescription.html deleted file mode 100644 index 58c730a75..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleDescription.html +++ /dev/null @@ -1,965 +0,0 @@ - - - - RuleDescription Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleDescription

-
-
- -
public struct RuleDescription : Equatable, Sendable
- -
-
-

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

- - -
-
- -
-
-
-
    -
  • -
    - - - - identifier - -
    -
    -
    -
    -
    -
    -

    The rule’s unique identifier, to be used in configuration files and SwiftLint commands. -Should be short and only comprised of lowercase latin alphabet letters and underscores formatted in snake case.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let identifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - name - -
    -
    -
    -
    -
    -
    -

    The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let name: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an -explanation of the rule’s purpose and rationale.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let description: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - kind - -
    -
    -
    -
    -
    -
    -

    The RuleKind that best categorizes this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let kind: RuleKind
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - nonTriggeringExamples - -
    -
    -
    -
    -
    -
    -

    Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform -users of various samples of code that are considered valid by this rule. Should be valid Swift syntax but is not -required to compile.

    - -

    These examples are also used for automatic testing purposes. Tests will validate that the rule does not trigger -any violations for these examples.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let nonTriggeringExamples: [Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - triggeringExamples - -
    -
    -
    -
    -
    -
    -

    Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to -inform users of various samples of code that are considered invalid by this rule. Should be valid Swift syntax -but is not required to compile.

    - -

    Violations should occur where ↓ markers are located.

    - -

    These examples are also used for automatic testing purposes. Tests will validate that the rule triggers -violations for these examples wherever ↓ markers are located.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let triggeringExamples: [Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - corrections - -
    -
    -
    -
    -
    -
    -

    Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values -are the expected value after applying corrections with the rule.

    - -

    Rules that aren’t correctable (conforming to the CorrectableRule protocol) should leave property empty.

    - -

    These examples are used for testing purposes if the rule conforms to AutomaticTestableRule. Tests will -validate that the rule corrects all keys to their corresponding values.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let corrections: [Example : Example]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - deprecatedAliases - -
    -
    -
    -
    -
    -
    -

    Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let deprecatedAliases: Set<String>
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - minSwiftVersion - -
    -
    -
    -
    -
    -
    -

    The oldest version of the Swift compiler supported by this rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let minSwiftVersion: SwiftVersion
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - requiresFileOnDisk - -
    -
    -
    -
    -
    -
    -

    Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules -conforming to AnalyzerRule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let requiresFileOnDisk: Bool
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - consoleDescription - -
    -
    -
    -
    -
    -
    -

    The console-printable string for this description.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var consoleDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - allIdentifiers - -
    -
    -
    -
    -
    -
    -

    All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var allIdentifiers: [String] { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a RuleDescription by specifying all its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(identifier: String, name: String, description: String, kind: RuleKind,
    -            minSwiftVersion: SwiftVersion = .five,
    -            nonTriggeringExamples: [Example] = [], triggeringExamples: [Example] = [],
    -            corrections: [Example: Example] = [:],
    -            deprecatedAliases: Set<String> = [],
    -            requiresFileOnDisk: Bool = false)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - identifier - - -
    -

    Sets the description’s identifier property.

    -
    -
    - - name - - -
    -

    Sets the description’s name property.

    -
    -
    - - description - - -
    -

    Sets the description’s description property.

    -
    -
    - - kind - - -
    -

    Sets the description’s kind property.

    -
    -
    - - minSwiftVersion - - -
    -

    Sets the description’s minSwiftVersion property.

    -
    -
    - - nonTriggeringExamples - - -
    -

    Sets the description’s nonTriggeringExamples property.

    -
    -
    - - triggeringExamples - - -
    -

    Sets the description’s triggeringExamples property.

    -
    -
    - - corrections - - -
    -

    Sets the description’s corrections property.

    -
    -
    - - deprecatedAliases - - -
    -

    Sets the description’s deprecatedAliases property.

    -
    -
    - - requiresFileOnDisk - - -
    -

    Sets the description’s requiresFileOnDisk property.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Equatable -

-
-
-
    -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleList.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleList.html deleted file mode 100644 index 851851876..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleList.html +++ /dev/null @@ -1,551 +0,0 @@ - - - - RuleList Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleList

-
-
- -
public struct RuleList
-
extension RuleList: Equatable
- -
-
-

A list of available SwiftLint rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - list - -
    -
    -
    -
    -
    -
    -

    The rules contained in this list.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let list: [String : any Rule.Type]
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Initializers -

-
-
-
    -
  • -
    - - - - init(rules:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleList by specifying all its rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(rules: any Rule.Type...)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to be contained in this list.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(rules:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleList by specifying all its rules.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(rules: [any Rule.Type])
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - rules - - -
    -

    The rules to be contained in this list.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - ==(_:_:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func == (lhs: RuleList, rhs: RuleList) -> Bool
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html deleted file mode 100644 index 28cc700bc..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - RuleListDocumentation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleListDocumentation

-
-
- -
public struct RuleListDocumentation
- -
-
-

User-facing documentation for a SwiftLint RuleList.

- - -
-
- -
-
-
-
    -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleListDocumentation instance from a RuleList.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ list: RuleList)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - list - - -
    -

    A RuleList to document.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - write(to:) - -
    -
    -
    -
    -
    -
    -

    Write the rule list documentation as markdown files to the specified directory.

    -
    -

    Throws

    -

    Throws if the files could not be written to.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func write(to url: URL) throws
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - url - - -
    -

    Local URL for directory where the markdown files for this documentation should be saved.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleParameter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleParameter.html deleted file mode 100644 index dde4e6bd5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/RuleParameter.html +++ /dev/null @@ -1,501 +0,0 @@ - - - - RuleParameter Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

RuleParameter

-
-
- -
public struct RuleParameter<T> : Equatable where T : Equatable
- -
-
-

A configuration parameter for rules.

- - -
-
- -
-
-
-
    -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The severity that should be assigned to the violation of this parameter’s value is met.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let severity: ViolationSeverity
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The value to configure the rule.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: T
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(severity:value:) - -
    -
    -
    -
    -
    -
    -

    Creates a RuleParameter by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(severity: ViolationSeverity, value: T)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - severity - - -
    -

    The severity that should be assigned to the violation of this parameter’s value is met.

    -
    -
    - - value - - -
    -

    The value to configure the rule.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityConfiguration.html deleted file mode 100644 index 1c9f7f16b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityConfiguration.html +++ /dev/null @@ -1,591 +0,0 @@ - - - - SeverityConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityConfiguration

-
-
- -
public struct SeverityConfiguration<Parent> : SeverityBasedRuleConfiguration, InlinableOptionType where Parent : Rule
- -
-
-

A rule configuration that allows specifying the desired severity level for violations.

- - -
-
- -
-
-
-
    -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    Configuration with a warning severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var error: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    Configuration with an error severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static var warning: `Self` { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severityConfiguration - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var severityConfiguration: SeverityConfiguration { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(_:) - -
    -
    -
    -
    -
    -
    -

    Create a SeverityConfiguration with the specified severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(_ severity: ViolationSeverity)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - severity - - -
    -

    The severity that should be used when emitting violations.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

RuleConfiguration conformances -

-
-
-
    -
  • -
    - - - - asDescription(with:) - -
    -
    -
    -
    -
    -
    -

    Severity configurations are special in that they shall not be nested when an option name is provided. -Instead, their only option value must be used together with the option name.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    func asDescription(with key: String) -> RuleConfigurationDescription
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityLevelsConfiguration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityLevelsConfiguration.html deleted file mode 100644 index e2b9ac377..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SeverityLevelsConfiguration.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - SeverityLevelsConfiguration Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SeverityLevelsConfiguration

-
-
- -
public struct SeverityLevelsConfiguration<Parent> : RuleConfiguration, InlinableOptionType where Parent : Rule
- -
-
-

A rule configuration that allows specifying thresholds for warning and error severities.

- - -
-
- -
-
-
-
    -
  • -
    - - - - warning - -
    -
    -
    -
    -
    -
    -

    The threshold for a violation to be a warning.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var warning: Int { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - error - -
    -
    -
    -
    -
    -
    -

    The threshold for a violation to be an error.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @ConfigurationElement
    -public var error: Int? { get set }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(warning:error:) - -
    -
    -
    -
    -
    -
    -

    Create a SeverityLevelsConfiguration based on the sepecified warning and error thresholds.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(warning: Int, error: Int? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - warning - - -
    -

    The threshold for a violation to be a warning.

    -
    -
    - - error - - -
    -

    The threshold for a violation to be an error.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - params - -
    -
    -
    -
    -
    -
    -

    The rule parameters that define the thresholds that should map to each severity.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var params: [RuleParameter<Int>] { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - apply(configuration:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func apply(configuration: Any) throws
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Stack.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Stack.html deleted file mode 100644 index eff46041e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Stack.html +++ /dev/null @@ -1,700 +0,0 @@ - - - - Stack Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Stack

-
-
- -
public struct Stack<Element>
-
extension Stack: CustomDebugStringConvertible where Element: CustomDebugStringConvertible
- -
-
-

A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

- - -
-
- -
-
-
-
    -
  • -
    - - - - init() - -
    -
    -
    -
    -
    -
    -

    Creates an empty Stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init()
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - count - -
    -
    -
    -
    -
    -
    -

    The number of elements in this stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var count: Int { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - push(_:) - -
    -
    -
    -
    -
    -
    -

    Pushes (appends) an element onto the stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func push(_ element: Element)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - element - - -
    -

    The element to push onto the stack.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - pop() - -
    -
    -
    -
    -
    -
    -

    Removes and returns the last element of the stack.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    @discardableResult
    -public mutating func pop() -> Element?
    - -
    -
    -
    -

    Return Value

    -

    The last element of the stack if the stack is not empty; otherwise, nil.

    -
    - -
    -
    -
  • -
  • -
    - - - - peek() - -
    -
    -
    -
    -
    -
    -

    Returns the last element of the stack if the stack is not empty; otherwise, nil.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func peek() -> Element?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - contains(where:) - -
    -
    -
    -
    -
    -
    -

    Check whether the sequence contains an element that satisfies the given predicate.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func contains(where predicate: (Element) -> Bool) -> Bool
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - predicate - - -
    -

    A closure that takes an element of the sequence -and returns whether it represents a match.

    -
    -
    -
    -
    -

    Return Value

    -

    true if the sequence contains an element that satisfies predicate.

    -
    - -
    -
    -
  • -
  • -
    - - - - modifyLast(by:) - -
    -
    -
    -
    -
    -
    -

    Modify the last element.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public mutating func modifyLast(by modifier: (inout Element) -> Void)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - modifier - - -
    -

    A function to be applied to the last element to modify the same in place.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- - -
- -

Available where Element: CustomDebugStringConvertible -

-
-
-
    -
  • -
    - - - - debugDescription - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var debugDescription: String { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/StyleViolation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/StyleViolation.html deleted file mode 100644 index e50cea87d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/StyleViolation.html +++ /dev/null @@ -1,806 +0,0 @@ - - - - StyleViolation Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

StyleViolation

-
-
- -
public struct StyleViolation : CustomStringConvertible, Codable, Hashable
- -
-
-

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

- - -
-
- -
-
-
-
    -
  • -
    - - - - ruleIdentifier - -
    -
    -
    -
    -
    -
    -

    The identifier of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleIdentifier: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleDescription - -
    -
    -
    -
    -
    -
    -

    The description of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleDescription: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - ruleName - -
    -
    -
    -
    -
    -
    -

    The name of the rule that generated this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let ruleName: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - severity - -
    -
    -
    -
    -
    -
    -

    The severity of this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var severity: ViolationSeverity { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - location - -
    -
    -
    -
    -
    -
    -

    The location of this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public private(set) var location: Location { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - reason - -
    -
    -
    -
    -
    -
    -

    The justification for this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let reason: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - description - -
    -
    -
    -
    -
    -
    -

    A printable description for this violation.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var description: String { get }
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Creates a StyleViolation by specifying its properties directly.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(ruleDescription: RuleDescription,
    -            severity: ViolationSeverity = .warning,
    -            location: Location,
    -            reason: String? = nil)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - - - - - -
    - - ruleDescription - - -
    -

    The description of the rule that generated this violation.

    -
    -
    - - severity - - -
    -

    The severity of this violation.

    -
    -
    - - location - - -
    -

    The location of this violation.

    -
    -
    - - reason - - -
    -

    The justification for this violation. If not specified the rule’s description will - be used.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(severity:) - -
    -
    -
    -
    -
    -
    -

    Returns the same violation, but with the severity that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func with(severity: ViolationSeverity) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - severity - - -
    -

    the new severity to use in the modified violation

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - with(location:) - -
    -
    -
    -
    -
    -
    -

    Returns the same violation, but with the location that is passed in

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func with(location: Location) -> StyleViolation
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - location - - -
    -

    the new location to use in the modified violation

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - hash(into:) - -
    -
    -
    -
    -
    -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func hash(into hasher: inout Hasher)
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html deleted file mode 100644 index fdde4d691..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - SwiftLintSyntaxMap Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintSyntaxMap

-
-
- -
public struct SwiftLintSyntaxMap
- -
-
-

Represents a Swift file’s syntax information.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The raw SyntaxMap obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: SyntaxMap
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - tokens - -
    -
    -
    -
    -
    -
    -

    The SwiftLint-specific syntax tokens for this syntax map.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let tokens: [SwiftLintSyntaxToken]
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(value:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(value: SyntaxMap)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The raw SyntaxMap obtained by SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - tokens(inByteRange:) - -
    -
    -
    -
    -
    -
    -

    Returns array of syntax tokens intersecting with byte range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func tokens(inByteRange byteRange: ByteRange) -> [SwiftLintSyntaxToken]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - byteRange - - -
    -

    Byte-based NSRange.

    -
    -
    -
    -
    -

    Return Value

    -

    The array of syntax tokens intersecting with byte range.

    -
    - -
    -
    -
  • -
  • -
    - - - - kinds(inByteRange:) - -
    -
    -
    -
    -
    -
    -

    Returns the syntax kinds in the specified byte range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func kinds(inByteRange byteRange: ByteRange) -> [SyntaxKind]
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - byteRange - - -
    -

    Byte range.

    -
    -
    -
    -
    -

    Return Value

    -

    The syntax kinds in the specified byte range.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html deleted file mode 100644 index 1b7b1bb0d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html +++ /dev/null @@ -1,579 +0,0 @@ - - - - SwiftLintSyntaxToken Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftLintSyntaxToken

-
-
- -
public struct SwiftLintSyntaxToken
- -
-
-

A SwiftLint-aware Swift syntax token.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The raw SyntaxToken obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: SyntaxToken
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - kind - -
    -
    -
    -
    -
    -
    -

    The syntax kind associated with is token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let kind: SyntaxKind?
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - init(value:) - -
    -
    -
    -
    -
    -
    -

    Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(value: SyntaxToken)
    - -
    -
    -
    -

    Parameters

    - - - - - - - -
    - - value - - -
    -

    The raw SyntaxToken obtained by SourceKitten.

    -
    -
    -
    - -
    -
    -
  • -
  • -
    - - - - range - -
    -
    -
    -
    -
    -
    -

    The byte range in a source file for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var range: ByteRange { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - offset - -
    -
    -
    -
    -
    -
    -

    The starting byte offset in a source file for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var offset: ByteCount { get }
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - length - -
    -
    -
    -
    -
    -
    -

    The length in bytes for this token.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public var length: ByteCount { get }
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftVersion.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftVersion.html deleted file mode 100644 index cec806031..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/SwiftVersion.html +++ /dev/null @@ -1,860 +0,0 @@ - - - - SwiftVersion Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

SwiftVersion

-
-
- -
public struct SwiftVersion : RawRepresentable, Codable, Comparable, Sendable
- -
-
-

A value describing the version of the Swift compiler.

- - -
-
- -
-
-
- -
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Version.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Version.html deleted file mode 100644 index 630cce614..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/Version.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - Version Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

Version

-
-
- -
public struct Version
- -
-
-

A type describing the SwiftLint version.

- - -
-
- -
-
-
-
    -
  • -
    - - - - value - -
    -
    -
    -
    -
    -
    -

    The string value for this version.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let value: String
    - -
    -
    - -
    -
    -
  • -
  • -
    - - - - current - -
    -
    -
    -
    -
    -
    -

    The current SwiftLint version.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static let current: Version
    - -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ViolationCorrection.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ViolationCorrection.html deleted file mode 100644 index a42f83ecd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/ViolationCorrection.html +++ /dev/null @@ -1,484 +0,0 @@ - - - - ViolationCorrection Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

ViolationCorrection

-
-
- -
public struct ViolationCorrection
- -
-
-

The correction of a violation that is basically the violation’s range in the source code and a -replacement for this range that would fix the violation.

- - -
-
- -
-
-
-
    -
  • -
    - - - - start - -
    -
    -
    -
    -
    -
    -

    Start position of the violation range.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public let start: AbsolutePosition
    - -
    -
    - -
    -
    -
  • -
  • - -
    -
    -
    -
    -
    -

    Create a ViolationCorrection.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public init(start: AbsolutePosition, end: AbsolutePosition, replacement: String)
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - - - - - -
    - - start - - -
    -

    Start position of the violation range.

    -
    -
    - - end - - -
    -

    End position of the violation range.

    -
    -
    - - replacement - - -
    -

    Replacement for the violating range.

    -
    -
    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/YamlParser.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/YamlParser.html deleted file mode 100644 index b3023cbe3..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/Structs/YamlParser.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - YamlParser Structure Reference - - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
-

YamlParser

-
-
- -
public struct YamlParser
- -
-
-

An interface for parsing YAML.

- - -
-
- -
-
-
-
    -
  • -
    - - - - parse(_:env:) - -
    -
    -
    -
    -
    -
    -

    Parses the input YAML string as an untyped dictionary.

    -
    -

    Throws

    -

    Throws if the yaml string provided could not be parsed.

    - -
    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public static func parse(_ yaml: String,
    -                         env: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any]
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - - - -
    - - yaml - - -
    -

    YAML-formatted string.

    -
    -
    - - env - - -
    -

    The environment to use to expand variables in the YAML.

    -
    -
    -
    -
    -

    Return Value

    -

    The parsed YAML as an untyped dictionary.

    -
    - -
    -
    -
  • -
-
-
-
- -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_label_for_image.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_label_for_image.html deleted file mode 100644 index 468527362..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_label_for_image.html +++ /dev/null @@ -1,626 +0,0 @@ - - - - accessibility_label_for_image Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Accessibility Label for Image

- -

Images that provide context should have an accessibility label or should be explicitly hidden from accessibility

- -
    -
  • Identifier: accessibility_label_for_image
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        Image(decorative: "my-image")
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image", label: Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibility(hidden: true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibility(label: Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image("my-image")
-            .accessibilityLabel(Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .renderingMode(.template)
-            .foregroundColor(.blue)
-            .accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .accessibilityLabel(Text("Alt text for my image"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityElement()
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityHidden(true)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .combine)
-        .padding(16)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .ignore)
-        .padding(16)
-        .accessibilityLabel(Text("Label for my image and text"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Button(action: { doAction() }) {
-            Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-        }
-        .accessibilityLabel(Text("Label for my image"))
-    }
-}
-
-

Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        ↓Image("my-image")
-            .resizable(true)
-            .frame(width: 48, height: 48)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Image(uiImage: myUiImage)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(false)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(uiImage: myUiImage)
-            .resizable()
-            .frame(width: 48, height: 48)
-            .accessibilityLabel(Text("Alt text for my image"))
-        ↓Image("other image")
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Image(decorative: "image1")
-        ↓Image("image2")
-        Image(uiImage: "image3")
-            .accessibility(label: Text("a pretty picture"))
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            Image(decorative: "my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            ↓Image("my-image")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityElement(children: .contain)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        VStack {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Image("my-image")
-                .accessibility(label: Text("Alt text for my image"))
-        }.accessibilityHidden(false)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack(spacing: 8) {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-            Text("Text to accompany my image")
-        }.accessibilityElement(children: .combine)
-        .padding(16)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Button(action: { doAction() }) {
-            ↓Image("my-image")
-                .renderingMode(.template)
-                .foregroundColor(.blue)
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Image(systemName: "circle.plus")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_trait_for_button.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_trait_for_button.html deleted file mode 100644 index 146994a82..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/accessibility_trait_for_button.html +++ /dev/null @@ -1,629 +0,0 @@ - - - - accessibility_trait_for_button Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Accessibility Trait for Button

- -

All views with tap gestures added should include the .isButton or the .isLink accessibility traits

- -
    -
  • Identifier: accessibility_trait_for_button
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        Button {
-            print("tapped")
-        } label: {
-            Text("Learn more")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Link("Open link", destination: myUrl)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture {
-                print("tapped - open URL")
-            }
-            .accessibility(addTraits: .isLink)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .accessibilityAddTraits(.isButton)
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .accessibility(addTraits: [.isButton, .isHeader])
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture {
-                print("tapped - open URL")
-            }
-            .accessibilityAddTraits([.isHeader, .isLink])
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .onTapGesture(count: 1, perform: {
-                print("tapped")
-            })
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            // This rule does not include tap gestures with multiple taps for now.
-            // Custom gestures like this are also not very accessible, but require
-            // alternative ways to accomplish the same task with assistive tech.
-            .onTapGesture(count: 2) {
-                print("double-tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Label("Learn more", systemImage: "info.circle")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-            .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        HStack {
-            Image(systemName: "info.circle")
-            Text("Learn more")
-        }
-        .onTapGesture {
-            print("tapped")
-        }
-        // This modifier is not strictly required — each subview will inherit the button trait.
-        // That said, grouping a tappable stack into a single element is a good way to reduce
-        // the number of swipes required for a VoiceOver user to navigate the page.
-        .accessibilityElement(children: .combine)
-        .accessibility(addTraits: .isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .gesture(TapGesture().onEnded {
-                print("tapped")
-            })
-            .accessibilityAddTraits(.isButton)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .simultaneousGesture(TapGesture(count: 1).onEnded {
-                print("tapped - open URL")
-            })
-            .accessibilityAddTraits(.isLink)
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .highPriorityGesture(TapGesture().onEnded {
-                print("tapped")
-            })
-            .accessibility(addTraits: [.isButton])
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        Text("Learn more")
-            .gesture(TapGesture(count: 2).onEnded {
-                print("tapped")
-            })
-    }
-}
-
-

Triggering Examples

-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .accessibility(addTraits: .isHeader)
-            .onTapGesture {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .onTapGesture(count: 1, perform: {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Label("Learn more", systemImage: "info.circle")
-            .onTapGesture(count: 1) {
-                print("tapped")
-            }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓HStack {
-            Image(systemName: "info.circle")
-            Text("Learn more")
-        }
-        .onTapGesture {
-            print("tapped")
-        }
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .gesture(TapGesture().onEnded {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .simultaneousGesture(TapGesture(count: 1).onEnded {
-                print("tapped")
-            })
-    }
-}
-
-
struct MyView: View {
-    var body: some View {
-        ↓Text("Learn more")
-            .highPriorityGesture(TapGesture().onEnded {
-                print("tapped")
-            })
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html deleted file mode 100644 index babcfb8c9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - anonymous_argument_in_multiline_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Anonymous Argument in Multiline Closure

- -

Use named arguments in multiline closures

- -
    -
  • Identifier: anonymous_argument_in_multiline_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
closure { $0 }
-
-
closure { print($0) }
-
-
closure { arg in
-    print(arg)
-}
-
-
closure { arg in
-    nestedClosure { $0 + arg }
-}
-
-

Triggering Examples

-
closure {
-    print(↓$0)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anyobject_protocol.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anyobject_protocol.html deleted file mode 100644 index 7bafdbea4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/anyobject_protocol.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - anyobject_protocol Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

AnyObject Protocol

- -

Prefer using AnyObject over class for class-only protocols

- -
    -
  • Identifier: anyobject_protocol
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol SomeProtocol {}
-
-
protocol SomeClassOnlyProtocol: AnyObject {}
-
-
protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
-
-
@objc protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
-
-

Triggering Examples

-
protocol SomeClassOnlyProtocol: ↓class {}
-
-
protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
-
-
@objc protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/array_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/array_init.html deleted file mode 100644 index 0d03b109d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/array_init.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - array_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Array Init

- -

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array

- -
    -
  • Identifier: array_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Array(foo)
-
-
foo.map { $0.0 }
-
-
foo.map { $1 }
-
-
foo.map { $0() }
-
-
foo.map { ((), $0) }
-
-
foo.map { $0! }
-
-
foo.map { $0! /* force unwrap */ }
-
-
foo.something { RouteMapper.map($0) }
-
-
foo.map { !$0 }
-
-
foo.map { /* a comment */ !$0 }
-
-

Triggering Examples

-
foo.↓map({ $0 })
-
-
foo.↓map { $0 }
-
-
foo.↓map { return $0 }
-
-
    foo.↓map { elem in
-        elem
-    }
-
-
    foo.↓map { elem in
-        return elem
-    }
-
-
    foo.↓map { (elem: String) in
-        elem
-    }
-
-
    foo.↓map { elem -> String in
-        elem
-    }
-
-
foo.↓map { $0 /* a comment */ }
-
-
foo.↓map { /* a comment */ $0 }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/attributes.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/attributes.html deleted file mode 100644 index 93a69d236..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/attributes.html +++ /dev/null @@ -1,645 +0,0 @@ - - - - attributes Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Attributes

- -

Attributes should be on their own lines in functions and types, but on the same line as variables and imports

- -
    -
  • Identifier: attributes
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -attributes_with_arguments_always_on_line_above - -true -
    -always_on_same_line - -[“@IBAction”, “@NSManaged”] -
    -always_on_line_above - -[] -
  • -
-

Non Triggering Examples

-
@objc var x: String
-
-
@objc private var x: String
-
-
@nonobjc var x: String
-
-
@IBOutlet private var label: UILabel
-
-
@IBOutlet @objc private var label: UILabel
-
-
@NSCopying var name: NSString
-
-
@NSManaged var name: String?
-
-
@IBInspectable var cornerRadius: CGFloat
-
-
@available(iOS 9.0, *)
- let stackView: UIStackView
-
-
@NSManaged func addSomeObject(book: SomeObject)
-
-
@IBAction func buttonPressed(button: UIButton)
-
-
@objc
- @IBAction func buttonPressed(button: UIButton)
-
-
@available(iOS 9.0, *)
- func animate(view: UIStackView)
-
-
@available(*, deprecated, message: "A message")
- func animate(view: UIStackView)
-
-
@nonobjc
- final class X {}
-
-
@available(iOS 9.0, *)
- class UIStackView {}
-
-
@NSApplicationMain
- class AppDelegate: NSObject, NSApplicationDelegate {}
-
-
@UIApplicationMain
- class AppDelegate: NSObject, UIApplicationDelegate {}
-
-
@IBDesignable
- class MyCustomView: UIView {}
-
-
@testable import SourceKittenFramework
-
-
@objc(foo_x)
- var x: String
-
-
@available(iOS 9.0, *)
-@objc(abc_stackView)
- let stackView: UIStackView
-
-
@objc(abc_addSomeObject:)
- @NSManaged func addSomeObject(book: SomeObject)
-
-
@objc(ABCThing)
- @available(iOS 9.0, *)
- class Thing {}
-
-
class Foo: NSObject {
- override var description: String { return "" }
-}
-
-
class Foo: NSObject {
-
- override func setUp() {}
-}
-
-
@objc
-class ⽺ {}
-
-
extension Property {
-
-    @available(*, unavailable, renamed: "isOptional")
-    public var optional: Bool { fatalError() }
-}
-
-
@GKInspectable var maxSpeed: Float
-
-
@discardableResult
- func a() -> Int
-
-
@objc
- @discardableResult
- func a() -> Int
-
-
func increase(f: @autoclosure () -> Int) -> Int
-
-
func foo(completionHandler: @escaping () -> Void)
-
-
private struct DefaultError: Error {}
-
-
@testable import foo
-
-private let bar = 1
-
-
import XCTest
-@testable import DeleteMe
-
-@available (iOS 11.0, *)
-class DeleteMeTests: XCTestCase {
-}
-
-
@objc
-internal func foo(identifier: String, completion: @escaping (() -> Void)) {}
-
-
@objc
-internal func foo(identifier: String, completion: @autoclosure (() -> Bool)) {}
-
-
func printBoolOrTrue(_ expression: @autoclosure () throws -> Bool?) rethrows {
-  try print(expression() ?? true)
-}
-
-
import Foundation
-
-class MyClass: NSObject {
-  @objc(
-    first:
-  )
-  static func foo(first: String) {}
-}
-
-
func refreshable(action: @escaping @Sendable () async -> Void) -> some View {
-    modifier(RefreshableModifier(action: action))
-}
-
-
import AppKit
-
-@NSApplicationMain
-@MainActor
-final class AppDelegate: NSAppDelegate {}
-
-

Triggering Examples

-
@objc
- ↓var x: String
-
-
@objc
-
- ↓var x: String
-
-
@objc
- private ↓var x: String
-
-
@nonobjc
- ↓var x: String
-
-
@IBOutlet
- private ↓var label: UILabel
-
-
@IBOutlet
-
- private ↓var label: UILabel
-
-
@NSCopying
- ↓var name: NSString
-
-
@NSManaged
- ↓var name: String?
-
-
@IBInspectable
- ↓var cornerRadius: CGFloat
-
-
@available(iOS 9.0, *) ↓let stackView: UIStackView
-
-
@NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@IBAction
- ↓func buttonPressed(button: UIButton)
-
-
@IBAction
- @objc
- ↓func buttonPressed(button: UIButton)
-
-
@available(iOS 9.0, *) ↓func animate(view: UIStackView)
-
-
@nonobjc final ↓class X {}
-
-
@available(iOS 9.0, *) ↓class UIStackView {}
-
-
@available(iOS 9.0, *)
- @objc ↓class UIStackView {}
-
-
@available(iOS 9.0, *) @objc
- ↓class UIStackView {}
-
-
@available(iOS 9.0, *)
-
- ↓class UIStackView {}
-
-
@UIApplicationMain ↓class AppDelegate: NSObject, UIApplicationDelegate {}
-
-
@IBDesignable ↓class MyCustomView: UIView {}
-
-
@testable
-↓import SourceKittenFramework
-
-
@testable
-
-
-↓import SourceKittenFramework
-
-
@available(iOS 9.0, *) @objc(abc_stackView)
- ↓let stackView: UIStackView
-
-
@objc(abc_addSomeObject:) @NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@objc(abc_addSomeObject:)
- @NSManaged
- ↓func addSomeObject(book: SomeObject)
-
-
@available(iOS 9.0, *)
- @objc(ABCThing) ↓class Thing {}
-
-
@GKInspectable
- ↓var maxSpeed: Float
-
-
@discardableResult ↓func a() -> Int
-
-
@objc
- @discardableResult ↓func a() -> Int
-
-
@objc
-
- @discardableResult
- ↓func a() -> Int
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html deleted file mode 100644 index dfc417845..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - balanced_xctest_lifecycle Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Balanced XCTest Life Cycle

- -

Test classes must implement balanced setUp and tearDown methods

- -
    -
  • Identifier: balanced_xctest_lifecycle
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDown() {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDown() {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDownWithError() throws {}
-}
-final class BarTests: XCTestCase {
-    override func setUpWithError() throws {}
-    override func tearDownWithError() throws {}
-}
-
-
struct FooTests {
-    override func setUp() {}
-}
-class BarTests {
-    override func setUpWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUpAlLExamples() {}
-}
-
-
final class FooTests: XCTestCase {
-    class func setUp() {}
-    class func tearDown() {}
-}
-
-

Triggering Examples

-
final class ↓FooTests: XCTestCase {
-    override func setUp() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func setUpWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-final class ↓BarTests: XCTestCase {
-    override func setUpWithError() throws {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    class func tearDown() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func tearDown() {}
-}
-
-
final class ↓FooTests: XCTestCase {
-    override func tearDownWithError() throws {}
-}
-
-
final class FooTests: XCTestCase {
-    override func setUp() {}
-    override func tearDownWithError() throws {}
-}
-final class ↓BarTests: XCTestCase {
-    override func tearDownWithError() throws {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/blanket_disable_command.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/blanket_disable_command.html deleted file mode 100644 index e895c6150..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/blanket_disable_command.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - blanket_disable_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Blanket Disable Command

- -

swiftlint:disable commands should use next, this or previous to disable rules for a single line, or swiftlint:enable to re-enable the rules immediately after the violations to be ignored, instead of disabling the rule for the rest of the file.

- -
    -
  • Identifier: blanket_disable_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allowed_rules - -[“file_header”, “file_length”, “file_name”, “file_name_no_space”, “single_test_class”] -
    -always_blanket_disable - -[] -
  • -
-

Non Triggering Examples

-
// swiftlint:disable unused_import
-// swiftlint:enable unused_import
-
-
// swiftlint:disable unused_import unused_declaration
-// swiftlint:enable unused_import
-// swiftlint:enable unused_declaration
-
-
// swiftlint:disable:this unused_import
-
-
// swiftlint:disable:next unused_import
-
-
// swiftlint:disable:previous unused_import
-
-

Triggering Examples

-
// swiftlint:disable ↓unused_import
-
-
// swiftlint:disable unused_import ↓unused_declaration
-// swiftlint:enable unused_import
-
-
// swiftlint:disable unused_import
-// swiftlint:disable ↓unused_import
-// swiftlint:enable unused_import
-
-
// swiftlint:enable ↓unused_import
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/block_based_kvo.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/block_based_kvo.html deleted file mode 100644 index 134b86b0a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/block_based_kvo.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - block_based_kvo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Block Based KVO

- -

Prefer the new block based KVO API with keypaths when using Swift 3.2 or later

- -
    -
  • Identifier: block_based_kvo
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let observer = foo.observe(\.value, options: [.new]) { (foo, change) in
-   print(change.newValue)
-}
-
-

Triggering Examples

-
class Foo: NSObject {
-  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
-                              change: [NSKeyValueChangeKey : Any]?,
-                              context: UnsafeMutableRawPointer?) {}
-}
-
-
class Foo: NSObject {
-  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
-                              change: Dictionary<NSKeyValueChangeKey, Any>?,
-                              context: UnsafeMutableRawPointer?) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/capture_variable.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/capture_variable.html deleted file mode 100644 index 624361383..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/capture_variable.html +++ /dev/null @@ -1,511 +0,0 @@ - - - - capture_variable Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Capture Variable

- -

Non-constant variables should not be listed in a closure’s capture list to avoid confusion about closures capturing variables at creation time

- -
    -
  • Identifier: capture_variable
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    let i: Int
-    init(_ i: Int) { self.i = i }
-}
-
-let j: Int = 0
-let c = C(1)
-
-let closure: () -> Void = { [j, c] in
-    print(c.i, j)
-}
-
-closure()
-
-
let iGlobal: Int = 0
-
-class C {
-    class var iClass: Int { 0 }
-    static let iStatic: Int = 0
-    let iInstance: Int = 0
-
-    func callTest() {
-        var iLocal: Int = 0
-        test { [unowned self, iGlobal, iInstance, iLocal, iClass=C.iClass, iStatic=C.iStatic] j in
-            print(iGlobal, iClass, iStatic, iInstance, iLocal, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
-
var j: Int!
-j = 0
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-
lazy var j: Int = { 0 }()
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-

Triggering Examples

-
var j: Int = 0
-
-let closure: () -> Void = { [j] in
-    print(j)
-}
-
-closure()
-j = 1
-closure()
-
-
class C {
-    let i: Int
-    init(_ i: Int) { self.i = i }
-}
-
-var c = C(0)
-let closure: () -> Void = { [c] in
-    print(c.i)
-}
-
-closure()
-c = C(1)
-closure()
-
-
var iGlobal: Int = 0
-
-class C {
-    func callTest() {
-        test { [iGlobal] j in
-            print(iGlobal, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
-
class C {
-    static var iStatic: Int = 0
-
-    static func callTest() {
-        test { [↓iStatic] j in
-            print(iStatic, j)
-        }
-    }
-
-    static func test(_ completionHandler: @escaping (Int) -> Void) {
-        completionHandler(2)
-        C.iStatic = 1
-        completionHandler(3)
-    }
-}
-
-C.callTest()
-
-
class C {
-    var iInstance: Int = 0
-
-    func callTest() {
-        test { [iInstance] j in
-            print(iInstance, j)
-        }
-    }
-
-    func test(_ completionHandler: @escaping (Int) -> Void) {
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/class_delegate_protocol.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/class_delegate_protocol.html deleted file mode 100644 index 27af2b2fe..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/class_delegate_protocol.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - class_delegate_protocol Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Class Delegate Protocol

- -

Delegate protocols should be class-only so they can be weakly referenced

- -
    -
  • Identifier: class_delegate_protocol
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol FooDelegate: class {}
-
-
protocol FooDelegate: class, BarDelegate {}
-
-
protocol Foo {}
-
-
class FooDelegate {}
-
-
@objc protocol FooDelegate {}
-
-
@objc(MyFooDelegate)
- protocol FooDelegate {}
-
-
protocol FooDelegate: BarDelegate {}
-
-
protocol FooDelegate: AnyObject {}
-
-
protocol FooDelegate: NSObjectProtocol {}
-
-
protocol FooDelegate where Self: BarDelegate {}
-
-
protocol FooDelegate where Self: AnyObject {}
-
-
protocol FooDelegate where Self: NSObjectProtocol {}
-
-

Triggering Examples

-
↓protocol FooDelegate {}
-
-
↓protocol FooDelegate: Bar {}
-
-
↓protocol FooDelegate where Self: StringProtocol {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closing_brace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closing_brace.html deleted file mode 100644 index 000c7dfca..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closing_brace.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - closing_brace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closing Brace Spacing

- -

Closing brace with closing parenthesis should not have any whitespaces in the middle

- -
    -
  • Identifier: closing_brace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[].map({ })
-
-
[].map(
-  { }
-)
-
-

Triggering Examples

-
[].map({ ↓} )
-
-
[].map({ ↓}   )
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_body_length.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_body_length.html deleted file mode 100644 index 8a12e02c1..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_body_length.html +++ /dev/null @@ -1,1088 +0,0 @@ - - - - closure_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Body Length

- -

Closure bodies should not span too many lines

- -
    -
  • Identifier: closure_body_length
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -30 -
    -error - -100 -
  • -
-

Non Triggering Examples

-
foo.bar { $0 }
-
-
foo.bar { toto in
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}
-
-
foo.bar { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar({ toto in
-})
-
-
foo.bar({ toto in
-    let a0 = 0
-})
-
-
foo.bar({ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}, anotherLabel: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-})
-
-
foo.bar(label: { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}) { toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-}
-
-
let foo: Bar = { toto in
-    let bar = Bar()
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    return bar
-}()
-
-

Triggering Examples

-
foo.bar ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}
-
-
foo.bar ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-    // toto
-
-
-
-
-
-
-
-
-
-
-}
-
-
foo.bar(↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}, anotherLabel: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-})
-
-
foo.bar(label: ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}) ↓{ toto in
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    let a29 = 0
-    let a30 = 0
-}
-
-
let foo: Bar = ↓{ toto in
-    let bar = Bar()
-    let a0 = 0
-    let a1 = 0
-    let a2 = 0
-    let a3 = 0
-    let a4 = 0
-    let a5 = 0
-    let a6 = 0
-    let a7 = 0
-    let a8 = 0
-    let a9 = 0
-    let a10 = 0
-    let a11 = 0
-    let a12 = 0
-    let a13 = 0
-    let a14 = 0
-    let a15 = 0
-    let a16 = 0
-    let a17 = 0
-    let a18 = 0
-    let a19 = 0
-    let a20 = 0
-    let a21 = 0
-    let a22 = 0
-    let a23 = 0
-    let a24 = 0
-    let a25 = 0
-    let a26 = 0
-    let a27 = 0
-    let a28 = 0
-    return bar
-}()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_end_indentation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_end_indentation.html deleted file mode 100644 index f56e7cb10..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_end_indentation.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - closure_end_indentation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure End Indentation

- -

Closure end should have the same indentation as the line that started it.

- -
    -
  • Identifier: closure_end_indentation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
SignalProducer(values: [1, 2, 3])
-   .startWithNext { number in
-       print(number)
-   }
-
-
-
[1, 2].map { $0 + 1 }
-
-
-
return match(pattern: pattern, with: [.comment]).flatMap { range in
-   return Command(string: contents, range: range)
-}.flatMap { command in
-   return command.expand()
-}
-
-
-
foo(foo: bar,
-    options: baz) { _ in }
-
-
-
someReallyLongProperty.chainingWithAnotherProperty
-   .foo { _ in }
-
-
foo(abc, 123)
-{ _ in }
-
-
-
function(
-    closure: { x in
-        print(x)
-    },
-    anotherClosure: { y in
-        print(y)
-    })
-
-
function(parameter: param,
-         closure: { x in
-    print(x)
-})
-
-
function(parameter: param, closure: { x in
-        print(x)
-    },
-    anotherClosure: { y in
-        print(y)
-    })
-
-
(-variable).foo()
-
-

Triggering Examples

-
SignalProducer(values: [1, 2, 3])
-   .startWithNext { number in
-       print(number)
-↓}
-
-
-
return match(pattern: pattern, with: [.comment]).flatMap { range in
-   return Command(string: contents, range: range)
-   ↓}.flatMap { command in
-   return command.expand()
-↓}
-
-
-
function(
-    closure: { x in
-        print(x)
-↓},
-    anotherClosure: { y in
-        print(y)
-↓})
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_parameter_position.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_parameter_position.html deleted file mode 100644 index 6b1f181da..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_parameter_position.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - closure_parameter_position Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Parameter Position

- -

Closure parameters should be on the same line as opening brace

- -
    -
  • Identifier: closure_parameter_position
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
[1, 2].map { number -> Int in
- number + 1 
-}
-
-
[1, 2].map { (number: Int) -> Int in
- number + 1 
-}
-
-
[1, 2].map { [weak self] number in
- number + 1 
-}
-
-
[1, 2].something(closure: { number in
- number + 1 
-})
-
-
let isEmpty = [1, 2].isEmpty()
-
-
rlmConfiguration.migrationBlock.map { rlmMigration in
-    return { migration, schemaVersion in
-        rlmMigration(migration.rlmMigration, schemaVersion)
-    }
-}
-
-
let mediaView: UIView = { [weak self] index in
-   return UIView()
-}(index)
-
-

Triggering Examples

-
[1, 2].map {
-    ↓number in
-    number + 1
-}
-
-
[1, 2].map {
-    ↓number -> Int in
-    number + 1
-}
-
-
[1, 2].map {
-    (↓number: Int) -> Int in
-    number + 1
-}
-
-
[1, 2].map {
-    [weak ↓self] ↓number in
-    number + 1
-}
-
-
[1, 2].map { [weak self]
-    ↓number in
-    number + 1
-}
-
-
[1, 2].map({
-    ↓number in
-    number + 1
-})
-
-
[1, 2].something(closure: {
-    ↓number in
-    number + 1
-})
-
-
[1, 2].reduce(0) {
-    ↓sum, ↓number in
-    number + sum
-})
-
-
f.completionHandler = {
-    ↓thing in
-    doStuff()
-}
-
-
foo {
-    [weak ↓self] in
-    self?.bar()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_spacing.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_spacing.html deleted file mode 100644 index 1f718e3e1..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/closure_spacing.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - closure_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Closure Spacing

- -

Closure expressions should have a single space inside each brace

- -
    -
  • Identifier: closure_spacing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[].map ({ $0.description })
-
-
[].filter { $0.contains(location) }
-
-
extension UITableViewCell: ReusableView { }
-
-
extension UITableViewCell: ReusableView {}
-
-

Triggering Examples

-
[].filter↓{ $0.contains(location) }
-
-
[].filter(↓{$0.contains(location)})
-
-
[].map(↓{$0})
-
-
(↓{each in return result.contains(where: ↓{e in return e}) }).count
-
-
filter ↓{ sorted ↓{ $0 < $1}}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/collection_alignment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/collection_alignment.html deleted file mode 100644 index a5e27cbb0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/collection_alignment.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - collection_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Collection Element Alignment

- -

All elements in a collection literal should be vertically aligned

- -
    -
  • Identifier: collection_alignment
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -align_colons - -false -
  • -
-

Non Triggering Examples

-
doThings(arg: [
-    "foo": 1,
-    "bar": 2,
-    "fizz": 2,
-    "buzz": 2
-])
-
-
let abc = [
-    "alpha": "a",
-    "beta": "b",
-    "gamma": "g",
-    "delta": "d",
-    "epsilon": "e"
-]
-
-
let meals = [
-                "breakfast": "oatmeal",
-                "lunch": "sandwich",
-                "dinner": "burger"
-]
-
-
NSAttributedString(string: "…", attributes: [.font: UIFont.systemFont(ofSize: 12, weight: .regular),
-                                             .foregroundColor: UIColor(white: 0, alpha: 0.2)])
-
-
let coordinates = [
-    CLLocationCoordinate2D(latitude: 0, longitude: 33),
-    CLLocationCoordinate2D(latitude: 0, longitude: 66),
-    CLLocationCoordinate2D(latitude: 0, longitude: 99)
-]
-
-
var evenNumbers: Set<Int> = [
-    2,
-    4,
-    6
-]
-
-
let abc = [1, 2, 3, 4]
-
-
let abc = [
-    1, 2, 3, 4
-]
-
-
let abc = [
-    "foo": "bar", "fizz": "buzz"
-]
-
-

Triggering Examples

-
doThings(arg: [
-    "foo": 1,
-    "bar": 2,
-   ↓"fizz": 2,
-   ↓"buzz": 2
-])
-
-
let abc = [
-    "alpha": "a",
-     ↓"beta": "b",
-    "gamma": "g",
-    "delta": "d",
-  ↓"epsilon": "e"
-]
-
-
let meals = [
-                "breakfast": "oatmeal",
-                "lunch": "sandwich",
-    ↓"dinner": "burger"
-]
-
-
let coordinates = [
-    CLLocationCoordinate2D(latitude: 0, longitude: 33),
-        ↓CLLocationCoordinate2D(latitude: 0, longitude: 66),
-    CLLocationCoordinate2D(latitude: 0, longitude: 99)
-]
-
-
var evenNumbers: Set<Int> = [
-    2,
-  ↓4,
-    6
-]
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/colon.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/colon.html deleted file mode 100644 index d11de7305..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/colon.html +++ /dev/null @@ -1,618 +0,0 @@ - - - - colon Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Colon Spacing

- -

Colons should be next to the identifier when specifying a type and next to the key in dictionary literals

- -
    -
  • Identifier: colon
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -flexible_right_spacing - -false -
    -apply_to_dictionaries - -true -
  • -
-

Non Triggering Examples

-
let abc: Void
-
-
let abc: [Void: Void]
-
-
let abc: (Void, Void)
-
-
let abc: ([Void], String, Int)
-
-
let abc: [([Void], String, Int)]
-
-
let abc: String="def"
-
-
let abc: Int=0
-
-
let abc: Enum=Enum.Value
-
-
func abc(def: Void) {}
-
-
func abc(def: Void, ghi: Void) {}
-
-
let abc: String = "abc:"
-
-
let abc = [Void: Void]()
-
-
let abc = [1: [3: 2], 3: 4]
-
-
let abc = ["string": "string"]
-
-
let abc = ["string:string": "string"]
-
-
let abc: [String: Int]
-
-
func foo(bar: [String: Int]) {}
-
-
func foo() -> [String: Int] { return [:] }
-
-
let abc: Any
-
-
let abc: [Any: Int]
-
-
let abc: [String: Any]
-
-
class Foo: Bar {}
-
-
class Foo<T>: Bar {}
-
-
class Foo<T: Equatable>: Bar {}
-
-
class Foo<T, U>: Bar {}
-
-
class Foo<T: Equatable> {}
-
-
object.method(x: /* comment */ 5)
-
-
switch foo {
-case .bar:
-    _ = something()
-}
-
-
object.method(x: 5, y: "string")
-
-
object.method(x: 5, y:
-              "string")
-
-
object.method(5, y: "string")
-
-
func abc() { def(ghi: jkl) }
-
-
func abc(def: Void) { ghi(jkl: mno) }
-
-
class ABC { let def = ghi(jkl: mno) } }
-
-
func foo() { let dict = [1: 1] }
-
-
let aaa = Self.bbb ? Self.ccc : Self.ddd else {
-return nil
-Example("}
-
-
range.flatMap(file.syntaxMap.kinds(inByteRange:)) ?? []
-
-
@objc(receiveReply:)
-public class func receiveReply(_ reply: bad_instruction_exception_reply_t) -> CInt { 0 }
-
-
switch str {
-case "adlm", "adlam":             return .adlam
-case "aghb", "caucasianalbanian": return .caucasianAlbanian
-default:                          return nil
-}
-
-
precedencegroup PipelinePrecedence {
-  associativity: left
-}
-infix operator |> : PipelinePrecedence
-
-
switch scalar {
-  case 0x000A...0x000D /* LF ... CR */: return true
-  case 0x0085 /* NEXT LINE (NEL) */: return true
-  case 0x2028 /* LINE SEPARATOR */: return true
-  case 0x2029 /* PARAGRAPH SEPARATOR */: return true
-  default: return false
-}
-
-

Triggering Examples

-
let abc↓:Void
-
-
let abc↓:  Void
-
-
let abc↓ :Void
-
-
let abc↓ : Void
-
-
let abc↓ : [Void: Void]
-
-
let abc↓ : (Void, String, Int)
-
-
let abc↓ : ([Void], String, Int)
-
-
let abc↓ : [([Void], String, Int)]
-
-
let abc↓:  (Void, String, Int)
-
-
let abc↓:  ([Void], String, Int)
-
-
let abc↓:  [([Void], String, Int)]
-
-
let abc↓ :String="def"
-
-
let abc↓ :Int=0
-
-
let abc↓ :Int = 0
-
-
let abc↓:Int=0
-
-
let abc↓:Int = 0
-
-
let abc↓:Enum=Enum.Value
-
-
func abc(def↓:Void) {}
-
-
func abc(def↓:  Void) {}
-
-
func abc(def↓ :Void) {}
-
-
func abc(def↓ : Void) {}
-
-
func abc(def: Void, ghi↓ :Void) {}
-
-
let abc = [Void↓:Void]()
-
-
let abc = [Void↓ : Void]()
-
-
let abc = [Void↓:  Void]()
-
-
let abc = [Void↓ :  Void]()
-
-
let abc = [1: [3↓ : 2], 3: 4]
-
-
let abc = [1: [3↓ : 2], 3↓:  4]
-
-
let abc: [String↓ : Int]
-
-
let abc: [String↓:Int]
-
-
func foo(bar: [String↓ : Int]) {}
-
-
func foo(bar: [String↓:Int]) {}
-
-
func foo() -> [String↓ : Int] { return [:] }
-
-
func foo() -> [String↓:Int] { return [:] }
-
-
let abc↓ : Any
-
-
let abc: [Any↓ : Int]
-
-
let abc: [String↓ : Any]
-
-
class Foo↓ : Bar {}
-
-
class Foo↓:Bar {}
-
-
class Foo<T>↓ : Bar {}
-
-
class Foo<T>↓:Bar {}
-
-
class Foo<T, U>↓:Bar {}
-
-
class Foo<T: Equatable>↓:Bar {}
-
-
class Foo<T↓:Equatable> {}
-
-
class Foo<T↓ : Equatable> {}
-
-
object.method(x: 5, y↓ : "string")
-
-
object.method(x↓:5, y: "string")
-
-
object.method(x↓:  5, y: "string")
-
-
func abc() { def(ghi↓:jkl) }
-
-
func abc(def: Void) { ghi(jkl↓:mno) }
-
-
class ABC { let def = ghi(jkl↓:mno) } }
-
-
func foo() { let dict = [1↓ : 1] }
-
-
switch foo {
-case .bar↓ : return baz
-}
-
-
private var action↓:(() -> Void)?
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma.html deleted file mode 100644 index 330e09ab0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - comma Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comma Spacing

- -

There should be no space before and one after any comma

- -
    -
  • Identifier: comma
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func abc(a: String, b: String) { }
-
-
abc(a: "string", b: "string"
-
-
enum a { case a, b, c }
-
-
func abc(
-  a: String,  // comment
-  bcd: String // comment
-) {
-}
-
-
func abc(
-  a: String,
-  bcd: String
-) {
-}
-
-
#imageLiteral(resourceName: "foo,bar,baz")
-
-
kvcStringBuffer.advanced(by: rootKVCLength)
-  .storeBytes(of: 0x2E /* '.' */, as: CChar.self)
-
-

Triggering Examples

-
func abc(a: String↓ ,b: String) { }
-
-
func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }
-
-
abc(a: "string"↓,b: "string"
-
-
enum a { case a↓ ,b }
-
-
let result = plus(
-    first: 3↓ , // #683
-    second: 4
-)
-
-
Foo(
-  parameter: a.b.c,
-  tag: a.d,
-  value: a.identifier.flatMap { Int64($0) }↓ ,
-  reason: Self.abcd()
-)
-
-
return Foo(bar: .baz, title: fuzz,
-          message: My.Custom.message↓ ,
-          another: parameter, doIt: true,
-          alignment: .center)
-
-
Logger.logError("Hat is too large"↓,  info: [])
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma_inheritance.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma_inheritance.html deleted file mode 100644 index 92a759a12..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comma_inheritance.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - comma_inheritance Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comma Inheritance Rule

- -

Use commas to separate types in inheritance lists

- -
    -
  • Identifier: comma_inheritance
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct A: Codable, Equatable {}
-
-
enum B: Codable, Equatable {}
-
-
class C: Codable, Equatable {}
-
-
protocol D: Codable, Equatable {}
-
-
typealias E = Equatable & Codable
-
-
func foo<T: Equatable & Codable>(_ param: T) {}
-
-
protocol G {
-    associatedtype Model: Codable, Equatable
-}
-
-

Triggering Examples

-
struct A: Codable↓ & Equatable {}
-
-
struct A: Codable↓  & Equatable {}
-
-
struct A: Codable↓&Equatable {}
-
-
struct A: Codable↓& Equatable {}
-
-
enum B: Codable↓ & Equatable {}
-
-
class C: Codable↓ & Equatable {}
-
-
protocol D: Codable↓ & Equatable {}
-
-
protocol G {
-    associatedtype Model: Codable↓ & Equatable
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comment_spacing.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comment_spacing.html deleted file mode 100644 index 67cfdceea..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/comment_spacing.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - comment_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Comment Spacing

- -

Prefer at least one space after slashes for comments

- -
    -
  • Identifier: comment_spacing
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// This is a comment
-
-
/// Triple slash comment
-
-
// Multiline double-slash
-// comment
-
-
/// Multiline triple-slash
-/// comment
-
-
/// Multiline triple-slash
-///   - This is indented
-
-
// - MARK: Mark comment
-
-
//: Swift Playground prose section
-
-
///////////////////////////////////////////////
-// Comment with some lines of slashes boxing it
-///////////////////////////////////////////////
-
-
//:#localized(key: "SwiftPlaygroundLocalizedProse")
-
-
/* Asterisk comment */
-
-
/*
-    Multiline asterisk comment
-*/
-
-
/*:
-    Multiline Swift Playground prose section
-*/
-
-
/*#-editable-code Swift Platground editable area*/default/*#-end-editable-code*/
-
-

Triggering Examples

-
//↓Something
-
-
//↓MARK
-
-
//↓👨‍👨‍👦‍👦Something
-
-
func a() {
-    //↓This needs refactoring
-    print("Something")
-}
-//↓We should improve above function
-
-
///↓This is a comment
-
-
/// Multiline triple-slash
-///↓This line is incorrect, though
-
-
//↓- MARK: Mark comment
-
-
//:↓Swift Playground prose section
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/compiler_protocol_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/compiler_protocol_init.html deleted file mode 100644 index 124f170b2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/compiler_protocol_init.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - compiler_protocol_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Compiler Protocol Init

- -

The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn’t be called directly.

- -
    -
  • Identifier: compiler_protocol_init
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let set: Set<Int> = [1, 2]
-
-
let set = Set(array)
-
-

Triggering Examples

-
let set = ↓Set(arrayLiteral: 1, 2)
-
-
let set = ↓Set (arrayLiteral: 1, 2)
-
-
let set = ↓Set.init(arrayLiteral: 1, 2)
-
-
let set = ↓Set.init(arrayLiteral : 1, 2)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/computed_accessors_order.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/computed_accessors_order.html deleted file mode 100644 index eb2fc78e9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/computed_accessors_order.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - computed_accessors_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Computed Accessors Order

- -

Getter and setters in computed properties and subscripts should be in a consistent order.

- -
    -
  • Identifier: computed_accessors_order
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -get_set -
  • -
-

Non Triggering Examples

-
class Foo {
-    var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int
-}
-
-
class Foo {
-    var foo: Int {
-        return getValueFromDisk()
-    }
-}
-
-
class Foo {
-    var foo: String {
-        return "get"
-    }
-}
-
-
protocol Foo {
-    var foo: Int { get }
-
-
protocol Foo {
-    var foo: Int { get set }
-}
-
-
protocol Foo {
-    var foo: Int { set get }
-
-
class Foo {
-    var foo: Int {
-        struct Bar {
-            var bar: Int {
-                get { return 1 }
-                set { _ = newValue }
-            }
-        }
-
-        return Bar().bar
-    }
-}
-
-
var _objCTaggedPointerBits: UInt {
-    @inline(__always) get { return 0 }
-    set { print(newValue) }
-}
-
-
var next: Int? {
-    mutating get {
-        defer { self.count += 1 }
-        return self.count
-    }
-    set {
-        self.count = newValue
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set { self._bar = newValue }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set(newValue) { self._bar = newValue }
-    }
-}
-
-
extension Reactive where Base: UITapGestureRecognizer {
-    var tapped: CocoaAction<Base>? {
-        get {
-            return associatedAction.withValue { $0.flatMap { $0.action } }
-        }
-        nonmutating set {
-            setAction(newValue)
-        }
-    }
-}
-
-
extension Test {
-    var foo: Bool {
-        get {
-            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
-        }
-        set {
-            bar = NSNumber(value: newValue as Bool)
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        return 20
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get set }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { set get }
-}
-
-

Triggering Examples

-
class Foo {
-    var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
-
var foo: Int {
-    ↓set { print(newValue) }
-    get { return 20 }
-}
-
-
extension Foo {
-    var bar: Bool {
-        ↓set { print(bar) }
-        get { _bar }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        ↓set {
-            print(newValue)
-        }
-        mutating get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        ↓set {
-            print(i)
-        }
-        get {
-            return 20
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/conditional_returns_on_newline.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/conditional_returns_on_newline.html deleted file mode 100644 index f19e66807..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/conditional_returns_on_newline.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - conditional_returns_on_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Conditional Returns on Newline

- -

Conditional statements should always return on the next line

- -
    -
  • Identifier: conditional_returns_on_newline
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -if_only - -false -
  • -
-

Non Triggering Examples

-
guard true else {
- return true
-}
-
-
guard true,
- let x = true else {
- return true
-}
-
-
if true else {
- return true
-}
-
-
if true,
- let x = true else {
- return true
-}
-
-
if textField.returnKeyType == .Next {
-
-
if true { // return }
-
-
guard something
-else { return }
-
-

Triggering Examples

-
↓guard true else { return }
-
-
↓if true { return }
-
-
↓if true { break } else { return }
-
-
↓if true { break } else {       return }
-
-
↓if true { return "YES" } else { return "NO" }
-
-
↓guard condition else { XCTFail(); return }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_count.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_count.html deleted file mode 100644 index de25b9f03..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_count.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - contains_over_filter_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Filter Count

- -

Prefer contains over comparing filter(where:).count to 0

- -
    -
  • Identifier: contains_over_filter_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count > 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 01
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count == 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 01
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count != 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 01
-
-
let result = myList.contains(where: { $0 % 2 == 0 })
-
-
let result = !myList.contains(where: { $0 % 2 == 0 })
-
-
let result = myList.contains(10)
-
-

Triggering Examples

-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count > 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count > 0
-
-
let result = ↓myList.filter(where: someFunction).count > 0
-
-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count == 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count == 0
-
-
let result = ↓myList.filter(where: someFunction).count == 0
-
-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count != 0
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.count != 0
-
-
let result = ↓myList.filter(where: someFunction).count != 0
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html deleted file mode 100644 index cb0757a58..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - contains_over_filter_is_empty Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Filter is Empty

- -

Prefer contains over using filter(where:).isEmpty

- -
    -
  • Identifier: contains_over_filter_is_empty
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count > 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count == 1
-
-
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
-
-
let result = myList.filter { $0 % 2 == 0 }.count != 1
-
-
let result = myList.contains(where: { $0 % 2 == 0 })
-
-
let result = !myList.contains(where: { $0 % 2 == 0 })
-
-
let result = myList.contains(10)
-
-

Triggering Examples

-
let result = ↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
-
-
let result = !↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
-
-
let result = ↓myList.filter { $0 % 2 == 0 }.isEmpty
-
-
let result = ↓myList.filter(where: someFunction).isEmpty
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_first_not_nil.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_first_not_nil.html deleted file mode 100644 index 21f676408..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_first_not_nil.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - contains_over_first_not_nil Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over First not Nil

- -

Prefer contains over first(where:) != nil and firstIndex(where:) != nil.

- -
    -
  • Identifier: contains_over_first_not_nil
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let first = myList.first(where: { $0 % 2 == 0 })
-
-
let first = myList.first { $0 % 2 == 0 }
-
-
let firstIndex = myList.firstIndex(where: { $0 % 2 == 0 })
-
-
let firstIndex = myList.firstIndex { $0 % 2 == 0 }
-
-

Triggering Examples

-
↓myList.first { $0 % 2 == 0 } != nil
-
-
↓myList.first(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.first(where: someFunction) != nil
-
-
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } != nil
-
-
(↓myList.first { $0 % 2 == 0 }) != nil
-
-
↓myList.first { $0 % 2 == 0 } == nil
-
-
↓myList.first(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.first(where: someFunction) == nil
-
-
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } == nil
-
-
(↓myList.first { $0 % 2 == 0 }) == nil
-
-
↓myList.firstIndex { $0 % 2 == 0 } != nil
-
-
↓myList.firstIndex(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) != nil
-
-
↓myList.firstIndex(where: someFunction) != nil
-
-
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } != nil
-
-
(↓myList.firstIndex { $0 % 2 == 0 }) != nil
-
-
↓myList.firstIndex { $0 % 2 == 0 } == nil
-
-
↓myList.firstIndex(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) == nil
-
-
↓myList.firstIndex(where: someFunction) == nil
-
-
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } == nil
-
-
(↓myList.firstIndex { $0 % 2 == 0 }) == nil
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html deleted file mode 100644 index cf1e520bb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - contains_over_range_nil_comparison Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Contains over Range Comparison to Nil

- -

Prefer contains over range(of:) != nil and range(of:) == nil

- -
    -
  • Identifier: contains_over_range_nil_comparison
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let range = myString.range(of: "Test")
-
-
myString.contains("Test")
-
-
!myString.contains("Test")
-
-
resourceString.range(of: rule.regex, options: .regularExpression) != nil
-
-

Triggering Examples

-
↓myString.range(of: "Test") != nil
-
-
↓myString.range(of: "Test") == nil
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/control_statement.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/control_statement.html deleted file mode 100644 index 2d8608c57..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/control_statement.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - control_statement Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Control Statement

- -

if, for, guard, switch, while, and catch statements shouldn’t unnecessarily wrap their conditionals or arguments in parentheses

- -
    -
  • Identifier: control_statement
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if condition {}
-
-
if (a, b) == (0, 1) {}
-
-
if (a || b) && (c || d) {}
-
-
if (min...max).contains(value) {}
-
-
if renderGif(data) {}
-
-
renderGif(data)
-
-
guard condition else {}
-
-
while condition {}
-
-
do {} while condition {}
-
-
do { ; } while condition {}
-
-
switch foo {}
-
-
do {} catch let error as NSError {}
-
-
foo().catch(all: true) {}
-
-
if max(a, b) < c {}
-
-
switch (lhs, rhs) {}
-
-
if (f() { g() {} }) {}
-
-
if (a + f() {} == 1) {}
-
-

Triggering Examples

-
↓if (condition) {}
-
-
↓if(condition) {}
-
-
↓if (condition == endIndex) {}
-
-
↓if ((a || b) && (c || d)) {}
-
-
↓if ((min...max).contains(value)) {}
-
-
↓guard (condition) else {}
-
-
↓while (condition) {}
-
-
↓while(condition) {}
-
-
do { ; } ↓while(condition) {}
-
-
do { ; } ↓while (condition) {}
-
-
↓switch (foo) {}
-
-
do {} ↓catch(let error as NSError) {}
-
-
↓if (max(a, b) < c) {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/convenience_type.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/convenience_type.html deleted file mode 100644 index fed6d6fb9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/convenience_type.html +++ /dev/null @@ -1,467 +0,0 @@ - - - - convenience_type Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Convenience Type

- -

Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation

- -
    -
  • Identifier: convenience_type
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Math { // enum
-  public static let pi = 3.14
-}
-
-
// class with inheritance
-class MathViewController: UIViewController {
-  public static let pi = 3.14
-}
-
-
@objc class Math: NSObject { // class visible to Obj-C
-  public static let pi = 3.14
-}
-
-
struct Math { // type with non-static declarations
-  public static let pi = 3.14
-  public let randomNumber = 2
-}
-
-
class DummyClass {}
-
-
class Foo: NSObject { // class with Obj-C class property
-    class @objc let foo = 1
-}
-
-
class Foo: NSObject { // class with Obj-C static property
-    static @objc let foo = 1
-}
-
-
class Foo { // @objc class func can't exist on an enum
-   @objc class func foo() {}
-}
-
-
class Foo { // @objc static func can't exist on an enum
-   @objc static func foo() {}
-}
-
-
@objcMembers class Foo { // @objc static func can't exist on an enum
-   static func foo() {}
-}
-
-
final class Foo { // final class, but @objc class func can't exist on an enum
-   @objc class func foo() {}
-}
-
-
final class Foo { // final class, but @objc static func can't exist on an enum
-   @objc static func foo() {}
-}
-
-
@globalActor actor MyActor {
-  static let shared = MyActor()
-}
-
-

Triggering Examples

-
↓struct Math {
-  public static let pi = 3.14
-}
-
-
↓struct Math {
-  public static let pi = 3.14
-  @available(*, unavailable) init() {}
-}
-
-
final ↓class Foo { // final class can't be inherited
-    class let foo = 1
-}
-
-
↓class Foo {
-    class let foo = 1
-}
-
-
↓class Foo {
-    final class let foo = 1
-}
-
-
↓class SomeClass {
-    static func foo() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/highlight.css b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/highlight.css deleted file mode 100644 index c170357ce..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/highlight.css +++ /dev/null @@ -1,202 +0,0 @@ -/*! Jazzy - https://github.com/realm/jazzy - * Copyright Realm Inc. - * SPDX-License-Identifier: MIT - */ -/* Credit to https://gist.github.com/wataru420/2048287 */ -.highlight .c { - color: #999988; - font-style: italic; } - -.highlight .err { - color: #a61717; - background-color: #e3d2d2; } - -.highlight .k { - color: #000000; - font-weight: bold; } - -.highlight .o { - color: #000000; - font-weight: bold; } - -.highlight .cm { - color: #999988; - font-style: italic; } - -.highlight .cp { - color: #999999; - font-weight: bold; } - -.highlight .c1 { - color: #999988; - font-style: italic; } - -.highlight .cs { - color: #999999; - font-weight: bold; - font-style: italic; } - -.highlight .gd { - color: #000000; - background-color: #ffdddd; } - -.highlight .gd .x { - color: #000000; - background-color: #ffaaaa; } - -.highlight .ge { - color: #000000; - font-style: italic; } - -.highlight .gr { - color: #aa0000; } - -.highlight .gh { - color: #999999; } - -.highlight .gi { - color: #000000; - background-color: #ddffdd; } - -.highlight .gi .x { - color: #000000; - background-color: #aaffaa; } - -.highlight .go { - color: #888888; } - -.highlight .gp { - color: #555555; } - -.highlight .gs { - font-weight: bold; } - -.highlight .gu { - color: #aaaaaa; } - -.highlight .gt { - color: #aa0000; } - -.highlight .kc { - color: #000000; - font-weight: bold; } - -.highlight .kd { - color: #000000; - font-weight: bold; } - -.highlight .kp { - color: #000000; - font-weight: bold; } - -.highlight .kr { - color: #000000; - font-weight: bold; } - -.highlight .kt { - color: #445588; } - -.highlight .m { - color: #009999; } - -.highlight .s { - color: #d14; } - -.highlight .na { - color: #008080; } - -.highlight .nb { - color: #0086B3; } - -.highlight .nc { - color: #445588; - font-weight: bold; } - -.highlight .no { - color: #008080; } - -.highlight .ni { - color: #800080; } - -.highlight .ne { - color: #990000; - font-weight: bold; } - -.highlight .nf { - color: #990000; } - -.highlight .nn { - color: #555555; } - -.highlight .nt { - color: #000080; } - -.highlight .nv { - color: #008080; } - -.highlight .ow { - color: #000000; - font-weight: bold; } - -.highlight .w { - color: #bbbbbb; } - -.highlight .mf { - color: #009999; } - -.highlight .mh { - color: #009999; } - -.highlight .mi { - color: #009999; } - -.highlight .mo { - color: #009999; } - -.highlight .sb { - color: #d14; } - -.highlight .sc { - color: #d14; } - -.highlight .sd { - color: #d14; } - -.highlight .s2 { - color: #d14; } - -.highlight .se { - color: #d14; } - -.highlight .sh { - color: #d14; } - -.highlight .si { - color: #d14; } - -.highlight .sx { - color: #d14; } - -.highlight .sr { - color: #009926; } - -.highlight .s1 { - color: #d14; } - -.highlight .ss { - color: #990073; } - -.highlight .bp { - color: #999999; } - -.highlight .vc { - color: #008080; } - -.highlight .vg { - color: #008080; } - -.highlight .vi { - color: #008080; } - -.highlight .il { - color: #009999; } diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/jazzy.css b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/jazzy.css deleted file mode 100644 index c7bb9fe22..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/css/jazzy.css +++ /dev/null @@ -1,404 +0,0 @@ -/*! Jazzy - https://github.com/realm/jazzy - * Copyright Realm Inc. - * SPDX-License-Identifier: MIT - */ -*, *:before, *:after { - box-sizing: inherit; } - -body { - margin: 0; - background: #fff; - color: #333; - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - letter-spacing: .2px; - -webkit-font-smoothing: antialiased; - box-sizing: border-box; } - -h1 { - font-size: 2rem; - font-weight: 700; - margin: 1.275em 0 0.6em; } - -h2 { - font-size: 1.75rem; - font-weight: 700; - margin: 1.275em 0 0.3em; } - -h3 { - font-size: 1.5rem; - font-weight: 700; - margin: 1em 0 0.3em; } - -h4 { - font-size: 1.25rem; - font-weight: 700; - margin: 1.275em 0 0.85em; } - -h5 { - font-size: 1rem; - font-weight: 700; - margin: 1.275em 0 0.85em; } - -h6 { - font-size: 1rem; - font-weight: 700; - margin: 1.275em 0 0.85em; - color: #777; } - -p { - margin: 0 0 1em; } - -ul, ol { - padding: 0 0 0 2em; - margin: 0 0 0.85em; } - -blockquote { - margin: 0 0 0.85em; - padding: 0 15px; - color: #858585; - border-left: 4px solid #e5e5e5; } - -img { - max-width: 100%; } - -a { - color: #4183c4; - text-decoration: none; } - a:hover, a:focus { - outline: 0; - text-decoration: underline; } - a.discouraged { - text-decoration: line-through; } - a.discouraged:hover, a.discouraged:focus { - text-decoration: underline line-through; } - -table { - background: #fff; - width: 100%; - border-collapse: collapse; - border-spacing: 0; - overflow: auto; - margin: 0 0 0.85em; } - -tr:nth-child(2n) { - background-color: #fbfbfb; } - -th, td { - padding: 6px 13px; - border: 1px solid #ddd; } - -hr { - height: 1px; - border: none; - background-color: #ddd; } - -pre { - margin: 0 0 1.275em; - padding: .85em 1em; - overflow: auto; - background: #f7f7f7; - font-size: .85em; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } - -code { - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } - -.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { - background: #f7f7f7; - padding: .2em; } - .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { - letter-spacing: -.2em; - content: "\00a0"; } - -pre code { - padding: 0; - white-space: pre; } - -.content-wrapper { - display: flex; - flex-direction: column; } - @media (min-width: 768px) { - .content-wrapper { - flex-direction: row; } } -.header { - display: flex; - padding: 8px; - font-size: 0.875em; - background: #444; - color: #999; } - -.header-col { - margin: 0; - padding: 0 8px; } - -.header-col--primary { - flex: 1; } - -.header-link { - color: #fff; } - -.header-icon { - padding-right: 2px; - vertical-align: -3px; - height: 16px; } - -.breadcrumbs { - font-size: 0.875em; - padding: 8px 16px; - margin: 0; - background: #fbfbfb; - border-bottom: 1px solid #ddd; } - -.carat { - height: 10px; - margin: 0 5px; } - -.navigation { - order: 2; } - @media (min-width: 768px) { - .navigation { - order: 1; - width: 25%; - max-width: 300px; - padding-bottom: 64px; - overflow: hidden; - word-wrap: normal; - background: #fbfbfb; - border-right: 1px solid #ddd; } } -.nav-groups { - list-style-type: none; - padding-left: 0; } - -.nav-group-name { - border-bottom: 1px solid #ddd; - padding: 8px 0 8px 16px; } - -.nav-group-name-link { - color: #333; } - -.nav-group-tasks { - margin: 8px 0; - padding: 0 0 0 8px; } - -.nav-group-task { - font-size: 1em; - list-style-type: none; - white-space: nowrap; } - -.nav-group-task-link { - color: #808080; } - -.main-content { - order: 1; } - @media (min-width: 768px) { - .main-content { - order: 2; - flex: 1; - padding-bottom: 60px; } } -.section { - padding: 0 32px; - border-bottom: 1px solid #ddd; } - -.section-content { - max-width: 834px; - margin: 0 auto; - padding: 16px 0; } - -.section-name { - color: #666; - display: block; } - .section-name p { - margin-bottom: inherit; } - -.declaration .highlight { - overflow-x: initial; - padding: 8px 0; - margin: 0; - background-color: transparent; - border: none; } - -.task-group-section { - border-top: 1px solid #ddd; } - -.task-group { - padding-top: 0px; } - -.task-name-container a[name]:before { - content: ""; - display: block; } - -.section-name-container { - position: relative; } - .section-name-container .section-name-link { - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - margin-bottom: 0; } - .section-name-container .section-name { - position: relative; - pointer-events: none; - z-index: 1; } - .section-name-container .section-name a { - pointer-events: auto; } - -.item-container { - padding: 0; } - -.item { - padding-top: 8px; - width: 100%; - list-style-type: none; } - .item a[name]:before { - content: ""; - display: block; } - .item .token, .item .direct-link { - display: inline-block; - text-indent: -20px; - padding-left: 3px; - margin-left: 20px; - font-size: 1rem; } - .item .declaration-note { - font-size: .85em; - color: #808080; - font-style: italic; } - -.pointer-container { - border-bottom: 1px solid #ddd; - left: -23px; - padding-bottom: 13px; - position: relative; - width: 110%; } - -.pointer { - left: 21px; - top: 7px; - display: block; - position: absolute; - width: 12px; - height: 12px; - border-left: 1px solid #ddd; - border-top: 1px solid #ddd; - background: #fff; - transform: rotate(45deg); } - -.height-container { - display: none; - position: relative; - width: 100%; - overflow: hidden; } - .height-container .section { - background: #fff; - border: 1px solid #ddd; - border-top-width: 0; - padding-top: 10px; - padding-bottom: 5px; - padding: 8px 16px; } - -.aside, .language { - padding: 6px 12px; - margin: 12px 0; - border-left: 5px solid #dddddd; - overflow-y: hidden; } - .aside .aside-title, .language .aside-title { - font-size: 9px; - letter-spacing: 2px; - text-transform: uppercase; - padding-bottom: 0; - margin: 0; - color: #aaa; - -webkit-user-select: none; } - .aside p:last-child, .language p:last-child { - margin-bottom: 0; } - -.language { - border-left: 5px solid #cde9f4; } - .language .aside-title { - color: #4183c4; } - -.aside-warning, .aside-deprecated, .aside-unavailable { - border-left: 5px solid #ff6666; } - .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { - color: #ff0000; } - -.graybox { - border-collapse: collapse; - width: 100%; } - .graybox p { - margin: 0; - word-break: break-word; - min-width: 50px; } - .graybox td { - border: 1px solid #ddd; - padding: 5px 25px 5px 10px; - vertical-align: middle; } - .graybox tr td:first-of-type { - text-align: right; - padding: 7px; - vertical-align: top; - word-break: normal; - width: 40px; } - -.slightly-smaller { - font-size: 0.9em; } - -.footer { - padding: 8px 16px; - background: #444; - color: #ddd; - font-size: 0.8em; } - .footer p { - margin: 8px 0; } - .footer a { - color: #fff; } - -html.dash .header, html.dash .breadcrumbs, html.dash .navigation { - display: none; } - -html.dash .height-container { - display: block; } - -form[role=search] input { - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 24px; - padding: 0 10px; - margin: 0; - border: none; - border-radius: 1em; } - .loading form[role=search] input { - background: white url(../img/spinner.gif) center right 4px no-repeat; } - -form[role=search] .tt-menu { - margin: 0; - min-width: 300px; - background: #fbfbfb; - color: #333; - border: 1px solid #ddd; } - -form[role=search] .tt-highlight { - font-weight: bold; } - -form[role=search] .tt-suggestion { - font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; - padding: 0 8px; } - form[role=search] .tt-suggestion span { - display: table-cell; - white-space: nowrap; } - form[role=search] .tt-suggestion .doc-parent-name { - width: 100%; - text-align: right; - font-weight: normal; - font-size: 0.9em; - padding-left: 16px; } - -form[role=search] .tt-suggestion:hover, -form[role=search] .tt-suggestion.tt-cursor { - cursor: pointer; - background-color: #4183c4; - color: #fff; } - -form[role=search] .tt-suggestion:hover .doc-parent-name, -form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { - color: #fff; } diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/custom_rules.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/custom_rules.html deleted file mode 100644 index 6c46a9a8e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/custom_rules.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - custom_rules Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Custom Rules

- -

Create custom rules by providing a regex string. Optionally specify what syntax kinds to match against, the severity level, and what message to display.

- -
    -
  • Identifier: custom_rules
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/cyclomatic_complexity.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/cyclomatic_complexity.html deleted file mode 100644 index 74dc985ed..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/cyclomatic_complexity.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - cyclomatic_complexity Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Cyclomatic Complexity

- -

Complexity of function bodies should be limited.

- -
    -
  • Identifier: cyclomatic_complexity
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -10 -
    -error - -20 -
    -ignores_case_statements - -false -
  • -
-

Non Triggering Examples

-
func f1() {
-    if true {
-        for _ in 1..5 { }
-    }
-    if false { }
-}
-
-
func f(code: Int) -> Int {
-    switch code {
-    case 0: fallthrough
-    case 1: return 1
-    case 2: return 1
-    case 3: return 1
-    case 4: return 1
-    case 5: return 1
-    case 6: return 1
-    case 7: return 1
-    case 8: return 1
-    default: return 1
-    }
-}
-
-
func f1() {
-    if true {}; if true {}; if true {}; if true {}; if true {}; if true {}
-    func f2() {
-        if true {}; if true {}; if true {}; if true {}; if true {}
-    }
-}
-
-

Triggering Examples

-
↓func f1() {
-    if true {
-        if true {
-            if false {}
-        }
-    }
-    if false {}
-    let i = 0
-    switch i {
-        case 1: break
-        case 2: break
-        case 3: break
-        case 4: break
-        default: break
-    }
-    for _ in 1...5 {
-        guard true else {
-            return
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/deployment_target.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/deployment_target.html deleted file mode 100644 index 6042b1add..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/deployment_target.html +++ /dev/null @@ -1,532 +0,0 @@ - - - - deployment_target Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Deployment Target

- -

Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.

- -
    -
  • Identifier: deployment_target
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -iOSApplicationExtension_deployment_target - -7.0 -
    -iOS_deployment_target - -7.0 -
    -macOSApplicationExtension_deployment_target - -10.9 -
    -macOS_deployment_target - -10.9 -
    -tvOSApplicationExtension_deployment_target - -9.0 -
    -tvOS_deployment_target - -9.0 -
    -watchOSApplicationExtension_deployment_target - -1.0 -
    -watchOS_deployment_target - -1.0 -
  • -
-

Non Triggering Examples

-
@available(iOS 12.0, *)
-class A {}
-
-
@available(iOSApplicationExtension 13.0, *)
-class A {}
-
-
@available(watchOS 4.0, *)
-class A {}
-
-
@available(watchOSApplicationExtension 4.0, *)
-class A {}
-
-
@available(swift 3.0.2)
-class A {}
-
-
class A {}
-
-
if #available(iOS 10.0, *) {}
-
-
if #available(iOS 10, *) {}
-
-
guard #available(iOS 12.0, *) else { return }
-
-
#if #unavailable(iOS 15.0) {}
-
-
#guard #unavailable(iOS 15.0) {} else { return }
-
-

Triggering Examples

-
↓@available(iOS 6.0, *)
-class A {}
-
-
↓@available(iOSApplicationExtension 6.0, *)
-class A {}
-
-
↓@available(iOS 7.0, *)
-class A {}
-
-
↓@available(iOS 6, *)
-class A {}
-
-
↓@available(iOS 6.0, macOS 10.12, *)
- class A {}
-
-
↓@available(macOS 10.12, iOS 6.0, *)
- class A {}
-
-
↓@available(macOS 10.7, *)
-class A {}
-
-
↓@available(macOSApplicationExtension 10.7, *)
-class A {}
-
-
↓@available(OSX 10.7, *)
-class A {}
-
-
↓@available(watchOS 0.9, *)
-class A {}
-
-
↓@available(watchOSApplicationExtension 0.9, *)
-class A {}
-
-
↓@available(tvOS 8, *)
-class A {}
-
-
↓@available(tvOSApplicationExtension 8, *)
-class A {}
-
-
if ↓#available(iOS 6.0, *) {}
-
-
if ↓#available(iOS 6, *) {}
-
-
guard ↓#available(iOS 6.0, *) else { return }
-
-
if ↓#unavailable(iOS 7.0) {}
-
-
if ↓#unavailable(iOS 6.9) {}
-
-
guard ↓#unavailable(iOS 7.0) {} else { return }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/direct_return.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/direct_return.html deleted file mode 100644 index 8991dc080..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/direct_return.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - direct_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Direct Return

- -

Directly return the expression instead of assigning it to a variable first

- -
    -
  • Identifier: direct_return
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    func f() -> Int {
-        let b = 2
-        let a = 1
-        return b
-    }
-
-
    struct S {
-        var a: Int {
-            var b = 1
-            b = 2
-            return b
-        }
-    }
-
-
    func f() -> Int {
-        let b = 2
-        f()
-        return b
-    }
-
-
    func f() -> Int {
-        { i in
-            let b = 2
-            return i
-        }(1)
-    }
-
-

Triggering Examples

-
    func f() -> Int {
-        let ↓b = 2
-        return b
-    }
-
-
    struct S {
-        var a: Int {
-            var ↓b = 1
-            // comment
-            return b
-        }
-    }
-
-
    func f() -> Bool {
-        let a = 1, ↓b = true
-        return b
-    }
-
-
    func f() -> Int {
-        { _ in
-            let ↓b = 2
-            return b
-        }(1)
-    }
-
-
    func f(i: Int) -> Int {
-        if i > 1 {
-            let ↓a = 2
-            return a
-        } else {
-            let ↓b = 2, a = 1
-            return b
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discarded_notification_center_observer.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discarded_notification_center_observer.html deleted file mode 100644 index e33b14917..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discarded_notification_center_observer.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - discarded_notification_center_observer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discarded Notification Center Observer

- -

When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later

- -
    -
  • Identifier: discarded_notification_center_observer
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
func foo() -> Any {
-    return nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
func foo() -> Any {
-    nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
var obs: [Any?] = []
-obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
var obs: [String: Any?] = []
-obs["foo"] = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
var obs: [Any?] = []
-obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
func foo(_ notif: Any) {
-   obs.append(notif)
-}
-foo(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
-
-
var obs: [NSObjectProtocol] = [
-   nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }),
-   nc.addObserver(forName: .CKAccountChanged, object: nil, queue: nil, using: { })
-]
-
-
names.map { self.notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block) }
-
-
f { return nc.addObserver(forName: $0, object: object, queue: queue, using: block) }
-
-

Triggering Examples

-
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
_ = ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
-
-
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-
-
@discardableResult func foo() -> Any {
-   return ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-}
-
-
class C {
-    var i: Int {
-        set { ↓notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block) }
-        get {
-            ↓notificationCenter.addObserver(forName: $0, object: object, queue: queue, using: block)
-            return 2
-        }
-    }
-}
-
-
f {
-    ↓nc.addObserver(forName: $0, object: object, queue: queue) {}
-    return 2
-}
-
-
func foo() -> Any {
-    if cond {
-        ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_assert.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_assert.html deleted file mode 100644 index 90033cc69..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_assert.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - discouraged_assert Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Assert

- -

Prefer assertionFailure() and/or preconditionFailure() over assert(false)

- -
    -
  • Identifier: discouraged_assert
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
assert(true)
-
-
assert(true, "foobar")
-
-
assert(true, "foobar", file: "toto", line: 42)
-
-
assert(false || true)
-
-
XCTAssert(false)
-
-

Triggering Examples

-
↓assert(false)
-
-
↓assert(false, "foobar")
-
-
↓assert(false, "foobar", file: "toto", line: 42)
-
-
↓assert(   false    , "foobar")
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_direct_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_direct_init.html deleted file mode 100644 index f15e994fa..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_direct_init.html +++ /dev/null @@ -1,440 +0,0 @@ - - - - discouraged_direct_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Direct Initialization

- -

Discouraged direct initialization of types that can be harmful

- -
    -
  • Identifier: discouraged_direct_init
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -types - -[“Bundle”, “Bundle.init”, “NSError”, “NSError.init”, “UIDevice”, “UIDevice.init”] -
  • -
-

Non Triggering Examples

-
let foo = UIDevice.current
-
-
let foo = Bundle.main
-
-
let foo = Bundle(path: "bar")
-
-
let foo = Bundle(identifier: "bar")
-
-
let foo = Bundle.init(path: "bar")
-
-
let foo = Bundle.init(identifier: "bar")
-
-
let foo = NSError(domain: "bar", code: 0)
-
-
let foo = NSError.init(domain: "bar", code: 0)
-
-
func testNSError()
-
-

Triggering Examples

-
↓UIDevice()
-
-
↓Bundle()
-
-
let foo = ↓UIDevice()
-
-
let foo = ↓Bundle()
-
-
let foo = ↓NSError()
-
-
let foo = bar(bundle: ↓Bundle(), device: ↓UIDevice(), error: ↓NSError())
-
-
↓UIDevice.init()
-
-
↓Bundle.init()
-
-
↓NSError.init()
-
-
let foo = ↓UIDevice.init()
-
-
let foo = ↓Bundle.init()
-
-
let foo = bar(bundle: ↓Bundle.init(), device: ↓UIDevice.init(), error: ↓NSError.init())
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_none_name.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_none_name.html deleted file mode 100644 index 062242763..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_none_name.html +++ /dev/null @@ -1,518 +0,0 @@ - - - - discouraged_none_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged None Name

- -

Enum cases and static members named none are discouraged as they can conflict with Optional<T>.none.

- -
    -
  • Identifier: discouraged_none_name
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum MyEnum {
-    case nOne
-}
-
-
enum MyEnum {
-    case _none
-}
-
-
enum MyEnum {
-    case none_
-}
-
-
enum MyEnum {
-    case none(Any)
-}
-
-
enum MyEnum {
-    case nonenone
-}
-
-
class MyClass {
-    class var nonenone: MyClass { MyClass() }
-}
-
-
class MyClass {
-    static var nonenone = MyClass()
-}
-
-
class MyClass {
-    static let nonenone = MyClass()
-}
-
-
struct MyStruct {
-    static var nonenone = MyStruct()
-}
-
-
struct MyStruct {
-    static let nonenone = MyStruct()
-}
-
-
struct MyStruct {
-    let none = MyStruct()
-}
-
-
struct MyStruct {
-    var none = MyStruct()
-}
-
-
class MyClass {
-    let none = MyClass()
-}
-
-
class MyClass {
-    var none = MyClass()
-}
-
-

Triggering Examples

-
enum MyEnum {
-    case ↓none
-}
-
-
enum MyEnum {
-    case a, ↓none
-}
-
-
enum MyEnum {
-    case ↓none, b
-}
-
-
enum MyEnum {
-    case a, ↓none, b
-}
-
-
enum MyEnum {
-    case a
-    case ↓none
-}
-
-
enum MyEnum {
-    case ↓none
-    case b
-}
-
-
enum MyEnum {
-    case a
-    case ↓none
-    case b
-}
-
-
class MyClass {
-    ↓static let none = MyClass()
-}
-
-
class MyClass {
-    ↓static let none: MyClass = MyClass()
-}
-
-
class MyClass {
-    ↓static var none: MyClass = MyClass()
-}
-
-
class MyClass {
-    ↓class var none: MyClass { MyClass() }
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none: MyStruct = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none: MyStruct = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var a = MyStruct(), none = MyStruct()
-}
-
-
struct MyStruct {
-    ↓static var none = MyStruct(), a = MyStruct()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_object_literal.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_object_literal.html deleted file mode 100644 index 119ec8db8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_object_literal.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - discouraged_object_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Object Literal

- -

Prefer initializers over object literals

- -
    -
  • Identifier: discouraged_object_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -image_literal - -true -
    -color_literal - -true -
  • -
-

Non Triggering Examples

-
let image = UIImage(named: aVariable)
-
-
let image = UIImage(named: "interpolated \(variable)")
-
-
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
-
-
let image = NSImage(named: aVariable)
-
-
let image = NSImage(named: "interpolated \(variable)")
-
-
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
-
-

Triggering Examples

-
let image = ↓#imageLiteral(resourceName: "image.jpg")
-
-
let color = ↓#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_boolean.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_boolean.html deleted file mode 100644 index 08fa63912..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_boolean.html +++ /dev/null @@ -1,774 +0,0 @@ - - - - discouraged_optional_boolean Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Optional Boolean

- -

Prefer non-optional booleans over optional booleans

- -
    -
  • Identifier: discouraged_optional_boolean
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var foo: Bool
-
-
var foo: [String: Bool]
-
-
var foo: [Bool]
-
-
let foo: Bool = true
-
-
let foo: Bool = false
-
-
let foo: [String: Bool] = [:]
-
-
let foo: [Bool] = []
-
-
var foo: Bool { return true }
-
-
let foo: Bool { return false }()
-
-
func foo() -> Bool {}
-
-
func foo() -> [String: Bool] {}
-
-
func foo() -> ([Bool]) -> String {}
-
-
func foo(input: Bool = true) {}
-
-
func foo(input: [String: Bool] = [:]) {}
-
-
func foo(input: [Bool] = []) {}
-
-
class Foo {
-    func foo() -> Bool {}
-}
-
-
class Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
class Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
struct Foo {
-    func foo() -> Bool {}
-}
-
-
struct Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
struct Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
enum Foo {
-    func foo() -> Bool {}
-}
-
-
enum Foo {
-    func foo() -> [String: Bool] {}
-}
-
-
enum Foo {
-    func foo() -> ([Bool]) -> String {}
-}
-
-
class Foo {
-    func foo(input: Bool = true) {}
-}
-
-
class Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
class Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-
struct Foo {
-    func foo(input: Bool = true) {}
-}
-
-
struct Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
struct Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-
enum Foo {
-    func foo(input: Bool = true) {}
-}
-
-
enum Foo {
-    func foo(input: [String: Bool] = [:]) {}
-}
-
-
enum Foo {
-    func foo(input: [Bool] = []) {}
-}
-
-

Triggering Examples

-
var foo: ↓Bool?
-
-
var foo: [String: ↓Bool?]
-
-
var foo: [↓Bool?]
-
-
let foo: ↓Bool? = nil
-
-
let foo: [String: ↓Bool?] = [:]
-
-
let foo: [↓Bool?] = []
-
-
let foo = ↓Optional.some(false)
-
-
let foo = ↓Optional.some(true)
-
-
var foo: ↓Bool? { return nil }
-
-
let foo: ↓Bool? { return nil }()
-
-
func foo() -> ↓Bool? {}
-
-
func foo() -> [String: ↓Bool?] {}
-
-
func foo() -> [↓Bool?] {}
-
-
static func foo() -> ↓Bool? {}
-
-
static func foo() -> [String: ↓Bool?] {}
-
-
static func foo() -> [↓Bool?] {}
-
-
func foo() -> (↓Bool?) -> String {}
-
-
func foo() -> ([Int]) -> ↓Bool? {}
-
-
func foo(input: ↓Bool?) {}
-
-
func foo(input: [String: ↓Bool?]) {}
-
-
func foo(input: [↓Bool?]) {}
-
-
static func foo(input: ↓Bool?) {}
-
-
static func foo(input: [String: ↓Bool?]) {}
-
-
static func foo(input: [↓Bool?]) {}
-
-
class Foo {
-    var foo: ↓Bool?
-}
-
-
class Foo {
-    var foo: [String: ↓Bool?]
-}
-
-
class Foo {
-    let foo: ↓Bool? = nil
-}
-
-
class Foo {
-    let foo: [String: ↓Bool?] = [:]
-}
-
-
class Foo {
-    let foo: [↓Bool?] = []
-}
-
-
struct Foo {
-    var foo: ↓Bool?
-}
-
-
struct Foo {
-    var foo: [String: ↓Bool?]
-}
-
-
struct Foo {
-    let foo: ↓Bool? = nil
-}
-
-
struct Foo {
-    let foo: [String: ↓Bool?] = [:]
-}
-
-
struct Foo {
-    let foo: [↓Bool?] = []
-}
-
-
class Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
class Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓Bool? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓Bool? { return nil }()
-}
-
-
class Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
class Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
class Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
class Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
class Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
class Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
class Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
struct Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
struct Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
struct Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
struct Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
struct Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
struct Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
enum Foo {
-    func foo() -> ↓Bool? {}
-}
-
-
enum Foo {
-    func foo() -> [String: ↓Bool?] {}
-}
-
-
enum Foo {
-    func foo() -> [↓Bool?] {}
-}
-
-
enum Foo {
-    static func foo() -> ↓Bool? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: ↓Bool?] {}
-}
-
-
enum Foo {
-    static func foo() -> [↓Bool?] {}
-}
-
-
enum Foo {
-    func foo() -> (↓Bool?) -> String {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> ↓Bool? {}
-}
-
-
class Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
class Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
class Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
class Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
class Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
class Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
struct Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
struct Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
struct Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
struct Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
struct Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
enum Foo {
-    func foo(input: ↓Bool?) {}
-}
-
-
enum Foo {
-    func foo(input: [String: ↓Bool?]) {}
-}
-
-
enum Foo {
-    func foo(input: [↓Bool?]) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓Bool?) {}
-}
-
-
enum Foo {
-    static func foo(input: [String: ↓Bool?]) {}
-}
-
-
enum Foo {
-    static func foo(input: [↓Bool?]) {}
-}
-
-
_ = ↓Bool?.values()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_collection.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_collection.html deleted file mode 100644 index b5775a9bb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/discouraged_optional_collection.html +++ /dev/null @@ -1,954 +0,0 @@ - - - - discouraged_optional_collection Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Discouraged Optional Collection

- -

Prefer empty collection over optional collection

- -
    -
  • Identifier: discouraged_optional_collection
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var foo: [Int]
-
-
var foo: [String: Int]
-
-
var foo: Set<String>
-
-
var foo: [String: [String: Int]]
-
-
let foo: [Int] = []
-
-
let foo: [String: Int] = [:]
-
-
let foo: Set<String> = []
-
-
let foo: [String: [String: Int]] = [:]
-
-
var foo: [Int] { return [] }
-
-
func foo() -> [Int] {}
-
-
func foo() -> [String: String] {}
-
-
func foo() -> Set<Int> {}
-
-
func foo() -> ([Int]) -> String {}
-
-
func foo(input: [String] = []) {}
-
-
func foo(input: [String: String] = [:]) {}
-
-
func foo(input: Set<String> = []) {}
-
-
class Foo {
-    func foo() -> [Int] {}
-}
-
-
class Foo {
-    func foo() -> [String: String] {}
-}
-
-
class Foo {
-    func foo() -> Set<Int> {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
struct Foo {
-    func foo() -> [Int] {}
-}
-
-
struct Foo {
-    func foo() -> [String: String] {}
-}
-
-
struct Foo {
-    func foo() -> Set<Int> {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
enum Foo {
-    func foo() -> [Int] {}
-}
-
-
enum Foo {
-    func foo() -> [String: String] {}
-}
-
-
enum Foo {
-    func foo() -> Set<Int> {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> String {}
-}
-
-
class Foo {
-    func foo(input: [String] = []) {}
-}
-
-
class Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
class Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-
struct Foo {
-    func foo(input: [String] = []) {}
-}
-
-
struct Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
struct Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-
enum Foo {
-    func foo(input: [String] = []) {}
-}
-
-
enum Foo {
-    func foo(input: [String: String] = [:]) {}
-}
-
-
enum Foo {
-    func foo(input: Set<String> = []) {}
-}
-
-

Triggering Examples

-
var foo: ↓[Int]?
-
-
var foo: ↓[String: Int]?
-
-
var foo: ↓Set<String>?
-
-
let foo: ↓[Int]? = nil
-
-
let foo: ↓[String: Int]? = nil
-
-
let foo: ↓Set<String>? = nil
-
-
var foo: ↓[Int]? { return nil }
-
-
let foo: ↓[Int]? { return nil }()
-
-
func foo() -> ↓[T]? {}
-
-
func foo() -> ↓[String: String]? {}
-
-
func foo() -> ↓[String: [String: String]]? {}
-
-
func foo() -> [String: ↓[String: String]?] {}
-
-
func foo() -> ↓Set<Int>? {}
-
-
static func foo() -> ↓[T]? {}
-
-
static func foo() -> ↓[String: String]? {}
-
-
static func foo() -> ↓[String: [String: String]]? {}
-
-
static func foo() -> [String: ↓[String: String]?] {}
-
-
static func foo() -> ↓Set<Int>? {}
-
-
func foo() -> (↓[Int]?) -> String {}
-
-
func foo() -> ([Int]) -> ↓[String]? {}
-
-
func foo(input: ↓[String: String]?) {}
-
-
func foo(input: ↓[String: [String: String]]?) {}
-
-
func foo(input: [String: ↓[String: String]?]) {}
-
-
func foo(input: ↓[String: ↓[String: String]?]?) {}
-
-
func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-
-
func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-
-
static func foo(input: ↓[String: String]?) {}
-
-
static func foo(input: ↓[String: [String: String]]?) {}
-
-
static func foo(input: [String: ↓[String: String]?]) {}
-
-
static func foo(input: ↓[String: ↓[String: String]?]?) {}
-
-
static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-
-
static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-
-
class Foo {
-    var foo: ↓[Int]?
-}
-
-
class Foo {
-    var foo: ↓[String: Int]?
-}
-
-
class Foo {
-    var foo: ↓Set<String>?
-}
-
-
class Foo {
-    let foo: ↓[Int]? = nil
-}
-
-
class Foo {
-    let foo: ↓[String: Int]? = nil
-}
-
-
class Foo {
-    let foo: ↓Set<String>? = nil
-}
-
-
struct Foo {
-    var foo: ↓[Int]?
-}
-
-
struct Foo {
-    var foo: ↓[String: Int]?
-}
-
-
struct Foo {
-    var foo: ↓Set<String>?
-}
-
-
struct Foo {
-    let foo: ↓[Int]? = nil
-}
-
-
struct Foo {
-    let foo: ↓[String: Int]? = nil
-}
-
-
struct Foo {
-    let foo: ↓Set<String>? = nil
-}
-
-
class Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
class Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
class Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
class Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
struct Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
struct Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓[Int]? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓[Int]? { return nil }()
-}
-
-
enum Foo {
-    var foo: ↓Set<String>? { return nil }
-}
-
-
enum Foo {
-    let foo: ↓Set<String>? { return nil }()
-}
-
-
class Foo {
-    func foo() -> [T]? {}
-}
-
-
class Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
class Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
class Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
class Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
class Foo {
-    static func foo() -> [T]? {}
-}
-
-
class Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
class Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
class Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
class Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
class Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
class Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
struct Foo {
-    func foo() -> [T]? {}
-}
-
-
struct Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
struct Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
struct Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
struct Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
struct Foo {
-    static func foo() -> [T]? {}
-}
-
-
struct Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
struct Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
struct Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
struct Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
enum Foo {
-    func foo() -> [T]? {}
-}
-
-
enum Foo {
-    func foo() -> ↓[String: String]? {}
-}
-
-
enum Foo {
-    func foo() -> [String: [String: String]]? {}
-}
-
-
enum Foo {
-    func foo() -> [String: ↓[String: String]?] {}
-}
-
-
enum Foo {
-    func foo() -> Set<Int>? {}
-}
-
-
enum Foo {
-    static func foo() -> [T]? {}
-}
-
-
enum Foo {
-    static func foo() -> ↓[String: String]? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: [String: String]]? {}
-}
-
-
enum Foo {
-    static func foo() -> [String: ↓[String: String]?] {}
-}
-
-
enum Foo {
-    static func foo() -> Set<Int>? {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]?) -> String {}
-}
-
-
enum Foo {
-    func foo() -> ([Int]) -> [String]? {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
class Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
class Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
class Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
class Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
class Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
class Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
class Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
class Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
struct Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
struct Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
struct Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
struct Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
struct Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
struct Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
struct Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
struct Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    func foo(input: ↓[String: String]?) {}
-}
-
-
enum Foo {
-    func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
enum Foo {
-    func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
enum Foo {
-    func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
enum Foo {
-    func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: String]?) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: [String: String]]?) {}
-}
-
-
enum Foo {
-    static func foo(input: [String: ↓[String: String]?]) {}
-}
-
-
enum Foo {
-    static func foo(input: ↓[String: ↓[String: String]?]?) {}
-}
-
-
enum Foo {
-    static func foo<K, V>(_ dict1: [K: V], _ dict2: ↓[K: V]?) -> [K: V]
-}
-
-
enum Foo {
-    static func foo<K, V>(dict1: [K: V], dict2: ↓[K: V]?) -> [K: V]
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_conditions.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_conditions.html deleted file mode 100644 index 4f615ad7d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_conditions.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - duplicate_conditions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Conditions

- -

Duplicate sets of conditions in the same branch instruction should be avoided

- -
    -
  • Identifier: duplicate_conditions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
    if x < 5 {
-      foo()
-    } else if y == "s" {
-      bar()
-    }
-
-
    if x < 5 {
-      foo()
-    }
-    if x < 5 {
-      bar()
-    }
-
-
    if x < 5, y == "s" {
-      foo()
-    } else if x < 5 {
-      bar()
-    }
-
-
    switch x {
-    case "a":
-      foo()
-      bar()
-    }
-
-
    switch x {
-    case "a" where y == "s":
-      foo()
-    case "a" where y == "t":
-      bar()
-    }
-
-
    if let x = maybeAbc {
-      foo()
-    } else if let x = maybePqr {
-      bar()
-    }
-
-
    if let x = maybeAbc, let z = x.maybeY {
-      foo()
-    } else if let x = maybePqr, let z = x.maybeY {
-      bar()
-    }
-
-
    if case .p = x {
-      foo()
-    } else if case .q = x {
-      bar()
-    }
-
-
    if true {
-      if true { foo() }
-    }
-
-

Triggering Examples

-
    if ↓x < 5 {
-      foo()
-    } else if y == "s" {
-      bar()
-    } else if ↓x < 5 {
-      baz()
-    }
-
-
    if z {
-      if ↓x < 5 {
-        foo()
-      } else if y == "s" {
-        bar()
-      } else if ↓x < 5 {
-        baz()
-      }
-    }
-
-
    if ↓x < 5, y == "s" {
-      foo()
-    } else if x < 10 {
-      bar()
-    } else if ↓y == "s", x < 5 {
-      baz()
-    }
-
-
    switch x {
-    case ↓"a", "b":
-      foo()
-    case "c", ↓"a":
-      bar()
-    }
-
-
    switch x {
-    case ↓"a" where y == "s":
-      foo()
-    case ↓"a" where y == "s":
-      bar()
-    }
-
-
    if ↓let xyz = maybeXyz {
-      foo()
-    } else if ↓let xyz = maybeXyz {
-      bar()
-    }
-
-
    if ↓let x = maybeAbc, let z = x.maybeY {
-      foo()
-    } else if ↓let x = maybeAbc, let z = x.maybeY {
-      bar()
-    }
-
-
    if ↓#available(macOS 10.15, *) {
-      foo()
-    } else if ↓#available(macOS 10.15, *) {
-      bar()
-    }
-
-
    if ↓case .p = x {
-      foo()
-    } else if ↓case .p = x {
-      bar()
-    }
-
-
    if ↓x < 5 {}
-    else if ↓x < 5 {}
-    else if ↓x < 5 {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_enum_cases.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_enum_cases.html deleted file mode 100644 index bc0d1bfbf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_enum_cases.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - duplicate_enum_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Enum Cases

- -

Enum shouldn’t contain multiple cases with the same name

- -
    -
  • Identifier: duplicate_enum_cases
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
enum PictureImport {
-    case addImage(image: UIImage)
-    case addData(data: Data)
-}
-
-
enum A {
-    case add(image: UIImage)
-}
-enum B {
-    case add(image: UIImage)
-}
-
-
enum Tag: String {
-#if CONFIG_A
-    case value = "CONFIG_A"
-#elseif CONFIG_B
-    case value = "CONFIG_B"
-#else
-    case value = "CONFIG_DEFAULT"
-#endif
-}
-
-
enum Target {
-#if os(iOS)
-  case file
-#else
-  case file(URL)
-#endif
-}
-
-

Triggering Examples

-
enum PictureImport {
-    case ↓add(image: UIImage)
-    case addURL(url: URL)
-    case ↓add(data: Data)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_imports.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_imports.html deleted file mode 100644 index 2134fa494..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicate_imports.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - duplicate_imports Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Imports

- -

Imports should be unique

- -
    -
  • Identifier: duplicate_imports
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
import A
-import B
-import C
-
-
import A.B
-import A.C
-
-
@_implementationOnly import A
-@_implementationOnly import B
-
-
@testable import A
-@testable import B
-
-
#if DEBUG
-    @testable import KsApi
-#else
-    import KsApi
-#endif
-
-
import A // module
-import B // module
-
-
#if TEST
-func test() {
-}
-
-

Triggering Examples

-
@_implementationOnly import A
-↓@_implementationOnly import A
-
-
-
@testable import A
-↓@testable import A
-
-
-
import A
-#if DEBUG
-    @testable import KsApi
-#else
-    import KsApi
-#endif
-↓import A
-
-
-
import A
-↓import class A.Foo
-
-
-
import A
-↓import enum A.Foo
-
-
-
import A
-↓import func A.Foo
-
-
-
import A
-↓import let A.Foo
-
-
-
import A
-↓import protocol A.Foo
-
-
-
import A
-↓import struct A.Foo
-
-
-
import A
-↓import typealias A.Foo
-
-
-
import A
-↓import var A.Foo
-
-
-
import A.B
-↓import A.B.C
-
-
-
import Foundation
-import Dispatch
-↓import Foundation
-
-
-
import Foundation
-↓import Foundation
-↓import Foundation
-
-
-
import Foundation
-↓import Foundation.NSString
-
-
-
↓import A.B.C
-import A.B
-
-
-
↓import Foundation.NSString
-import Foundation
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html deleted file mode 100644 index 5ea1fc56b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - duplicated_key_in_dictionary_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicated Key in Dictionary Literal

- -

Dictionary literals with duplicated keys will crash at runtime

- -
    -
  • Identifier: duplicated_key_in_dictionary_literal
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    [
-        1: "1",
-        2: "2"
-    ]
-
-
    [
-        "1": 1,
-        "2": 2
-    ]
-
-
    [
-        foo: "1",
-        bar: "2"
-    ]
-
-
    [
-        UUID(): "1",
-        UUID(): "2"
-    ]
-
-
    [
-        #line: "1",
-        #line: "2"
-    ]
-
-

Triggering Examples

-
    [
-        1: "1",
-        2: "2",
-        ↓1: "one"
-    ]
-
-
    [
-        "1": 1,
-        "2": 2,
-        ↓"2": 2
-    ]
-
-
    [
-        foo: "1",
-        bar: "2",
-        baz: "3",
-        ↓foo: "4",
-        zaz: "5"
-    ]
-
-
    [
-        .one: "1",
-        .two: "2",
-        .three: "3",
-        ↓.one: "1",
-        .four: "4",
-        .five: "5"
-    ]
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/dynamic_inline.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/dynamic_inline.html deleted file mode 100644 index 92b3066bb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/dynamic_inline.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - dynamic_inline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Dynamic Inline

- -

Avoid using ‘dynamic’ and ‘@inline(__always)’ together

- -
    -
  • Identifier: dynamic_inline
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
class C {
-dynamic func f() {}}
-
-
class C {
-@inline(__always) func f() {}}
-
-
class C {
-@inline(never) dynamic func f() {}}
-
-

Triggering Examples

-
class C {
-@inline(__always) dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always) public dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always) dynamic internal ↓func f() {}
-}
-
-
class C {
-@inline(__always)
-dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always)
-dynamic
-↓func f() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_collection_literal.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_collection_literal.html deleted file mode 100644 index 1d3d3fa83..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_collection_literal.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - empty_collection_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Collection Literal

- -

Prefer checking isEmpty over comparing collection to an empty array or dictionary literal

- -
    -
  • Identifier: empty_collection_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
myArray = []
-
-
myArray.isEmpty
-
-
!myArray.isEmpty
-
-
myDict = [:]
-
-

Triggering Examples

-
myArray↓ == []
-
-
myArray↓ != []
-
-
myArray↓ == [ ]
-
-
myDict↓ == [:]
-
-
myDict↓ != [:]
-
-
myDict↓ == [: ]
-
-
myDict↓ == [ :]
-
-
myDict↓ == [ : ]
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_count.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_count.html deleted file mode 100644 index 9cae39360..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_count.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - empty_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Count

- -

Prefer checking isEmpty over comparing count to zero

- -
    -
  • Identifier: empty_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -error -
    -only_after_dot - -false -
  • -
-

Non Triggering Examples

-
var count = 0
-
-
[Int]().isEmpty
-
-
[Int]().count > 1
-
-
[Int]().count == 1
-
-
[Int]().count == 0xff
-
-
[Int]().count == 0b01
-
-
[Int]().count == 0o07
-
-
discount == 0
-
-
order.discount == 0
-
-

Triggering Examples

-
[Int]().↓count == 0
-
-
0 == [Int]().↓count
-
-
[Int]().↓count==0
-
-
[Int]().↓count > 0
-
-
[Int]().↓count != 0
-
-
[Int]().↓count == 0x0
-
-
[Int]().↓count == 0x00_00
-
-
[Int]().↓count == 0b00
-
-
[Int]().↓count == 0o00
-
-
↓count == 0
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_enum_arguments.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_enum_arguments.html deleted file mode 100644 index 438480839..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_enum_arguments.html +++ /dev/null @@ -1,505 +0,0 @@ - - - - empty_enum_arguments Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Enum Arguments

- -

Arguments can be omitted when matching enums with associated values if they are not used

- -
    -
  • Identifier: empty_enum_arguments
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar: break
-}
-
-
switch foo {
-case .bar(let x): break
-}
-
-
switch foo {
-case let .bar(x): break
-}
-
-
switch (foo, bar) {
-case (_, _): break
-}
-
-
switch foo {
-case "bar".uppercased(): break
-}
-
-
switch (foo, bar) {
-case (_, _) where !something: break
-}
-
-
switch foo {
-case (let f as () -> String)?: break
-}
-
-
switch foo {
-case .bar(Baz()): break
-}
-
-
switch foo {
-case .bar(.init()): break
-}
-
-
switch foo {
-default: break
-}
-
-
if case .bar = foo {
-}
-
-
guard case .bar = foo else {
-}
-
-
if foo == .bar() {}
-
-
guard foo == .bar() else { return }
-
-
if case .appStore = self.appInstaller, !UIDevice.isSimulator() {
-  viewController.present(self, animated: false)
-} else {
-  UIApplication.shared.open(self.appInstaller.url)
-}
-
-
let updatedUserNotificationSettings = deepLink.filter { nav in
-  guard case .settings(.notifications(_, nil)) = nav else { return false }
-  return true
-}
-
-

Triggering Examples

-
switch foo {
-case .bar↓(_): break
-}
-
-
switch foo {
-case .bar↓(): break
-}
-
-
switch foo {
-case .bar↓(_), .bar2↓(_): break
-}
-
-
switch foo {
-case .bar↓() where method() > 2: break
-}
-
-
switch foo {
-case .bar(.baz↓()): break
-}
-
-
switch foo {
-case .bar(.baz↓(_)): break
-}
-
-
func example(foo: Foo) {
-    switch foo {
-    case case .bar↓(_):
-        break
-    }
-}
-
-
if case .bar↓(_) = foo {
-}
-
-
guard case .bar↓(_) = foo else {
-}
-
-
if case .bar↓() = foo {
-}
-
-
guard case .bar↓() = foo else {
-}
-
-
if case .appStore↓(_) = self.appInstaller, !UIDevice.isSimulator() {
-  viewController.present(self, animated: false)
-} else {
-  UIApplication.shared.open(self.appInstaller.url)
-}
-
-
let updatedUserNotificationSettings = deepLink.filter { nav in
-  guard case .settings(.notifications↓(_, _)) = nav else { return false }
-  return true
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parameters.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parameters.html deleted file mode 100644 index 079edc765..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parameters.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - empty_parameters Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Parameters

- -

Prefer () -> over Void ->

- -
    -
  • Identifier: empty_parameters
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc: () -> Void = {}
-
-
func foo(completion: () -> Void)
-
-
func foo(completion: () throws -> Void)
-
-
let foo: (ConfigurationTests) -> Void throws -> Void)
-
-
let foo: (ConfigurationTests) ->   Void throws -> Void)
-
-
let foo: (ConfigurationTests) ->Void throws -> Void)
-
-

Triggering Examples

-
let abc: ↓(Void) -> Void = {}
-
-
func foo(completion: ↓(Void) -> Void)
-
-
func foo(completion: ↓(Void) throws -> Void)
-
-
let foo: ↓(Void) -> () throws -> Void)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html deleted file mode 100644 index cda4d4790..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - empty_parentheses_with_trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Parentheses with Trailing Closure

- -

When using trailing closures, empty parentheses should be avoided after the method call

- -
    -
  • Identifier: empty_parentheses_with_trailing_closure
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].reduce(0) { $0 + $1 }
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
let isEmpty = [1, 2].isEmpty()
-
-
UIView.animateWithDuration(0.3, animations: {
-   self.disableInteractionRightView.alpha = 0
-}, completion: { _ in
-   ()
-})
-
-

Triggering Examples

-
[1, 2].map↓() { $0 + 1 }
-
-
[1, 2].map↓( ) { $0 + 1 }
-
-
[1, 2].map↓() { number in
- number + 1 
-}
-
-
[1, 2].map↓(  ) { number in
- number + 1 
-}
-
-
func foo() -> [Int] {
-    return [1, 2].map↓() { $0 + 1 }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_string.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_string.html deleted file mode 100644 index 36ca6cd98..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_string.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - empty_string Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty String

- -

Prefer checking isEmpty over comparing string to an empty string literal

- -
    -
  • Identifier: empty_string
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
myString.isEmpty
-
-
!myString.isEmpty
-
-
"""
-foo==
-"""
-
-

Triggering Examples

-
myString↓ == ""
-
-
myString↓ != ""
-
-
myString↓==""
-
-
myString↓ == #""#
-
-
myString↓ == ##""##
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_xctest_method.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_xctest_method.html deleted file mode 100644 index 0ae767c9e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/empty_xctest_method.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - empty_xctest_method Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty XCTest Method

- -

Empty XCTest method should be avoided

- -
    -
  • Identifier: empty_xctest_method
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
class TotoTests: XCTestCase {
-    var foobar: Foobar?
-
-    override func setUp() {
-        super.setUp()
-        foobar = Foobar()
-    }
-
-    override func setUpWithError() throws {
-        foobar = nil
-    }
-
-    override func tearDown() {
-        foobar = nil
-        super.tearDown()
-    }
-
-    func testFoo() {
-        XCTAssertTrue(foobar?.foo)
-    }
-
-    func testBar() {
-        // comment...
-
-        XCTAssertFalse(foobar?.bar)
-
-        // comment...
-    }
-
-    func testBaz() {
-        _ = 4 + 4
-    }
-}
-
-
class Foobar {
-    func setUp() {}
-
-    func tearDown() {}
-
-    func testFoo() {}
-}
-
-
class TotoTests: XCTestCase {
-    func setUp(with object: Foobar) {}
-
-    func tearDown(object: Foobar) {}
-
-    func testFoo(_ foo: Foobar) {}
-
-    func testBar(bar: (String) -> Int) {}
-}
-
-
class TotoTests: XCTestCase {
-    func testFoo() { XCTAssertTrue(foobar?.foo) }
-
-    func testBar() { XCTAssertFalse(foobar?.bar) }
-}
-
-
class TotoTests: XCTestCase {
-    override class var runsForEachTargetApplicationUIConfiguration: Bool { true }
-
-    static var allTests = [("testFoo", testFoo)]
-
-    func testFoo() { XCTAssert(true) }
-}
-
-

Triggering Examples

-
class TotoTests: XCTestCase {
-    override ↓func setUp() {
-    }
-
-    override ↓func tearDown() {
-
-    }
-
-    ↓func testFoo() {
-
-
-    }
-
-    ↓func testBar() {
-
-
-
-    }
-
-    func helperFunction() {
-    }
-}
-
-
class TotoTests: XCTestCase {
-    override ↓func setUp() {}
-
-    override ↓func tearDown() {}
-
-    ↓func testFoo() {}
-
-    func helperFunction() {}
-}
-
-
class TotoTests: XCTestCase {
-    override ↓func setUp() {
-        // comment...
-    }
-
-    override ↓func tearDown() {
-        // comment...
-        // comment...
-    }
-
-    ↓func testFoo() {
-        // comment...
-
-        // comment...
-
-        // comment...
-    }
-
-    ↓func testBar() {
-        /*
-         * comment...
-         *
-         * comment...
-         *
-         * comment...
-         */
-    }
-
-    func helperFunction() {
-    }
-}
-
-
class FooTests: XCTestCase {
-    override ↓func setUp() {}
-}
-
-class BarTests: XCTestCase {
-    ↓func testFoo() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/enum_case_associated_values_count.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/enum_case_associated_values_count.html deleted file mode 100644 index c3b17f7cf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/enum_case_associated_values_count.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - enum_case_associated_values_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Enum Case Associated Values Count

- -

The number of associated values in an enum case should be low.

- -
    -
  • Identifier: enum_case_associated_values_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -5 -
    -error - -6 -
  • -
-

Non Triggering Examples

-
enum Employee {
-    case fullTime(name: String, retirement: Date, designation: String, contactNumber: Int)
-    case partTime(name: String, age: Int, contractEndDate: Date)
-}
-
-
enum Barcode {
-    case upc(Int, Int, Int, Int)
-}
-
-

Triggering Examples

-
enum Employee {
-    case ↓fullTime(name: String, retirement: Date, age: Int, designation: String, contactNumber: Int)
-    case ↓partTime(name: String, contractEndDate: Date, age: Int, designation: String, contactNumber: Int)
-}
-
-
enum Barcode {
-    case ↓upc(Int, Int, Int, Int, Int, Int)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/expiring_todo.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/expiring_todo.html deleted file mode 100644 index 7e9a76b32..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/expiring_todo.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - expiring_todo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Expiring Todo

- -

TODOs and FIXMEs should be resolved prior to their expiry date.

- -
    -
  • Identifier: expiring_todo
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -approaching_expiry_severity - -warning -
    -expired_severity - -error -
    -bad_formatting_severity - -error -
    -approaching_expiry_threshold - -15 -
    -date_delimiters - - - - - - - - - - - - - - - -
    KeyValue
    -opening - -“[” -
    -closing - -“]” -
    -
    -date_format - -“MM/dd/yyyy” -
    -date_separator - -“/” -
  • -
-

Non Triggering Examples

-
// notaTODO:
-
-
// notaFIXME:
-
-
// TODO: [12/31/9999]
-
-
// TODO(note)
-
-
// FIXME(note)
-
-
/* FIXME: */
-
-
/* TODO: */
-
-
/** FIXME: */
-
-
/** TODO: */
-
-

Triggering Examples

-
// TODO: [↓10/14/2019]
-
-
// FIXME: [↓10/14/2019]
-
-
// FIXME: [↓1/14/2019]
-
-
// FIXME: [↓10/14/2019]
-
-
// TODO: [↓9999/14/10]
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_acl.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_acl.html deleted file mode 100644 index 706d4c8f8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_acl.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - explicit_acl Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit ACL

- -

All declarations should specify Access Control Level keywords explicitly

- -
    -
  • Identifier: explicit_acl
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
internal enum A {}
-
-
public final class B {}
-
-
private struct C {}
-
-
internal enum A { internal enum B {} }
-
-
internal final class Foo {}
-
-
internal
-class Foo {
-  private let bar = 5
-}
-
-
internal func a() { let a =  }
-
-
private func a() { func innerFunction() { } }
-
-
private enum Foo { enum Bar { } }
-
-
private struct C { let d = 5 }
-
-
internal protocol A {
-  func b()
-}
-
-
internal protocol A {
-  var b: Int
-}
-
-
internal class A { deinit {} }
-
-
extension A: Equatable {}
-
-
extension A {}
-
-
extension Foo {
-    internal func bar() {}
-}
-
-
internal enum Foo {
-    case bar
-}
-
-
extension Foo {
-    public var isValid: Bool {
-        let result = true
-        return result
-    }
-}
-
-
extension Foo {
-    private var isValid: Bool {
-        get {
-            return true
-        }
-        set(newValue) {
-            print(newValue)
-        }
-    }
-}
-
-
private extension Foo {
-    var isValid: Bool { true }
-    struct S {
-        let b = 2
-    }
-}
-
-

Triggering Examples

-
↓enum A {}
-
-
final ↓class B {}
-
-
internal struct C { ↓let d = 5 }
-
-
public struct C { private(set) ↓var d = 5 }
-
-
internal struct C { static ↓let d = 5 }
-
-
public struct C { ↓let d = 5 }
-
-
public struct C { ↓init() }
-
-
static ↓func a() {}
-
-
internal let a = 0
-↓func b() {}
-
-
extension Foo {
-    ↓func bar() {}
-    static ↓func baz() {}
-}
-
-
public extension E {
-    let a = 1
-    struct S {
-        ↓let b = 2
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_enum_raw_value.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_enum_raw_value.html deleted file mode 100644 index 1d1c50df2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_enum_raw_value.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - explicit_enum_raw_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Enum Raw Value

- -

Enums should be explicitly assigned their raw values

- -
    -
  • Identifier: explicit_enum_raw_value
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers {
-  case int(Int)
-  case short(Int16)
-}
-
-
enum Numbers: Int {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: Double {
-  case one = 1.1
-  case two = 2.2
-}
-
-
enum Numbers: String {
-  case one = "one"
-  case two = "two"
-}
-
-
protocol Algebra {}
-enum Numbers: Algebra {
-  case one
-}
-
-

Triggering Examples

-
enum Numbers: Int {
-  case one = 10, ↓two, three = 30
-}
-
-
enum Numbers: NSInteger {
-  case ↓one
-}
-
-
enum Numbers: String {
-  case ↓one
-  case ↓two
-}
-
-
enum Numbers: String {
-   case ↓one, two = "two"
-}
-
-
enum Numbers: Decimal {
-  case ↓one, ↓two
-}
-
-
enum Outer {
-    enum Numbers: Decimal {
-      case ↓one, ↓two
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_init.html deleted file mode 100644 index 209ae880c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_init.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - explicit_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Init

- -

Explicitly calling .init() should be avoided

- -
    -
  • Identifier: explicit_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -include_bare_init - -false -
  • -
-

Non Triggering Examples

-
import Foundation
-class C: NSObject {
-    override init() {
-        super.init()
-    }
-}
-
-
struct S {
-    let n: Int
-}
-extension S {
-    init() {
-        self.init(n: 1)
-    }
-}
-
-
[1].flatMap(String.init)
-
-
[String.self].map { $0.init(1) }
-
-
[String.self].map { type in type.init(1) }
-
-
Observable.zip(obs1, obs2, resultSelector: MyType.init).asMaybe()
-
-
_ = GleanMetrics.Tabs.someType.init()
-
-
Observable.zip(
-  obs1,
-  obs2,
-  resultSelector: MyType.init
-).asMaybe()
-
-

Triggering Examples

-
[1].flatMap{String↓.init($0)}
-
-
[String.self].map { Type in Type↓.init(1) }
-
-
func foo() -> [String] {
-    return [1].flatMap { String↓.init($0) }
-}
-
-
_ = GleanMetrics.Tabs.GroupedTabExtra↓.init()
-
-
_ = Set<KsApi.Category>↓.init()
-
-
Observable.zip(
-  obs1,
-  obs2,
-  resultSelector: { MyType↓.init($0, $1) }
-).asMaybe()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_self.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_self.html deleted file mode 100644 index ae7ba6e60..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_self.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - explicit_self Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Self

- -

Instance variables and functions should be explicitly accessed with ‘self.’

- -
    -
  • Identifier: explicit_self
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct A {
-    func f1() {}
-    func f2() {
-        self.f1()
-    }
-}
-
-
struct A {
-    let p1: Int
-    func f1() {
-        _ = self.p1
-    }
-}
-
-
@propertyWrapper
-struct Wrapper<Value> {
-    let wrappedValue: Value
-    var projectedValue: [Value] {
-        [self.wrappedValue]
-    }
-}
-struct A {
-    @Wrapper var p1: Int
-    func f1() {
-        self.$p1
-        self._p1
-    }
-}
-func f1() {
-    A(p1: 10).$p1
-}
-
-

Triggering Examples

-
struct A {
-    func f1() {}
-    func f2() {
-        ↓f1()
-    }
-}
-
-
struct A {
-    let p1: Int
-    func f1() {
-        _ = ↓p1
-    }
-}
-
-
struct A {
-    func f1(a b: Int) {}
-    func f2() {
-        ↓f1(a: 0)
-    }
-}
-
-
@propertyWrapper
-struct Wrapper<Value> {
-    let wrappedValue: Value
-    var projectedValue: [Value] {
-        [self.wrappedValue]
-    }
-}
-struct A {
-    @Wrapper var p1: Int
-    func f1() {
-        ↓$p1
-        ↓_p1
-    }
-}
-func f1() {
-    A(p1: 10).$p1
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_top_level_acl.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_top_level_acl.html deleted file mode 100644 index 24075b336..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_top_level_acl.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - explicit_top_level_acl Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Top Level ACL

- -

Top-level declarations should specify Access Control Level keywords explicitly

- -
    -
  • Identifier: explicit_top_level_acl
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
internal enum A {}
-
-
public final class B {}
-
-
private struct C {}
-
-
internal enum A { enum B {} }
-
-
internal final class Foo {}
-
-
internal
-class Foo {}
-
-
internal func a() {}
-
-
extension A: Equatable {}
-
-
extension A {}
-
-

Triggering Examples

-
↓enum A {}
-
-
final ↓class B {}
-
-
↓struct C {}
-
-
↓func a() {}
-
-
internal let a = 0
-↓func b() {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_type_interface.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_type_interface.html deleted file mode 100644 index 0edb5fcbd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/explicit_type_interface.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - explicit_type_interface Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Type Interface

- -

Properties should have a type interface

- -
    -
  • Identifier: explicit_type_interface
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -allow_redundancy - -false -
  • -
-

Non Triggering Examples

-
class Foo {
-  var myVar: Int? = 0
-}
-
-
class Foo {
-  let myVar: Int? = 0, s: String = ""
-}
-
-
class Foo {
-  static var myVar: Int? = 0
-}
-
-
class Foo {
-  class var myVar: Int? = 0
-}
-
-

Triggering Examples

-
class Foo {
-  var ↓myVar = 0
-}
-
-
class Foo {
-  let ↓mylet = 0
-}
-
-
class Foo {
-  static var ↓myStaticVar = 0
-}
-
-
class Foo {
-  class var ↓myClassVar = 0
-}
-
-
class Foo {
-  let ↓myVar = Int(0), ↓s = ""
-}
-
-
class Foo {
-  let ↓myVar = Set<Int>(0)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/extension_access_modifier.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/extension_access_modifier.html deleted file mode 100644 index 94a1bad6e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/extension_access_modifier.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - extension_access_modifier Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Extension Access Modifier

- -

Prefer to use extension access modifiers

- -
    -
  • Identifier: extension_access_modifier
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension Foo: SomeProtocol {
-  public var bar: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  public var baz: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  public func baz() {}
-}
-
-
extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
extension Foo {
-  var bar: Int { return 1 }
-  internal var baz: Int { return 1 }
-}
-
-
internal extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  var bar: Int { return 1 }
-  internal var baz: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  private var baz: Int { return 1 }
-}
-
-
extension Foo {
-  open var bar: Int { return 1 }
-  open var baz: Int { return 1 }
-}
-
-
extension Foo {
-    func setup() {}
-    public func update() {}
-}
-
-
private extension Foo {
-  private var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
extension Foo {
-  internal private(set) var bar: Int {
-    get { Foo.shared.bar }
-    set { Foo.shared.bar = newValue }
-  }
-}
-
-
extension Foo {
-  private(set) internal var bar: Int {
-    get { Foo.shared.bar }
-    set { Foo.shared.bar = newValue }
-  }
-}
-
-

Triggering Examples

-
↓extension Foo {
-   public var bar: Int { return 1 }
-   public var baz: Int { return 1 }
-}
-
-
↓extension Foo {
-   public var bar: Int { return 1 }
-   public func baz() {}
-}
-
-
public extension Foo {
-  ↓public func bar() {}
-  ↓public func baz() {}
-}
-
-
↓extension Foo {
-   public var bar: Int {
-      let value = 1
-      return value
-   }
-
-   public var baz: Int { return 1 }
-}
-
-
↓extension Array where Element: Equatable {
-    public var unique: [Element] {
-        var uniqueValues = [Element]()
-        for item in self where !uniqueValues.contains(item) {
-            uniqueValues.append(item)
-        }
-        return uniqueValues
-    }
-}
-
-
↓extension Foo {
-   #if DEBUG
-   public var bar: Int {
-      let value = 1
-      return value
-   }
-   #endif
-
-   public var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  ↓private func bar() {}
-  ↓private func baz() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fallthrough.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fallthrough.html deleted file mode 100644 index a600f842f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fallthrough.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - fallthrough Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Fallthrough

- -

Fallthrough should be avoided

- -
    -
  • Identifier: fallthrough
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar, .bar2, .bar3:
-  something()
-}
-
-

Triggering Examples

-
switch foo {
-case .bar:
-  ↓fallthrough
-case .bar2:
-  something()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fatal_error_message.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fatal_error_message.html deleted file mode 100644 index 12500249b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/fatal_error_message.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - fatal_error_message Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Fatal Error Message

- -

A fatalError call should have a message

- -
    -
  • Identifier: fatal_error_message
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-  fatalError("Foo")
-}
-
-
func foo() {
-  fatalError(x)
-}
-
-

Triggering Examples

-
func foo() {
-  ↓fatalError("")
-}
-
-
func foo() {
-  ↓fatalError()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_header.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_header.html deleted file mode 100644 index 5017dc6ef..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_header.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - file_header Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Header

- -

Header comments should be consistent with project patterns. The SWIFTLINT_CURRENT_FILENAME placeholder can optionally be used in the required and forbidden patterns. It will be replaced by the real file name.

- -
    -
  • Identifier: file_header
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = "Copyright"
-
-
let foo = 2 // Copyright
-
-
let foo = 2
- // Copyright
-
-

Triggering Examples

-
// ↓Copyright
-
-
//
-// ↓Copyright
-
-
//
-//  FileHeaderRule.swift
-//  SwiftLint
-//
-//  Created by Marcelo Fabri on 27/11/16.
-//  ↓Copyright © 2016 Realm. All rights reserved.
-//
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_length.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_length.html deleted file mode 100644 index 87bf20e55..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_length.html +++ /dev/null @@ -1,2017 +0,0 @@ - - - - file_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Length

- -

Files should not span too many lines.

- -
    -
  • Identifier: file_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -400 -
    -error - -1000 -
    -ignore_comment_only_lines - -false -
  • -
-

Non Triggering Examples

-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-
-
-

Triggering Examples

-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-
-
-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-//
-
-
-
print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name.html deleted file mode 100644 index b5aa3d9e4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - file_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Name

- -

File name should match a type or extension declared in the file (if any)

- -
    -
  • Identifier: file_name
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[“LinuxMain.swift”, “main.swift”] -
    -prefix_pattern - -“” -
    -suffix_pattern - -“+.*” -
    -nested_type_separator - -“.” -
  • -
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name_no_space.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name_no_space.html deleted file mode 100644 index a67f662e2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_name_no_space.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - file_name_no_space Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Name no Space

- -

File name should not contain any whitespace

- -
    -
  • Identifier: file_name_no_space
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
  • -
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_types_order.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_types_order.html deleted file mode 100644 index 55c8ca5f8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/file_types_order.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - file_types_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Types Order

- -

Specifies how the types within a file should be ordered.

- -
    -
  • Identifier: file_types_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -[[supporting_type], [main_type], [extension], [preview_provider], [library_content_provider]] -
  • -
-

Non Triggering Examples

-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-// Main Type
-class TestViewController: UIViewController {
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-
-    struct TestStruct {
-        // 3 lines
-    }
-
-    enum TestEnum {
-        // 5 lines
-    }
-
-    // Stored Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-
-    // Stored Instance Properties
-    var shouldLayoutView1: Bool!
-    weak var delegate: TestViewControllerDelegate?
-    private var hasLayoutedView1: Bool = false
-    private var hasLayoutedView2: Bool = false
-
-    // Computed Instance Properties
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-
-    // Initializers
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-
-    // Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-    }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    @objc
-    func goToRandomVcButtonPressed() {
-        goToRandomVc()
-    }
-
-    // MARK: Other Methods
-    func goToNextVc() { /* TODO */ }
-
-    func goToInfoVc() { /* TODO */ }
-
-    func goToRandomVc() {
-        let viewCtrl = getRandomVc()
-        present(viewCtrl, animated: true)
-    }
-
-    private func getRandomVc() -> UIViewController { return UIViewController() }
-
-    // Subscripts
-    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-}
-
-// Extensions
-extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-
// Only extensions
-extension Foo {}
-extension Bar {
-}
-
-
// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
-// Preview Provider
-struct ContentView_Previews: PreviewProvider {
-    static var previews: some View { ContentView() }
-}
-
-// Library Content Provider
-struct ContentView_LibraryContent: LibraryContentProvider {
-    var views: [LibraryItem] {
-        LibraryItem(ContentView())
-    }
-}
-
-

Triggering Examples

-
↓class TestViewController: UIViewController {}
-
-// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-
// Extensions
-↓extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-class TestViewController: UIViewController {}
-
-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-↓class TestViewController: UIViewController {}
-
-// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-// Extensions
-↓extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-class TestViewController: UIViewController {}
-
-// Extensions
-extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-
// Preview Provider
-↓struct ContentView_Previews: PreviewProvider {
-    static var previews: some View { ContentView() }
-}
-
-// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
-
// Library Content Provider
-↓struct ContentView_LibraryContent: LibraryContentProvider {
-    var views: [LibraryItem] {
-        LibraryItem(ContentView())
-    }
-}
-
-// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/final_test_case.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/final_test_case.html deleted file mode 100644 index f012e4396..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/final_test_case.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - final_test_case Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Final Test Case

- -

Test cases should be final

- -
    -
  • Identifier: final_test_case
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
final class Test: XCTestCase {}
-
-
open class Test: XCTestCase {}
-
-
public final class Test: QuickSpec {}
-
-
class Test: MyTestCase {}
-
-
struct Test: MyTestCase {}
-
-

Triggering Examples

-
class ↓Test: XCTestCase {}
-
-
public class ↓Test: QuickSpec {}
-
-
class ↓Test: MyTestCase {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/first_where.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/first_where.html deleted file mode 100644 index 636a2dfc1..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/first_where.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - first_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

First Where

- -

Prefer using .first(where:) over .filter { }.first in collections

- -
    -
  • Identifier: first_where
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
kinds.filter(excludingKinds.contains).isEmpty && kinds.first == .identifier
-
-
myList.first(where: { $0 % 2 == 0 })
-
-
match(pattern: pattern).filter { $0.first == .identifier }
-
-
(myList.filter { $0 == 1 }.suffix(2)).first
-
-
collection.filter("stringCol = '3'").first
-
-
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first
-
-
if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) }
-
-

Triggering Examples

-
↓myList.filter { $0 % 2 == 0 }.first
-
-
↓myList.filter({ $0 % 2 == 0 }).first
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first?.something()
-
-
↓myList.filter(someFunction).first
-
-
↓myList.filter({ $0 % 2 == 0 })
-.first
-
-
(↓myList.filter { $0 == 1 }).first
-
-
↓myListOfDict.filter { dict in dict["1"] }.first
-
-
↓myListOfDict.filter { $0["someString"] }.first
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html deleted file mode 100644 index 3ef3ffd48..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - flatmap_over_map_reduce Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Flat Map over Map Reduce

- -

Prefer flatMap over map followed by reduce([], +)

- -
    -
  • Identifier: flatmap_over_map_reduce
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = bar.map { $0.count }.reduce(0, +)
-
-
let foo = bar.flatMap { $0.array }
-
-

Triggering Examples

-
let foo = ↓bar.map { $0.array }.reduce([], +)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/for_where.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/for_where.html deleted file mode 100644 index 9d476a34f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/for_where.html +++ /dev/null @@ -1,475 +0,0 @@ - - - - for_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer For-Where

- -

where clauses are preferred over a single if inside a for

- -
    -
  • Identifier: for_where
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_for_as_filter - -false -
  • -
-

Non Triggering Examples

-
for user in users where user.id == 1 { }
-
-
for user in users {
-  if let id = user.id { }
-}
-
-
for user in users {
-  if var id = user.id { }
-}
-
-
for user in users {
-  if user.id == 1 { } else { }
-}
-
-
for user in users {
-  if user.id == 1 {
-  } else if user.id == 2 { }
-}
-
-
for user in users {
-  if user.id == 1 { }
-  print(user)
-}
-
-
for user in users {
-  let id = user.id
-  if id == 1 { }
-}
-
-
for user in users {
-  if user.id == 1 { }
-  return true
-}
-
-
for user in users {
-  if user.id == 1 && user.age > 18 { }
-}
-
-
for user in users {
-  if user.id == 1, user.age > 18 { }
-}
-
-
for (index, value) in array.enumerated() {
-  if case .valueB(_) = value {
-    return index
-  }
-}
-
-
for user in users {
-  if user.id == 1 { return true }
-}
-
-
for user in users {
-  if user.id == 1 {
-    let derivedValue = calculateValue(from: user)
-    return derivedValue != 0
-  }
-}
-
-

Triggering Examples

-
for user in users {
-  ↓if user.id == 1 { return true }
-}
-
-
for subview in subviews {
-    ↓if !(subview is UIStackView) {
-        subview.removeConstraints(subview.constraints)
-        subview.removeFromSuperview()
-    }
-}
-
-
for subview in subviews {
-    ↓if !(subview is UIStackView) {
-        subview.removeConstraints(subview.constraints)
-        subview.removeFromSuperview()
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_cast.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_cast.html deleted file mode 100644 index 57e65b943..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_cast.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - force_cast Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Cast

- -

Force casts should be avoided

- -
    -
  • Identifier: force_cast
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
NSNumber() as? Int
-
-

Triggering Examples

-
NSNumber() ↓as! Int
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_try.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_try.html deleted file mode 100644 index 042b3949a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_try.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - force_try Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Try

- -

Force tries should be avoided

- -
    -
  • Identifier: force_try
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
func a() throws {}
-do {
-  try a()
-} catch {}
-
-

Triggering Examples

-
func a() throws {}
-↓try! a()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_unwrapping.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_unwrapping.html deleted file mode 100644 index 18b52a46c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/force_unwrapping.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - force_unwrapping Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Unwrapping

- -

Force unwrapping should be avoided

- -
    -
  • Identifier: force_unwrapping
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if let url = NSURL(string: query)
-
-
navigationController?.pushViewController(viewController, animated: true)
-
-
let s as! Test
-
-
try! canThrowErrors()
-
-
let object: Any!
-
-
@IBOutlet var constraints: [NSLayoutConstraint]!
-
-
setEditing(!editing, animated: true)
-
-
navigationController.setNavigationBarHidden(!navigationController.navigationBarHidden, animated: true)
-
-
if addedToPlaylist && (!self.selectedFilters.isEmpty || self.searchBar?.text?.isEmpty == false) {}
-
-
print("\(xVar)!")
-
-
var test = (!bar)
-
-
var a: [Int]!
-
-
private var myProperty: (Void -> Void)!
-
-
func foo(_ options: [AnyHashable: Any]!) {
-
-
func foo() -> [Int]!
-
-
func foo() -> [AnyHashable: Any]!
-
-
func foo() -> [Int]! { return [] }
-
-
return self
-
-

Triggering Examples

-
let url = NSURL(string: query)↓!
-
-
navigationController↓!.pushViewController(viewController, animated: true)
-
-
let unwrapped = optional↓!
-
-
return cell↓!
-
-
let url = NSURL(string: "http://www.google.com")↓!
-
-
let dict = ["Boooo": "👻"]
-func bla() -> String {
-    return dict["Boooo"]↓!
-}
-
-
let dict = ["Boooo": "👻"]
-func bla() -> String {
-    return dict["Boooo"]↓!.contains("B")
-}
-
-
let a = dict["abc"]↓!.contains("B")
-
-
dict["abc"]↓!.bar("B")
-
-
if dict["a"]↓!↓!↓!↓! {}
-
-
var foo: [Bool]! = dict["abc"]↓!
-
-
realm.objects(SwiftUTF8Object.self).filter("%K == %@", "柱нǢкƱаم👍", utf8TestString).first↓!
-
-
context("abc") {
-  var foo: [Bool]! = dict["abc"]↓!
-}
-
-
open var computed: String { return foo.bar↓! }
-
-
return self↓!
-
-
[1, 3, 5, 6].first { $0.isMultiple(of: 2) }↓!
-
-
map["a"]↓!↓!
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_body_length.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_body_length.html deleted file mode 100644 index 3811b8404..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_body_length.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - function_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Body Length

- -

Function bodies should not span too many lines

- -
    -
  • Identifier: function_body_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -50 -
    -error - -100 -
  • -
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_default_parameter_at_end.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_default_parameter_at_end.html deleted file mode 100644 index be946c809..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_default_parameter_at_end.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - function_default_parameter_at_end Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Default Parameter at End

- -

Prefer to locate parameters with defaults toward the end of the parameter list

- -
    -
  • Identifier: function_default_parameter_at_end
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo(baz: String, bar: Int = 0) {}
-
-
func foo(x: String, y: Int = 0, z: CGFloat = 0) {}
-
-
func foo(bar: String, baz: Int = 0, z: () -> Void) {}
-
-
func foo(bar: String, z: () -> Void, baz: Int = 0) {}
-
-
func foo(bar: Int = 0) {}
-
-
func foo() {}
-
-
class A: B {
-  override func foo(bar: Int = 0, baz: String) {}
-
-
func foo(bar: Int = 0, completion: @escaping CompletionHandler) {}
-
-
func foo(a: Int, b: CGFloat = 0) {
-  let block = { (error: Error?) in }
-}
-
-
func foo(a: String, b: String? = nil,
-         c: String? = nil, d: @escaping AlertActionHandler = { _ in }) {}
-
-
override init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
-
-
func handleNotification(_ userInfo: NSDictionary,
-                        userInteraction: Bool = false,
-                        completionHandler: ((UIBackgroundFetchResult) -> Void)?) {}
-
-
func write(withoutNotifying tokens: [NotificationToken] =  {}, _ block: (() throws -> Int)) {}
-
-

Triggering Examples

-
↓func foo(bar: Int = 0, baz: String) {}
-
-
private ↓func foo(bar: Int = 0, baz: String) {}
-
-
public ↓init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_parameter_count.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_parameter_count.html deleted file mode 100644 index 363ad2c03..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/function_parameter_count.html +++ /dev/null @@ -1,437 +0,0 @@ - - - - function_parameter_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Parameter Count

- -

Number of function parameters should be low.

- -
    -
  • Identifier: function_parameter_count
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -5 -
    -error - -8 -
    -ignores_default_parameters - -true -
  • -
-

Non Triggering Examples

-
init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init (a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
`init`(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?<T>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?<T: String>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
func f2(p1: Int, p2: Int) { }
-
-
func f(a: Int, b: Int, c: Int, d: Int, x: Int = 42) {}
-
-
func f(a: [Int], b: Int, c: Int, d: Int, f: Int) -> [Int] {
-    let s = a.flatMap { $0 as? [String: Int] } ?? []}}
-
-
override func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-

Triggering Examples

-
↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
↓func initialValue(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
private ↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int = 2, g: Int) {}
-
-
struct Foo {
-    init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-    ↓func bar(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/generic_type_name.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/generic_type_name.html deleted file mode 100644 index bec7a2756..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/generic_type_name.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - generic_type_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Generic Type Name

- -

Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length.

- -
    -
  • Identifier: generic_type_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -1 -
    -error - -0 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -20 -
    -error - -1000 -
    -
    -excluded - -[] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
  • -
-

Non Triggering Examples

-
func foo<T>() {}
-
-
func foo<T>() -> T {}
-
-
func foo<T, U>(param: U) -> T {}
-
-
func foo<T: Hashable, U: Rule>(param: U) -> T {}
-
-
struct Foo<T> {}
-
-
class Foo<T> {}
-
-
enum Foo<T> {}
-
-
func run(_ options: NoOptions<CommandantError<()>>) {}
-
-
func foo(_ options: Set<type>) {}
-
-
func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool
-
-
func configureWith(data: Either<MessageThread, (project: Project, backing: Backing)>)
-
-
typealias StringDictionary<T> = Dictionary<String, T>
-
-
typealias BackwardTriple<T1, T2, T3> = (T3, T2, T1)
-
-
typealias DictionaryOfStrings<T : Hashable> = Dictionary<T, String>
-
-

Triggering Examples

-
func foo<↓T_Foo>() {}
-
-
func foo<T, ↓U_Foo>(param: U_Foo) -> T {}
-
-
func foo<↓TTTTTTTTTTTTTTTTTTTTT>() {}
-
-
func foo<↓type>() {}
-
-
typealias StringDictionary<↓T_Foo> = Dictionary<String, T_Foo>
-
-
typealias BackwardTriple<T1, ↓T2_Bar, T3> = (T3, T2_Bar, T1)
-
-
typealias DictionaryOfStrings<↓T_Foo: Hashable> = Dictionary<T_Foo, String>
-
-
class Foo<↓T_Foo> {}
-
-
class Foo<T, ↓U_Foo> {}
-
-
class Foo<↓T_Foo, ↓U_Foo> {}
-
-
class Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
class Foo<↓type> {}
-
-
struct Foo<↓T_Foo> {}
-
-
struct Foo<T, ↓U_Foo> {}
-
-
struct Foo<↓T_Foo, ↓U_Foo> {}
-
-
struct Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
struct Foo<↓type> {}
-
-
enum Foo<↓T_Foo> {}
-
-
enum Foo<T, ↓U_Foo> {}
-
-
enum Foo<↓T_Foo, ↓U_Foo> {}
-
-
enum Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
enum Foo<↓type> {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ibinspectable_in_extension.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ibinspectable_in_extension.html deleted file mode 100644 index 60322b25c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ibinspectable_in_extension.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - ibinspectable_in_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

IBInspectable in Extension

- -

Extensions shouldn’t add @IBInspectable properties

- -
    -
  • Identifier: ibinspectable_in_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  @IBInspectable private var x: Int
-}
-
-

Triggering Examples

-
extension Foo {
-  ↓@IBInspectable private var x: Int
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identical_operands.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identical_operands.html deleted file mode 100644 index 593d97b9d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identical_operands.html +++ /dev/null @@ -1,876 +0,0 @@ - - - - identical_operands Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Identical Operands

- -

Comparing two identical operands is likely a mistake

- -
    -
  • Identifier: identical_operands
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
1 == 2
-
-
foo == bar
-
-
prefixedFoo == foo
-
-
foo.aProperty == foo.anotherProperty
-
-
self.aProperty == self.anotherProperty
-
-
"1 == 1"
-
-
self.aProperty == aProperty
-
-
lhs.aProperty == rhs.aProperty
-
-
lhs.identifier == rhs.identifier
-
-
i == index
-
-
$0 == 0
-
-
keyValues?.count ?? 0 == 0
-
-
string == string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num == num?.byteSwapped
-
-
num == num!.byteSwapped
-
-
1    + 1 ==   1     +    2
-
-
f(  i :   2) ==   f (i: 3 )
-
-
1 != 2
-
-
foo != bar
-
-
prefixedFoo != foo
-
-
foo.aProperty != foo.anotherProperty
-
-
self.aProperty != self.anotherProperty
-
-
"1 != 1"
-
-
self.aProperty != aProperty
-
-
lhs.aProperty != rhs.aProperty
-
-
lhs.identifier != rhs.identifier
-
-
i != index
-
-
$0 != 0
-
-
keyValues?.count ?? 0 != 0
-
-
string != string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num != num?.byteSwapped
-
-
num != num!.byteSwapped
-
-
1    + 1 !=   1     +    2
-
-
f(  i :   2) !=   f (i: 3 )
-
-
1 === 2
-
-
foo === bar
-
-
prefixedFoo === foo
-
-
foo.aProperty === foo.anotherProperty
-
-
self.aProperty === self.anotherProperty
-
-
"1 === 1"
-
-
self.aProperty === aProperty
-
-
lhs.aProperty === rhs.aProperty
-
-
lhs.identifier === rhs.identifier
-
-
i === index
-
-
$0 === 0
-
-
keyValues?.count ?? 0 === 0
-
-
string === string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num === num?.byteSwapped
-
-
num === num!.byteSwapped
-
-
1    + 1 ===   1     +    2
-
-
f(  i :   2) ===   f (i: 3 )
-
-
1 !== 2
-
-
foo !== bar
-
-
prefixedFoo !== foo
-
-
foo.aProperty !== foo.anotherProperty
-
-
self.aProperty !== self.anotherProperty
-
-
"1 !== 1"
-
-
self.aProperty !== aProperty
-
-
lhs.aProperty !== rhs.aProperty
-
-
lhs.identifier !== rhs.identifier
-
-
i !== index
-
-
$0 !== 0
-
-
keyValues?.count ?? 0 !== 0
-
-
string !== string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num !== num?.byteSwapped
-
-
num !== num!.byteSwapped
-
-
1    + 1 !==   1     +    2
-
-
f(  i :   2) !==   f (i: 3 )
-
-
1 > 2
-
-
foo > bar
-
-
prefixedFoo > foo
-
-
foo.aProperty > foo.anotherProperty
-
-
self.aProperty > self.anotherProperty
-
-
"1 > 1"
-
-
self.aProperty > aProperty
-
-
lhs.aProperty > rhs.aProperty
-
-
lhs.identifier > rhs.identifier
-
-
i > index
-
-
$0 > 0
-
-
keyValues?.count ?? 0 > 0
-
-
string > string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num > num?.byteSwapped
-
-
num > num!.byteSwapped
-
-
1    + 1 >   1     +    2
-
-
f(  i :   2) >   f (i: 3 )
-
-
1 >= 2
-
-
foo >= bar
-
-
prefixedFoo >= foo
-
-
foo.aProperty >= foo.anotherProperty
-
-
self.aProperty >= self.anotherProperty
-
-
"1 >= 1"
-
-
self.aProperty >= aProperty
-
-
lhs.aProperty >= rhs.aProperty
-
-
lhs.identifier >= rhs.identifier
-
-
i >= index
-
-
$0 >= 0
-
-
keyValues?.count ?? 0 >= 0
-
-
string >= string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num >= num?.byteSwapped
-
-
num >= num!.byteSwapped
-
-
1    + 1 >=   1     +    2
-
-
f(  i :   2) >=   f (i: 3 )
-
-
1 < 2
-
-
foo < bar
-
-
prefixedFoo < foo
-
-
foo.aProperty < foo.anotherProperty
-
-
self.aProperty < self.anotherProperty
-
-
"1 < 1"
-
-
self.aProperty < aProperty
-
-
lhs.aProperty < rhs.aProperty
-
-
lhs.identifier < rhs.identifier
-
-
i < index
-
-
$0 < 0
-
-
keyValues?.count ?? 0 < 0
-
-
string < string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num < num?.byteSwapped
-
-
num < num!.byteSwapped
-
-
1    + 1 <   1     +    2
-
-
f(  i :   2) <   f (i: 3 )
-
-
1 <= 2
-
-
foo <= bar
-
-
prefixedFoo <= foo
-
-
foo.aProperty <= foo.anotherProperty
-
-
self.aProperty <= self.anotherProperty
-
-
"1 <= 1"
-
-
self.aProperty <= aProperty
-
-
lhs.aProperty <= rhs.aProperty
-
-
lhs.identifier <= rhs.identifier
-
-
i <= index
-
-
$0 <= 0
-
-
keyValues?.count ?? 0 <= 0
-
-
string <= string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num <= num?.byteSwapped
-
-
num <= num!.byteSwapped
-
-
1    + 1 <=   1     +    2
-
-
f(  i :   2) <=   f (i: 3 )
-
-
func evaluate(_ mode: CommandMode) -> Result<Options, CommandantError<CommandantError<()>>>
-
-
let array = Array<Array<Int>>()
-
-
guard Set(identifiers).count != identifiers.count else { return }
-
-
expect("foo") == "foo"
-
-
type(of: model).cachePrefix == cachePrefix
-
-
histogram[156].0 == 0x003B8D96 && histogram[156].1 == 1
-
-
[Wrapper(type: .three), Wrapper(type: .one)].sorted { "\($0.type)" > "\($1.type)"}
-
-
array.sorted { "\($0)" < "\($1)" }
-
-

Triggering Examples

-
↓1 == 1
-
-
↓foo == foo
-
-
↓foo.aProperty == foo.aProperty
-
-
↓self.aProperty == self.aProperty
-
-
↓$0 == $0
-
-
↓a?.b == a?.b
-
-
if (↓elem == elem) {}
-
-
XCTAssertTrue(↓s3 == s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView == tab.webView
-
-
↓1    + 1 ==   1     +    1
-
-
 ↓f(  i :   2) ==   f (i: 
- 2 )
-
-
↓1 != 1
-
-
↓foo != foo
-
-
↓foo.aProperty != foo.aProperty
-
-
↓self.aProperty != self.aProperty
-
-
↓$0 != $0
-
-
↓a?.b != a?.b
-
-
if (↓elem != elem) {}
-
-
XCTAssertTrue(↓s3 != s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView != tab.webView
-
-
↓1    + 1 !=   1     +    1
-
-
 ↓f(  i :   2) !=   f (i: 
- 2 )
-
-
↓1 === 1
-
-
↓foo === foo
-
-
↓foo.aProperty === foo.aProperty
-
-
↓self.aProperty === self.aProperty
-
-
↓$0 === $0
-
-
↓a?.b === a?.b
-
-
if (↓elem === elem) {}
-
-
XCTAssertTrue(↓s3 === s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView === tab.webView
-
-
↓1    + 1 ===   1     +    1
-
-
 ↓f(  i :   2) ===   f (i: 
- 2 )
-
-
↓1 !== 1
-
-
↓foo !== foo
-
-
↓foo.aProperty !== foo.aProperty
-
-
↓self.aProperty !== self.aProperty
-
-
↓$0 !== $0
-
-
↓a?.b !== a?.b
-
-
if (↓elem !== elem) {}
-
-
XCTAssertTrue(↓s3 !== s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView !== tab.webView
-
-
↓1    + 1 !==   1     +    1
-
-
 ↓f(  i :   2) !==   f (i: 
- 2 )
-
-
↓1 > 1
-
-
↓foo > foo
-
-
↓foo.aProperty > foo.aProperty
-
-
↓self.aProperty > self.aProperty
-
-
↓$0 > $0
-
-
↓a?.b > a?.b
-
-
if (↓elem > elem) {}
-
-
XCTAssertTrue(↓s3 > s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView > tab.webView
-
-
↓1    + 1 >   1     +    1
-
-
 ↓f(  i :   2) >   f (i: 
- 2 )
-
-
↓1 >= 1
-
-
↓foo >= foo
-
-
↓foo.aProperty >= foo.aProperty
-
-
↓self.aProperty >= self.aProperty
-
-
↓$0 >= $0
-
-
↓a?.b >= a?.b
-
-
if (↓elem >= elem) {}
-
-
XCTAssertTrue(↓s3 >= s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView >= tab.webView
-
-
↓1    + 1 >=   1     +    1
-
-
 ↓f(  i :   2) >=   f (i: 
- 2 )
-
-
↓1 < 1
-
-
↓foo < foo
-
-
↓foo.aProperty < foo.aProperty
-
-
↓self.aProperty < self.aProperty
-
-
↓$0 < $0
-
-
↓a?.b < a?.b
-
-
if (↓elem < elem) {}
-
-
XCTAssertTrue(↓s3 < s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView < tab.webView
-
-
↓1    + 1 <   1     +    1
-
-
 ↓f(  i :   2) <   f (i: 
- 2 )
-
-
↓1 <= 1
-
-
↓foo <= foo
-
-
↓foo.aProperty <= foo.aProperty
-
-
↓self.aProperty <= self.aProperty
-
-
↓$0 <= $0
-
-
↓a?.b <= a?.b
-
-
if (↓elem <= elem) {}
-
-
XCTAssertTrue(↓s3 <= s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView <= tab.webView
-
-
↓1    + 1 <=   1     +    1
-
-
 ↓f(  i :   2) <=   f (i: 
- 2 )
-
-
    return ↓lhs.foo == lhs.foo &&
-           lhs.bar == rhs.bar
-
-
    return lhs.foo == rhs.foo &&
-           ↓lhs.bar == lhs.bar
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identifier_name.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identifier_name.html deleted file mode 100644 index fb27054fd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/identifier_name.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - identifier_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Identifier Name

- -

Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.

- -
    -
  • Identifier: identifier_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -3 -
    -error - -2 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -40 -
    -error - -60 -
    -
    -excluded - -[“^id$”] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
    -additional_operators - -[“!”, “%”, “&”, “*”, “+”, “-”, “.”, “/”, “<”, “=”, “>”, “?”, “^”, “|”, “~”] -
  • -
-

Non Triggering Examples

-
let myLet = 0
-
-
var myVar = 0
-
-
private let _myLet = 0
-
-
private func _myFunc() {}
-
-
fileprivate let _myLet = 0
-
-
fileprivate func _myFunc() {}
-
-
fileprivate func _myFunc() {}
-
-
class Abc { static let MyLet = 0 }
-
-
let URL: NSURL? = nil
-
-
let XMLString: String? = nil
-
-
override var i = 0
-
-
enum Foo { case myEnum }
-
-
func isOperator(name: String) -> Bool
-
-
func typeForKind(_ kind: SwiftDeclarationKind) -> String
-
-
func == (lhs: SyntaxToken, rhs: SyntaxToken) -> Bool
-
-
override func IsOperator(name: String) -> Bool
-
-
enum Foo { case `private` }
-
-
enum Foo { case value(String) }
-
-
f { $abc in }
-
-
class Foo {
-   static let Bar = 0
-}
-
-
class Foo {
-   static var Bar = 0
-}
-
-
func √ (arg: Double) -> Double { arg }
-
-

Triggering Examples

-
class C { static let ↓_myLet = 0 }
-
-
class C { class let ↓MyLet = 0 }
-
-
class C { static func ↓MyFunc() {} }
-
-
class C { class func ↓MyFunc() {} }
-
-
private let ↓myLet_ = 0
-
-
let ↓myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
-
-
var ↓myExtremelyVeryVeryVeryVeryVeryVeryLongVar = 0
-
-
private let ↓_myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
-
-
let ↓i = 0
-
-
var ↓aa = 0
-
-
private let ↓_i = 0
-
-
if let ↓_x {}
-
-
guard var ↓x = x else {}
-
-
func myFunc(
-    _ ↓s: String,
-    i ↓j: Int,
-    _ goodName: Double,
-    name ↓n: String,
-    ↓x: Int,
-    abc: Double,
-    _: Double,
-    last _: Double
-) {}
-
-
let (↓a, abc) = (1, 1)
-
-
if let ↓i {}
-
-
for ↓i in [] {}
-
-
f { ↓x in }
-
-
f { ↓$x in }
-
-
f { (x abc: Int, _ ↓x: Int) in }
-
-
enum E {
-    case ↓c
-    case case1(Int)
-    case case2(↓a: Int)
-    case case3(_ ↓a: Int)
-}
-
-
class C {
-    var ↓x: Int {
-        get { 1 }
-        set(↓y) { x = y }
-    }
-}
-
-
func ↓√ (arg: Double) -> Double { arg }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/carat.png b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/carat.png deleted file mode 100755 index 29d2f7fd4..000000000 Binary files a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/carat.png and /dev/null differ diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/dash.png b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/dash.png deleted file mode 100755 index 6f694c7a0..000000000 Binary files a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/dash.png and /dev/null differ diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/gh.png b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/gh.png deleted file mode 100755 index 628da97c7..000000000 Binary files a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/gh.png and /dev/null differ diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/spinner.gif b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/spinner.gif deleted file mode 100644 index e3038d0a4..000000000 Binary files a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/img/spinner.gif and /dev/null differ diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_getter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_getter.html deleted file mode 100644 index f46dbc2a9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_getter.html +++ /dev/null @@ -1,617 +0,0 @@ - - - - implicit_getter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicit Getter

- -

Computed read-only properties and subscripts should avoid using the get keyword.

- -
    -
  • Identifier: implicit_getter
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        get { _foo }
-        _modify { yield &_foo }
-    }
-}
-
-
class Foo {
-    var _foo: Int
-    var foo: Int {
-        @storageRestrictions(initializes: _foo)
-        init { _foo = newValue }
-        get { _foo }
-    }
-}
-
-
class Foo {
-    var foo: Int
-}
-
-
class Foo {
-    var foo: Int {
-        return getValueFromDisk()
-    }
-}
-
-
class Foo {
-    var foo: String {
-        return "get"
-    }
-}
-
-
protocol Foo {
-    var foo: Int { get }
-}
-
-
protocol Foo {
-    var foo: Int { get set }
-}
-
-
class Foo {
-    var foo: Int {
-        struct Bar {
-            var bar: Int {
-                get { return 1 }
-                set { _ = newValue }
-            }
-        }
-
-        return Bar().bar
-    }
-}
-
-
var _objCTaggedPointerBits: UInt {
-    @inline(__always) get { return 0 }
-}
-
-
var next: Int? {
-    mutating get {
-        defer { self.count += 1 }
-        return self.count
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set { self._bar = newValue }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set(newValue) { self._bar = newValue }
-    }
-}
-
-
extension Float {
-    var clamped: Float {
-        set {
-            self = min(1, max(0, newValue))
-        }
-        get {
-            min(1, max(0, self))
-        }
-    }
-}
-
-
extension Reactive where Base: UITapGestureRecognizer {
-    var tapped: CocoaAction<Base>? {
-        get {
-            return associatedAction.withValue { $0.flatMap { $0.action } }
-        }
-        nonmutating set {
-            setAction(newValue)
-        }
-    }
-}
-
-
extension Test {
-    var foo: Bool {
-        get {
-            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
-        }
-        set {
-            bar = NSNumber(value: newValue as Bool)
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        return 20
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get set }
-}
-
-
class DatabaseEntity {
-    var isSynced: Bool {
-        get async {
-            await database.isEntitySynced(self)
-        }
-    }
-}
-
-
struct Test {
-    subscript(value: Int) -> Int {
-        get throws {
-            if value == 0 {
-                throw NSError()
-            } else {
-                return value
-            }
-        }
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        ↓get{ return 20 }
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
var foo: Int {
-    ↓get { return 20 }
-}
-
-
class Foo {
-    @objc func bar() {}
-    var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        ↓get { _bar }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_return.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_return.html deleted file mode 100644 index 98e505cf0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicit_return.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - implicit_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicit Return

- -

Prefer implicit returns in closures, functions and getters

- -
    -
  • Identifier: implicit_return
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -included - -[closure, function, getter, initializer, subscript] -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.map({ $0 + 1 })
-
-
foo.map { value in value + 1 }
-
-
[1, 2].first(where: {
-    true
-})
-
-
func foo() -> Int {
-    0
-}
-
-
class Foo {
-    func foo() -> Int { 0 }
-}
-
-
func fetch() -> Data? {
-    do {
-        return try loadData()
-    } catch {
-        return nil
-    }
-}
-
-
func f() -> Int {
-    let i = 4
-    return i
-}
-
-
func f() -> Int {
-    return 3
-    let i = 2
-}
-
-
func f() -> Int {
-    return g()
-    func g() -> Int { 4 }
-}
-
-
var foo: Bool { true }
-
-
class Foo {
-    var bar: Int {
-        get {
-            0
-        }
-    }
-}
-
-
class Foo {
-    static var bar: Int {
-        0
-    }
-}
-
-
class C {
-    let i: Int
-    init(i: Int) {
-        if i < 3 {
-            self.i = 1
-            return
-        }
-        self.i = 2
-    }
-}
-
-
class C {
-    init?() {
-        let i = 1
-        return nil
-    }
-}
-
-
class C {
-    subscript(i: Int) -> Int {
-        let res = i
-        return res
-    }
-}
-
-

Triggering Examples

-
foo.map { value in
-    ↓return value + 1
-}
-
-
foo.map {
-    ↓return $0 + 1
-}
-
-
foo.map({ ↓return $0 + 1})
-
-
[1, 2].first(where: {
-    ↓return true
-})
-
-
func foo() -> Int {
-    ↓return 0
-}
-
-
class Foo {
-    func foo() -> Int { ↓return 0 }
-}
-
-
func f() { ↓return }
-
-
var foo: Bool { ↓return true }
-
-
class Foo {
-    var bar: Int {
-        get {
-            ↓return 0
-        }
-    }
-}
-
-
class Foo {
-    static var bar: Int {
-        ↓return 0
-    }
-}
-
-
class C {
-    init() {
-        ↓return
-    }
-}
-
-
class C {
-    init?() {
-        ↓return nil
-    }
-}
-
-
class C {
-    subscript(i: Int) -> Int {
-        ↓return i
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html deleted file mode 100644 index 4064d1c5b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - implicitly_unwrapped_optional Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicitly Unwrapped Optional

- -

Implicitly unwrapped optionals should be avoided when possible

- -
    -
  • Identifier: implicitly_unwrapped_optional
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -mode - -all_except_iboutlets -
  • -
-

Non Triggering Examples

-
@IBOutlet private var label: UILabel!
-
-
@IBOutlet var label: UILabel!
-
-
@IBOutlet var label: [UILabel!]
-
-
if !boolean {}
-
-
let int: Int? = 42
-
-
let int: Int? = nil
-
-

Triggering Examples

-
let label: ↓UILabel!
-
-
let IBOutlet: ↓UILabel!
-
-
let labels: [↓UILabel!]
-
-
var ints: [↓Int!] = [42, nil, 42]
-
-
let label: ↓IBOutlet!
-
-
let int: ↓Int! = 42
-
-
let int: ↓Int! = nil
-
-
var int: ↓Int! = 42
-
-
let collection: AnyCollection<↓Int!>
-
-
func foo(int: ↓Int!) {}
-
-
class MyClass {
-    weak var bar: ↓SomeObject!
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inclusive_language.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inclusive_language.html deleted file mode 100644 index fd84e124e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inclusive_language.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - inclusive_language Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Inclusive Language

- -

Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status.

- -
    -
  • Identifier: inclusive_language
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = "abc"
-
-
enum AllowList {
-    case foo, bar
-}
-
-
func updateAllowList(add: String) {}
-
-
enum WalletItemType {
-    case visa
-    case mastercard
-}
-
-
func chargeMasterCard(_ card: Card) {}
-
-

Triggering Examples

-
let ↓slave = "abc"
-
-
enum ↓BlackList {
-    case foo, bar
-}
-
-
func ↓updateWhiteList(add: String) {}
-
-
enum ListType {
-    case ↓whitelist
-    case ↓blacklist
-}
-
-
init(↓master: String, ↓slave: String) {}
-
-
final class FooBar {
-    func register<↓Master, ↓Slave>(one: Master, two: Slave) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/indentation_width.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/indentation_width.html deleted file mode 100644 index 20c8472f3..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/indentation_width.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - indentation_width Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Indentation Width

- -

Indent code using either one tab or the configured amount of spaces, unindent to match previous indentations. Don’t indent the first line.

- -
    -
  • Identifier: indentation_width
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -indentation_width - -4 -
    -include_comments - -true -
    -include_compiler_directives - -true -
    -include_multiline_strings - -true -
  • -
-

Non Triggering Examples

-
firstLine
-secondLine
-
-
firstLine
-    secondLine
-
-
firstLine
-    secondLine
-        thirdLine
-
-        fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-    //test
-        fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-fourthLine
-
-

Triggering Examples

-
↓    firstLine
-
-
firstLine
-        secondLine
-
-
firstLine
-    secondLine
-
-↓         fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-↓ fourthLine
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/index.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/index.html deleted file mode 100644 index 4d0c1c7b8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/index.html +++ /dev/null @@ -1,1149 +0,0 @@ - - - - SwiftLintCore Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

SwiftLint

- -

A tool to enforce Swift style and conventions, loosely based on the now archived GitHub Swift Style Guide. SwiftLint enforces the style guide rules that are generally accepted by the Swift community. These rules are well described in popular style guides like Kodeco’s Swift Style Guide.

- -

SwiftLint hooks into Clang and -SourceKit to use the -AST representation -of your source files for more accurate results.

- -

Build Status -codecov.io

- -

- -

This project adheres to the Contributor Covenant Code of Conduct. -By participating, you are expected to uphold this code. Please report -unacceptable behavior to info@realm.io.

- -
-

Language Switch: 中文, 한국어.

-
-

Installation

-

Using Swift Package Manager:

- -
-

Replace <version> with the desired minimum version.

-
-
.package(url: "https://github.com/realm/SwiftLint.git", from: "<version>")
-
- -

SwiftLint can be used as a command plugin or a build tool plugin.

-

Using Homebrew:

-
brew install swiftlint
-
-

Using CocoaPods:

- -

Simply add the following line to your Podfile:

-
pod 'SwiftLint'
-
- -

This will download the SwiftLint binaries and dependencies in Pods/ during your next -pod install execution and will allow you to invoke it via ${PODS_ROOT}/SwiftLint/swiftlint -in your Script Build Phases.

- -

This is the recommended way to install a specific version of SwiftLint since it supports -installing a pinned version rather than simply the latest (which is the case with Homebrew).

- -

Note that this will add the SwiftLint binaries, its dependencies’ binaries, and the Swift binary -library distribution to the Pods/ directory, so checking in this directory to SCM such as -git is discouraged.

-

Using Mint:

-
$ mint install realm/SwiftLint
-
-

Using a pre-built package:

- -

You can also install SwiftLint by downloading SwiftLint.pkg from the -latest GitHub release and -running it.

-

Installing from source:

- -

You can also build and install from source by cloning this project and running -make install (Xcode 15.0 or later).

-

Using Bazel

- -

Put this in your MODULE.bazel:

-
bazel_dep(name = "swiftlint", version = "0.52.4", repo_name = "SwiftLint")
-
- -

Or put this in your WORKSPACE:

- -
- -WORKSPACE - -“`bzl -load(”@bazel_tools//tools/build_defs/repo:http.bzl", “http_archive”) - -http_archive( - name = “build_bazel_rules_apple”, - sha256 = “390841dd5f8a85fc25776684f4793d56e21b098dfd7243cd145b9831e6ef8be6”, - url = “https://github.com/bazelbuild/rules_apple/releases/download/2.4.1/rules_apple.2.4.1.tar.gz”, -) - -load( - “@build_bazel_rules_apple//apple:repositories.bzl”, - “apple_rules_dependencies”, -) - -apple_rules_dependencies() - -load( - “@build_bazel_rules_swift//swift:repositories.bzl”, - “swift_rules_dependencies”, -) - -swift_rules_dependencies() - -load( - “@build_bazel_rules_swift//swift:extras.bzl”, - “swift_rules_extra_dependencies”, -) - -swift_rules_extra_dependencies() - -http_archive( - name = “SwiftLint”, - sha256 = “c6ea58b9c72082cdc1ada4a2d48273ecc355896ed72204cedcc586b6ccb8aca6”, - url = “https://github.com/realm/SwiftLint/releases/download/0.52.4/bazel.tar.gz”, -) - -load(“@SwiftLint//bazel:repos.bzl”, “swiftlint_repos”) - -swiftlint_repos() - -load(“@SwiftLint//bazel:deps.bzl”, “swiftlint_deps”) - -swiftlint_deps() -“` - -
- -

Then you can run SwiftLint in the current directory with this command:

-
bazel run -c opt @SwiftLint//:swiftlint
-
-

Usage

-

Presentation

- -

To get a high-level overview of recommended ways to integrate SwiftLint into your project, -we encourage you to watch this presentation or read the transcript:

- -

Presentation

-

Xcode Run Script Build Phase

- -

Integrate SwiftLint into your Xcode project to get warnings and errors displayed -in the issue navigator.

- -

To do this select the project in the file navigator, then select the primary app -target, and go to Build Phases. Click the + and select "New Run Script Phase”. -Insert the following as the script:

- -

- -

Xcode 15 made a significant change by setting the default value of the ENABLE_USER_SCRIPT_SANDBOXING Build Setting from NO to YES. -As a result, SwiftLint encounters an error related to missing file permissions, -which typically manifests as follows: error: Sandbox: swiftlint(19427) deny(1) file-read-data.

- -

To resolve this issue, it is necessary to manually set the ENABLE_USER_SCRIPT_SANDBOXING setting to NO for the specific target that SwiftLint is being configured for.

- -

If you installed SwiftLint via Homebrew on Apple Silicon, you might experience this warning:

-
-

Warning

-

SwiftLint not installed, download from https://github.com/realm/SwiftLint

- -
- -

That is because Homebrew on Apple Silicon installs the binaries into the /opt/homebrew/bin -folder by default. To instruct Xcode where to find SwiftLint, you can either add -/opt/homebrew/bin to the PATH environment variable in your build phase

-
if [[ "$(uname -m)" == arm64 ]]; then
-    export PATH="/opt/homebrew/bin:$PATH"
-fi
-
-if which swiftlint > /dev/null; then
-  swiftlint
-else
-  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
-fi
-
- -

or you can create a symbolic link in /usr/local/bin pointing to the actual binary:

-
ln -s /opt/homebrew/bin/swiftlint /usr/local/bin/swiftlint
-
- -

You might want to move your SwiftLint phase directly before the ‘Compile Sources’ -step to detect errors quickly before compiling. However, SwiftLint is designed -to run on valid Swift code that cleanly completes the compiler’s parsing stage. -So running SwiftLint before ‘Compile Sources’ might yield some incorrect -results.

- -

If you wish to fix violations as well, your script could run -swiftlint --fix && swiftlint instead of just swiftlint. This will mean -that all correctable violations are fixed while ensuring warnings show up in -your project for remaining violations.

- -

If you’ve installed SwiftLint via CocoaPods the script should look like this:

-
"${PODS_ROOT}/SwiftLint/swiftlint"
-
-

Swift Package Command Plugin

- -

The command plugin enables running SwiftLint from the command line as follows:

-
swift package plugin swiftlint
-
-

Swift Package Build Tool Plugins

- -

SwiftLint can be used as a build tool plugin for both Xcode projects and -Swift Package projects.

- -

The build tool plugin determines the SwiftLint working directory by locating -the topmost config file within the package/project directory. If a config file -is not found therein, the package/project directory is used as the working -directory.

- -

The plugin throws an error when it is unable to resolve the SwiftLint working -directory. For example, this will occur in Xcode projects where the target’s -Swift files are not located within the project directory.

- -

To maximize compatibility with the plugin, avoid project structures that require -the use of the --config option.

-

Unexpected Project Structures

- -

Project structures where SwiftLint’s configuration file is located -outside of the package/project directory are not directly supported -by the build tool plugin. This is because it isn’t possible to pass -arguments to build tool plugins (e.g., passing the config file path).

- -

If your project structure doesn’t work directly with the build tool -plugin, please consider one of the following options:

- -
    -
  • To use a config file located outside the package/project directory, a config -file may be added to that directory specifying a parent config path to the -other config file, e.g., parent_config: path/to/.swiftlint.yml.
  • -
  • You can also consider the use of a Run Script Build Phase in place of the -build tool plugin.
  • -
-

Xcode Projects

- -

You can integrate SwiftLint as an Xcode Build Tool Plugin if you’re working -with a project in Xcode.

- -

Add SwiftLint as a package dependency to your project without linking any of the -products.

- -

Select the target you want to add linting to and open the Build Phases inspector. -Open Run Build Tool Plugins and select the + button. -Select SwiftLintBuildToolPlugin from the list and add it to the project.

- -

- -

For unattended use (e.g. on CI), you can disable the package and macro validation dialog by

- -
    -
  • individually passing -skipPackagePluginValidation and -skipMacroValidation to xcodebuild or
  • -
  • globally setting defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES and defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES -for that user.
  • -
- -

Note: This implicitly trusts all Xcode package plugins and macros in packages and bypasses Xcode’s package validation - dialogs, which has security implications.

-

Swift Package Projects

- -

You can integrate SwiftLint as a Swift Package Manager Plugin if you’re working with -a Swift Package with a Package.swift manifest.

- -

Add SwiftLint as a package dependency to your Package.swift file.
-Add SwiftLint to a target using the plugins parameter.

-
.target(
-    ...
-    plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]
-),
-
-

Visual Studio Code

- -

To integrate SwiftLint with vscode, install the -vscode-swiftlint extension from the marketplace.

-

fastlane

- -

You can use the official swiftlint fastlane action to run SwiftLint as part of your fastlane process.

-
swiftlint(
-    mode: :lint,                            # SwiftLint mode: :lint (default) or :autocorrect
-    executable: "Pods/SwiftLint/swiftlint", # The SwiftLint binary path (optional). Important if you've installed it via CocoaPods
-    path: "/path/to/lint",                  # Specify path to lint (optional)
-    output_file: "swiftlint.result.json",   # The path of the output file (optional)
-    reporter: "json",                       # The custom reporter to use (optional)
-    config_file: ".swiftlint-ci.yml",       # The path of the configuration file (optional)
-    files: [                                # List of files to process (optional)
-        "AppDelegate.swift",
-        "path/to/project/Model.swift"
-    ],
-    ignore_exit_status: true,               # Allow fastlane to continue even if SwiftLint returns a non-zero exit status (Default: false)
-    quiet: true,                            # Don't print status logs like 'Linting ' & 'Done linting' (Default: false)
-    strict: true                            # Fail on warnings? (Default: false)
-)
-
-

Docker

- -

swiftlint is also available as a Docker image using Ubuntu. -So just the first time you need to pull the docker image using the next command:

-
docker pull ghcr.io/realm/swiftlint:latest
-
- -

Then following times, you just run swiftlint inside of the docker like:

-
docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
-
- -

This will execute swiftlint in the folder where you are right now (pwd), showing an output like:

-
$ docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
-Linting Swift files in current working directory
-Linting 'RuleDocumentation.swift' (1/490)
-...
-Linting 'YamlSwiftLintTests.swift' (490/490)
-Done linting! Found 0 violations, 0 serious in 490 files.
-
- -

Here you have more documentation about the usage of Docker Images.

-

Command Line

-
$ swiftlint help
-OVERVIEW: A tool to enforce Swift style and conventions.
-
-USAGE: swiftlint <subcommand>
-
-OPTIONS:
-  --version               Show the version.
-  -h, --help              Show help information.
-
-SUBCOMMANDS:
-  analyze                 Run analysis rules
-  docs                    Open SwiftLint documentation website in the default web browser
-  generate-docs           Generates markdown documentation for all rules
-  lint (default)          Print lint warnings and errors
-  reporters               Display the list of reporters and their identifiers
-  rules                   Display the list of rules and their identifiers
-  version                 Display the current version of SwiftLint
-
-  See 'swiftlint help <subcommand>' for detailed help.
-
- -

Run swiftlint in the directory containing the Swift files to lint. Directories -will be searched recursively.

- -

To specify a list of files when using lint or analyze -(like the list of files modified by Xcode specified by the -ExtraBuildPhase Xcode -plugin, or modified files in the working tree based on git ls-files -m), you -can do so by passing the option --use-script-input-files and setting the -following instance variables: SCRIPT_INPUT_FILE_COUNT and -SCRIPT_INPUT_FILE_0, SCRIPT_INPUT_FILE_1…SCRIPT_INPUT_FILE_{SCRIPT_INPUT_FILE_COUNT - 1}.

- -

These are same environment variables set for input files to -custom Xcode script phases.

-

Working With Multiple Swift Versions

- -

SwiftLint hooks into SourceKit so it continues working even as Swift evolves!

- -

This also keeps SwiftLint lean, as it doesn’t need to ship with a full Swift -compiler, it just communicates with the official one you already have installed -on your machine.

- -

You should always run SwiftLint with the same toolchain you use to compile your -code.

- -

You may want to override SwiftLint’s default Swift toolchain if you have -multiple toolchains or Xcodes installed.

- -

Here’s the order in which SwiftLint determines which Swift toolchain to use:

- -
    -
  • $XCODE_DEFAULT_TOOLCHAIN_OVERRIDE
  • -
  • $TOOLCHAIN_DIR or $TOOLCHAINS
  • -
  • xcrun -find swift
  • -
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • ~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • ~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
- -

sourcekitd.framework is expected to be found in the usr/lib/ subdirectory of -the value passed in the paths above.

- -

You may also set the TOOLCHAINS environment variable to the reverse-DNS -notation that identifies a Swift toolchain version:

-
$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 swiftlint --fix
-
- -

On Linux, SourceKit is expected to be located in -/usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH -environment variable.

-

pre-commit

- -

SwiftLint can be run as a pre-commit hook. -Once installed, add this to the -.pre-commit-config.yaml in the root of your repository:

-
repos:
-  - repo: https://github.com/realm/SwiftLint
-    rev: 0.50.3
-    hooks:
-      - id: swiftlint
-
- -

Adjust rev to the SwiftLint version of your choice. pre-commit autoupdate can be used to update to the current version.

- -

SwiftLint can be configured using entry to apply fixes and fail on errors:

-
-   repo: https://github.com/realm/SwiftLint
-    rev: 0.50.3
-    hooks:
-    -   id: swiftlint
-        entry: swiftlint --fix --strict
-
-

Rules

- -

Over 200 rules are included in SwiftLint and the Swift community (that’s you!) -continues to contribute more over time. -Pull requests are encouraged.

- -

You can find an updated list of rules and more information about them -here.

- -

You can also check Source/SwiftLintBuiltInRules/Rules -directory to see their implementation.

-

Opt-In Rules

- -

opt_in_rules are disabled by default (i.e., you have to explicitly enable them -in your configuration file).

- -

Guidelines on when to mark a rule as opt-in:

- -
    -
  • A rule that can have many false positives (e.g. empty_count)
  • -
  • A rule that is too slow
  • -
  • A rule that is not general consensus or is only useful in some cases -(e.g. force_unwrapping)
  • -
-

Disable rules in code

- -

Rules can be disabled with a comment inside a source file with the following -format:

- -

// swiftlint:disable <rule1> [<rule2> <rule3>...]

- -

The rules will be disabled until the end of the file or until the linter sees a -matching enable comment:

- -

// swiftlint:enable <rule1> [<rule2> <rule3>...]

- -

For example:

-
// swiftlint:disable colon
-let noWarning :String = "" // No warning about colons immediately after variable names!
-// swiftlint:enable colon
-let hasWarning :String = "" // Warning generated about colons immediately after variable names
-
- -

Including the all keyword will disable all rules until the linter sees a matching enable comment:

- -

// swiftlint:disable all -// swiftlint:enable all

- -

For example:

-
// swiftlint:disable all
-let noWarning :String = "" // No warning about colons immediately after variable names!
-let i = "" // Also no warning about short identifier names
-// swiftlint:enable all
-let hasWarning :String = "" // Warning generated about colons immediately after variable names
-let y = "" // Warning generated about short identifier names
-
- -

It’s also possible to modify a disable or enable command by appending -:previous, :this or :next for only applying the command to the previous, -this (current) or next line respectively.

- -

For example:

-
// swiftlint:disable:next force_cast
-let noWarning = NSNumber() as! Int
-let hasWarning = NSNumber() as! Int
-let noWarning2 = NSNumber() as! Int // swiftlint:disable:this force_cast
-let noWarning3 = NSNumber() as! Int
-// swiftlint:disable:previous force_cast
-
- -

Run swiftlint rules to print a list of all available rules and their -identifiers.

-

Configuration

- -

Configure SwiftLint by adding a .swiftlint.yml file from the directory you’ll -run SwiftLint from. The following parameters can be configured:

- -

Rule inclusion:

- -
    -
  • disabled_rules: Disable rules from the default enabled set.
  • -
  • opt_in_rules: Enable rules that are not part of the default set. The -special all identifier will enable all opt in linter rules, except the ones -listed in disabled_rules.
  • -
  • only_rules: Only the rules specified in this list will be enabled. -Cannot be specified alongside disabled_rules or opt_in_rules.
  • -
  • analyzer_rules: This is an entirely separate list of rules that are only -run by the analyze command. All analyzer rules are opt-in, so this is the -only configurable rule list, there are no equivalents for disabled_rules -and only_rules. The special all identifier can also be used here to enable -all analyzer rules, except the ones listed in disabled_rules.
  • -
-
# By default, SwiftLint uses a set of sensible default rules you can adjust:
-disabled_rules: # rule identifiers turned on by default to exclude from running
-  - colon
-  - comma
-  - control_statement
-opt_in_rules: # some rules are turned off by default, so you need to opt-in
-  - empty_count # find all the available rules by running: `swiftlint rules`
-
-# Alternatively, specify all rules explicitly by uncommenting this option:
-# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
-#   - empty_parameters
-#   - vertical_whitespace
-
-analyzer_rules: # rules run by `swiftlint analyze`
-  - explicit_self
-
-included: # case-sensitive paths to include during linting. `--path` is ignored if present
-  - Sources
-excluded: # case-sensitive paths to ignore during linting. Takes precedence over `included`
-  - Carthage
-  - Pods
-  - Sources/ExcludedFolder
-  - Sources/ExcludedFile.swift
-  - Sources/*/ExcludedFile.swift # exclude files with a wildcard
-
-# If true, SwiftLint will not fail if no lintable files are found.
-allow_zero_lintable_files: false
-
-# If true, SwiftLint will treat all warnings as errors.
-strict: false
-
-# configurable rules can be customized from this configuration file
-# binary rules can set their severity level
-force_cast: warning # implicitly
-force_try:
-  severity: warning # explicitly
-# rules that have both warning and error levels, can set just the warning level
-# implicitly
-line_length: 110
-# they can set both implicitly with an array
-type_body_length:
-  - 300 # warning
-  - 400 # error
-# or they can set both explicitly
-file_length:
-  warning: 500
-  error: 1200
-# naming rules can set warnings/errors for min_length and max_length
-# additionally they can set excluded names
-type_name:
-  min_length: 4 # only warning
-  max_length: # warning and error
-    warning: 40
-    error: 50
-  excluded: iPhone # excluded via string
-  allowed_symbols: ["_"] # these are allowed in type names
-identifier_name:
-  min_length: # only min_length
-    error: 4 # only error
-  excluded: # excluded via string array
-    - id
-    - URL
-    - GlobalAPIKey
-reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)
-
- -

You can also use environment variables in your configuration file, -by using ${SOME_VARIABLE} in a string.

-

Defining Custom Rules

- -

In addition to the rules that the main SwiftLint project ships with, SwiftLint -can also run two types of custom rules that you can define yourself in your own -projects:

-

1. Swift Custom Rules

- -

These rules are written the same way as the Swift-based rules that ship with -SwiftLint so they’re fast, accurate, can leverage SwiftSyntax, can be unit -tested, and more.

- -

Using these requires building SwiftLint with Bazel as described in -this video or its associated code in -github.com/jpsim/swiftlint-bazel-example.

-

2. Regex Custom Rules

- -

You can define custom regex-based rules in your configuration file using the -following syntax:

-
custom_rules:
-  pirates_beat_ninjas: # rule identifier
-    included: 
-      - ".*\\.swift" # regex that defines paths to include during linting. optional.
-    excluded: 
-      - ".*Test\\.swift" # regex that defines paths to exclude during linting. optional
-    name: "Pirates Beat Ninjas" # rule name. optional.
-    regex: "([nN]inja)" # matching pattern
-    capture_group: 0 # number of regex capture group to highlight the rule violation at. optional.
-    match_kinds: # SyntaxKinds to match. optional.
-      - comment
-      - identifier
-    message: "Pirates are better than ninjas." # violation message. optional.
-    severity: error # violation severity. optional.
-  no_hiding_in_strings:
-    regex: "([nN]inja)"
-    match_kinds: string
-
- -

This is what the output would look like:

- -

- -

It is important to note that the regular expression pattern is used with the flags s -and m enabled, that is . -matches newlines -and ^/$ -match the start and end of lines, -respectively. If you do not want to have . match newlines, for example, the regex can be prepended by (?-s).

- -

You can filter the matches by providing one or more match_kinds, which will -reject matches that include syntax kinds that are not present in this list. Here -are all the possible syntax kinds:

- -
    -
  • argument
  • -
  • attribute.builtin
  • -
  • attribute.id
  • -
  • buildconfig.id
  • -
  • buildconfig.keyword
  • -
  • comment
  • -
  • comment.mark
  • -
  • comment.url
  • -
  • doccomment
  • -
  • doccomment.field
  • -
  • identifier
  • -
  • keyword
  • -
  • number
  • -
  • objectliteral
  • -
  • parameter
  • -
  • placeholder
  • -
  • string
  • -
  • string_interpolation_anchor
  • -
  • typeidentifier
  • -
- -

All syntax kinds used in a snippet of Swift code can be extracted asking -SourceKitten. For example, -sourcekitten syntax --text "struct S {}" delivers

- -
    -
  • source.lang.swift.syntaxtype.keyword for the struct keyword and
  • -
  • source.lang.swift.syntaxtype.identifier for its name S
  • -
- -

which match to keyword and identifier in the above list.

- -

If using custom rules in combination with only_rules, make sure to add -custom_rules as an item under only_rules.

- -

Unlike Swift custom rules, you can use official SwiftLint builds -(e.g. from Homebrew) to run regex custom rules.

-

Auto-correct

- -

SwiftLint can automatically correct certain violations. Files on disk are -overwritten with a corrected version.

- -

Please make sure to have backups of these files before running -swiftlint --fix, otherwise important data may be lost.

- -

Standard linting is disabled while correcting because of the high likelihood of -violations (or their offsets) being incorrect after modifying a file while -applying corrections.

-

Analyze

- -

The swiftlint analyze command can lint Swift files using the -full type-checked AST. The compiler log path containing the clean swiftc build -command invocation (incremental builds will fail) must be passed to analyze -via the --compiler-log-path flag. -e.g. --compiler-log-path /path/to/xcodebuild.log

- -

This can be obtained by

- -
    -
  1. Cleaning DerivedData (incremental builds won’t work with analyze)
  2. -
  3. Running xcodebuild -workspace {WORKSPACE}.xcworkspace -scheme {SCHEME} > xcodebuild.log
  4. -
  5. Running swiftlint analyze --compiler-log-path xcodebuild.log
  6. -
- -

Analyzer rules tend to be considerably slower than lint rules.

-

Using Multiple Configuration Files

- -

SwiftLint offers a variety of ways to include multiple configuration files. -Multiple configuration files get merged into one single configuration that is then applied -just as a single configuration file would get applied.

- -

There are quite a lot of use cases where using multiple configuration files could be helpful:

- -

For instance, one could use a team-wide shared SwiftLint configuration while allowing overrides -in each project via a child configuration file.

- -

Team-Wide Configuration:

-
disabled_rules:
-- force_cast
-
- -

Project-Specific Configuration:

-
opt_in_rules:
-- force_cast
-
-

Child / Parent Configs (Locally)

- -

You can specify a child_config and / or a parent_config reference within a configuration file. -These references should be local paths relative to the folder of the configuration file they are specified in. -This even works recursively, as long as there are no cycles and no ambiguities.

- -

A child config is treated as a refinement and therefore has a higher priority, -while a parent config is considered a base with lower priority in case of conflicts.

- -

Here’s an example, assuming you have the following file structure:

-
ProjectRoot
-    |_ .swiftlint.yml
-    |_ .swiftlint_refinement.yml
-    |_ Base
-        |_ .swiftlint_base.yml
-
- -

To include both the refinement and the base file, your .swiftlint.yml should look like this:

-
child_config: .swiftlint_refinement.yml
-parent_config: Base/.swiftlint_base.yml
-
- -

When merging parent and child configs, included and excluded configurations -are processed carefully to account for differences in the directory location -of the containing configuration files.

-

Child / Parent Configs (Remote)

- -

Just as you can provide local child_config / parent_config references, instead of -referencing local paths, you can just put urls that lead to configuration files. -In order for SwiftLint to detect these remote references, they must start with http:// or https://.

- -

The referenced remote configuration files may even recursively reference other -remote configuration files, but aren’t allowed to include local references.

- -

Using a remote reference, your .swiftlint.yml could look like this:

-
parent_config: https://myteamserver.com/our-base-swiftlint-config.yml
-
- -

Every time you run SwiftLint and have an Internet connection, SwiftLint tries to get a new version of -every remote configuration that is referenced. If this request times out, a cached version is -used if available. If there is no cached version available, SwiftLint fails – but no worries, a cached version -should be there once SwiftLint has run successfully at least once.

- -

If needed, the timeouts for the remote configuration fetching can be specified manually via the -configuration file(s) using the remote_timeout / remote_timeout_if_cached specifiers. -These values default to 2 / 1 second(s).

-

Command Line

- -

Instead of just providing one configuration file when running SwiftLint via the command line, -you can also pass a hierarchy, where the first configuration is treated as a parent, -while the last one is treated as the highest-priority child.

- -

A simple example including just two configuration files looks like this:

- -

swiftlint --config .swiftlint.yml --config .swiftlint_child.yml

-

Nested Configurations

- -

In addition to a main configuration (the .swiftlint.yml file in the root folder), -you can put other configuration files named .swiftlint.yml into the directory structure -that then get merged as a child config, but only with an effect for those files -that are within the same directory as the config or in a deeper directory where -there isn’t another configuration file. In other words: Nested configurations don’t work -recursively – there’s a maximum number of one nested configuration per file -that may be applied in addition to the main configuration.

- -

.swiftlint.yml files are only considered as a nested configuration if they have not been -used to build the main configuration already (e. g. by having been referenced via something -like child_config: Folder/.swiftlint.yml). Also, parent_config / child_config -specifications of nested configurations are getting ignored because there’s no sense to that.

- -

If one (or more) SwiftLint file(s) are explicitly specified via the --config parameter, -that configuration will be treated as an override, no matter whether there exist -other .swiftlint.yml files somewhere within the directory. So if you want to use - nested configurations, you can’t use the --config parameter.

-

License

- -

MIT licensed.

-

About

- -

- -

SwiftLint is maintained and funded by Realm Inc. The names and logos for -Realm are trademarks of Realm Inc.

- -

We :heart: open source software! -See our other open source projects, -read our blog, or say hi on twitter -(@realm).

- -

- -

Our thanks to MacStadium for providing a Mac Mini to run our performance -tests.

- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inert_defer.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inert_defer.html deleted file mode 100644 index 39d98dc13..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/inert_defer.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - inert_defer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Inert Defer

- -

If defer is at the end of its parent scope, it will be executed right where it is anyway

- -
    -
  • Identifier: inert_defer
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func example3() {
-    defer { /* deferred code */ }
-
-    print("other code")
-}
-
-
func example4() {
-    if condition {
-        defer { /* deferred code */ }
-        print("other code")
-    }
-}
-
-

Triggering Examples

-
func example0() {
-    ↓defer { /* deferred code */ }
-}
-
-
func example1() {
-    ↓defer { /* deferred code */ }
-    // comment
-}
-
-
func example2() {
-    if condition {
-        ↓defer { /* deferred code */ }
-        // comment
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/invalid_swiftlint_command.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/invalid_swiftlint_command.html deleted file mode 100644 index 040c3b5fb..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/invalid_swiftlint_command.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - invalid_swiftlint_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Invalid SwiftLint Command

- -

swiftlint command is invalid

- -
    -
  • Identifier: invalid_swiftlint_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// swiftlint:disable unused_import
-
-
// swiftlint:enable unused_import
-
-
// swiftlint:disable:next unused_import
-
-
// swiftlint:disable:previous unused_import
-
-
// swiftlint:disable:this unused_import
-
-
//swiftlint:disable:this unused_import
-
-

Triggering Examples

-
// ↓swiftlint:
-
-
// ↓swiftlint: 
-
-
// ↓swiftlint::
-
-
// ↓swiftlint:: 
-
-
// ↓swiftlint:disable
-
-
// ↓swiftlint:dissable unused_import
-
-
// ↓swiftlint:enaaaable unused_import
-
-
// ↓swiftlint:disable:nxt unused_import
-
-
// ↓swiftlint:enable:prevus unused_import
-
-
// ↓swiftlint:enable:ths unused_import
-
-
// ↓swiftlint:enable
-
-
// ↓swiftlint:enable:
-
-
// ↓swiftlint:enable: 
-
-
// ↓swiftlint:disable: unused_import
-
-
// s↓swiftlint:disable unused_import
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/is_disjoint.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/is_disjoint.html deleted file mode 100644 index 2b0f6c9cf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/is_disjoint.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - is_disjoint Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Is Disjoint

- -

Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty

- -
    -
  • Identifier: is_disjoint
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
_ = Set(syntaxKinds).isDisjoint(with: commentAndStringKindsSet)
-
-
let isObjc = !objcAttributes.isDisjoint(with: dictionary.enclosedSwiftAttributes)
-
-
_ = Set(syntaxKinds).intersection(commentAndStringKindsSet)
-
-
_ = !objcAttributes.intersection(dictionary.enclosedSwiftAttributes)
-
-

Triggering Examples

-
_ = Set(syntaxKinds).↓intersection(commentAndStringKindsSet).isEmpty
-
-
let isObjc = !objcAttributes.↓intersection(dictionary.enclosedSwiftAttributes).isEmpty
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/joined_default_parameter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/joined_default_parameter.html deleted file mode 100644 index 221069b7c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/joined_default_parameter.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - joined_default_parameter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Joined Default Parameter

- -

Discouraged explicit usage of the default separator

- -
    -
  • Identifier: joined_default_parameter
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = bar.joined()
-
-
let foo = bar.joined(separator: ",")
-
-
let foo = bar.joined(separator: toto)
-
-

Triggering Examples

-
let foo = bar.joined(↓separator: "")
-
-
let foo = bar.filter(toto)
-             .joined(↓separator: ""),
-
-
func foo() -> String {
-  return ["1", "2"].joined(↓separator: "")
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.js b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.js deleted file mode 100755 index 198441660..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.js +++ /dev/null @@ -1,74 +0,0 @@ -// Jazzy - https://github.com/realm/jazzy -// Copyright Realm Inc. -// SPDX-License-Identifier: MIT - -window.jazzy = {'docset': false} -if (typeof window.dash != 'undefined') { - document.documentElement.className += ' dash' - window.jazzy.docset = true -} -if (navigator.userAgent.match(/xcode/i)) { - document.documentElement.className += ' xcode' - window.jazzy.docset = true -} - -function toggleItem($link, $content) { - var animationDuration = 300; - $link.toggleClass('token-open'); - $content.slideToggle(animationDuration); -} - -function itemLinkToContent($link) { - return $link.parent().parent().next(); -} - -// On doc load + hash-change, open any targetted item -function openCurrentItemIfClosed() { - if (window.jazzy.docset) { - return; - } - var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); - $content = itemLinkToContent($link); - if ($content.is(':hidden')) { - toggleItem($link, $content); - } -} - -$(openCurrentItemIfClosed); -$(window).on('hashchange', openCurrentItemIfClosed); - -// On item link ('token') click, toggle its discussion -$('.token').on('click', function(event) { - if (window.jazzy.docset) { - return; - } - var $link = $(this); - toggleItem($link, itemLinkToContent($link)); - - // Keeps the document from jumping to the hash. - var href = $link.attr('href'); - if (history.pushState) { - history.pushState({}, '', href); - } else { - location.hash = href; - } - event.preventDefault(); -}); - -// Clicks on links to the current, closed, item need to open the item -$("a:not('.token')").on('click', function() { - if (location == this.href) { - openCurrentItemIfClosed(); - } -}); - -// KaTeX rendering -if ("katex" in window) { - $($('.math').each( (_, element) => { - katex.render(element.textContent, element, { - displayMode: $(element).hasClass('m-block'), - throwOnError: false, - trust: true - }); - })) -} diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.search.js b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.search.js deleted file mode 100644 index 359cdbb8b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jazzy.search.js +++ /dev/null @@ -1,74 +0,0 @@ -// Jazzy - https://github.com/realm/jazzy -// Copyright Realm Inc. -// SPDX-License-Identifier: MIT - -$(function(){ - var $typeahead = $('[data-typeahead]'); - var $form = $typeahead.parents('form'); - var searchURL = $form.attr('action'); - - function displayTemplate(result) { - return result.name; - } - - function suggestionTemplate(result) { - var t = '
'; - t += '' + result.name + ''; - if (result.parent_name) { - t += '' + result.parent_name + ''; - } - t += '
'; - return t; - } - - $typeahead.one('focus', function() { - $form.addClass('loading'); - - $.getJSON(searchURL).then(function(searchData) { - const searchIndex = lunr(function() { - this.ref('url'); - this.field('name'); - this.field('abstract'); - for (const [url, doc] of Object.entries(searchData)) { - this.add({url: url, name: doc.name, abstract: doc.abstract}); - } - }); - - $typeahead.typeahead( - { - highlight: true, - minLength: 3, - autoselect: true - }, - { - limit: 10, - display: displayTemplate, - templates: { suggestion: suggestionTemplate }, - source: function(query, sync) { - const lcSearch = query.toLowerCase(); - const results = searchIndex.query(function(q) { - q.term(lcSearch, { boost: 100 }); - q.term(lcSearch, { - boost: 10, - wildcard: lunr.Query.wildcard.TRAILING - }); - }).map(function(result) { - var doc = searchData[result.ref]; - doc.url = result.ref; - return doc; - }); - sync(results); - } - } - ); - $form.removeClass('loading'); - $typeahead.trigger('focus'); - }); - }); - - var baseURL = searchURL.slice(0, -"search.json".length); - - $typeahead.on('typeahead:select', function(e, result) { - window.location = baseURL + result.url; - }); -}); diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jquery.min.js b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jquery.min.js deleted file mode 100644 index 7f37b5d99..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/typeahead.jquery.js b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/typeahead.jquery.js deleted file mode 100644 index 3a2d2ab03..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/js/typeahead.jquery.js +++ /dev/null @@ -1,1694 +0,0 @@ -/*! - * typeahead.js 1.3.1 - * https://github.com/corejavascript/typeahead.js - * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT - */ - - -(function(root, factory) { - if (typeof define === "function" && define.amd) { - define([ "jquery" ], function(a0) { - return factory(a0); - }); - } else if (typeof module === "object" && module.exports) { - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -})(this, function($) { - var _ = function() { - "use strict"; - return { - isMsie: function() { - return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; - }, - isBlankString: function(str) { - return !str || /^\s*$/.test(str); - }, - escapeRegExChars: function(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - }, - isString: function(obj) { - return typeof obj === "string"; - }, - isNumber: function(obj) { - return typeof obj === "number"; - }, - isArray: $.isArray, - isFunction: $.isFunction, - isObject: $.isPlainObject, - isUndefined: function(obj) { - return typeof obj === "undefined"; - }, - isElement: function(obj) { - return !!(obj && obj.nodeType === 1); - }, - isJQuery: function(obj) { - return obj instanceof $; - }, - toStr: function toStr(s) { - return _.isUndefined(s) || s === null ? "" : s + ""; - }, - bind: $.proxy, - each: function(collection, cb) { - $.each(collection, reverseArgs); - function reverseArgs(index, value) { - return cb(value, index); - } - }, - map: $.map, - filter: $.grep, - every: function(obj, test) { - var result = true; - if (!obj) { - return result; - } - $.each(obj, function(key, val) { - if (!(result = test.call(null, val, key, obj))) { - return false; - } - }); - return !!result; - }, - some: function(obj, test) { - var result = false; - if (!obj) { - return result; - } - $.each(obj, function(key, val) { - if (result = test.call(null, val, key, obj)) { - return false; - } - }); - return !!result; - }, - mixin: $.extend, - identity: function(x) { - return x; - }, - clone: function(obj) { - return $.extend(true, {}, obj); - }, - getIdGenerator: function() { - var counter = 0; - return function() { - return counter++; - }; - }, - templatify: function templatify(obj) { - return $.isFunction(obj) ? obj : template; - function template() { - return String(obj); - } - }, - defer: function(fn) { - setTimeout(fn, 0); - }, - debounce: function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments, later, callNow; - later = function() { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - } - }; - callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - } - return result; - }; - }, - throttle: function(func, wait) { - var context, args, timeout, result, previous, later; - previous = 0; - later = function() { - previous = new Date(); - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date(), remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }, - stringify: function(val) { - return _.isString(val) ? val : JSON.stringify(val); - }, - guid: function() { - function _p8(s) { - var p = (Math.random().toString(16) + "000000000").substr(2, 8); - return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; - } - return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); - }, - noop: function() {} - }; - }(); - var WWW = function() { - "use strict"; - var defaultClassNames = { - wrapper: "twitter-typeahead", - input: "tt-input", - hint: "tt-hint", - menu: "tt-menu", - dataset: "tt-dataset", - suggestion: "tt-suggestion", - selectable: "tt-selectable", - empty: "tt-empty", - open: "tt-open", - cursor: "tt-cursor", - highlight: "tt-highlight" - }; - return build; - function build(o) { - var www, classes; - classes = _.mixin({}, defaultClassNames, o); - www = { - css: buildCss(), - classes: classes, - html: buildHtml(classes), - selectors: buildSelectors(classes) - }; - return { - css: www.css, - html: www.html, - classes: www.classes, - selectors: www.selectors, - mixin: function(o) { - _.mixin(o, www); - } - }; - } - function buildHtml(c) { - return { - wrapper: '', - menu: '
' - }; - } - function buildSelectors(classes) { - var selectors = {}; - _.each(classes, function(v, k) { - selectors[k] = "." + v; - }); - return selectors; - } - function buildCss() { - var css = { - wrapper: { - position: "relative", - display: "inline-block" - }, - hint: { - position: "absolute", - top: "0", - left: "0", - borderColor: "transparent", - boxShadow: "none", - opacity: "1" - }, - input: { - position: "relative", - verticalAlign: "top", - backgroundColor: "transparent" - }, - inputWithNoHint: { - position: "relative", - verticalAlign: "top" - }, - menu: { - position: "absolute", - top: "100%", - left: "0", - zIndex: "100", - display: "none" - }, - ltr: { - left: "0", - right: "auto" - }, - rtl: { - left: "auto", - right: " 0" - } - }; - if (_.isMsie()) { - _.mixin(css.input, { - backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" - }); - } - return css; - } - }(); - var EventBus = function() { - "use strict"; - var namespace, deprecationMap; - namespace = "typeahead:"; - deprecationMap = { - render: "rendered", - cursorchange: "cursorchanged", - select: "selected", - autocomplete: "autocompleted" - }; - function EventBus(o) { - if (!o || !o.el) { - $.error("EventBus initialized without el"); - } - this.$el = $(o.el); - } - _.mixin(EventBus.prototype, { - _trigger: function(type, args) { - var $e = $.Event(namespace + type); - this.$el.trigger.call(this.$el, $e, args || []); - return $e; - }, - before: function(type) { - var args, $e; - args = [].slice.call(arguments, 1); - $e = this._trigger("before" + type, args); - return $e.isDefaultPrevented(); - }, - trigger: function(type) { - var deprecatedType; - this._trigger(type, [].slice.call(arguments, 1)); - if (deprecatedType = deprecationMap[type]) { - this._trigger(deprecatedType, [].slice.call(arguments, 1)); - } - } - }); - return EventBus; - }(); - var EventEmitter = function() { - "use strict"; - var splitter = /\s+/, nextTick = getNextTick(); - return { - onSync: onSync, - onAsync: onAsync, - off: off, - trigger: trigger - }; - function on(method, types, cb, context) { - var type; - if (!cb) { - return this; - } - types = types.split(splitter); - cb = context ? bindContext(cb, context) : cb; - this._callbacks = this._callbacks || {}; - while (type = types.shift()) { - this._callbacks[type] = this._callbacks[type] || { - sync: [], - async: [] - }; - this._callbacks[type][method].push(cb); - } - return this; - } - function onAsync(types, cb, context) { - return on.call(this, "async", types, cb, context); - } - function onSync(types, cb, context) { - return on.call(this, "sync", types, cb, context); - } - function off(types) { - var type; - if (!this._callbacks) { - return this; - } - types = types.split(splitter); - while (type = types.shift()) { - delete this._callbacks[type]; - } - return this; - } - function trigger(types) { - var type, callbacks, args, syncFlush, asyncFlush; - if (!this._callbacks) { - return this; - } - types = types.split(splitter); - args = [].slice.call(arguments, 1); - while ((type = types.shift()) && (callbacks = this._callbacks[type])) { - syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); - asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); - syncFlush() && nextTick(asyncFlush); - } - return this; - } - function getFlush(callbacks, context, args) { - return flush; - function flush() { - var cancelled; - for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { - cancelled = callbacks[i].apply(context, args) === false; - } - return !cancelled; - } - } - function getNextTick() { - var nextTickFn; - if (window.setImmediate) { - nextTickFn = function nextTickSetImmediate(fn) { - setImmediate(function() { - fn(); - }); - }; - } else { - nextTickFn = function nextTickSetTimeout(fn) { - setTimeout(function() { - fn(); - }, 0); - }; - } - return nextTickFn; - } - function bindContext(fn, context) { - return fn.bind ? fn.bind(context) : function() { - fn.apply(context, [].slice.call(arguments, 0)); - }; - } - }(); - var highlight = function(doc) { - "use strict"; - var defaults = { - node: null, - pattern: null, - tagName: "strong", - className: null, - wordsOnly: false, - caseSensitive: false, - diacriticInsensitive: false - }; - var accented = { - A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", - B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", - C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", - D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", - E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", - F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", - G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", - H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", - I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", - J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", - K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", - L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", - M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", - N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", - O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", - P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", - Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", - R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", - S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", - T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", - U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", - V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", - W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", - X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", - Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", - Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" - }; - return function hightlight(o) { - var regex; - o = _.mixin({}, defaults, o); - if (!o.node || !o.pattern) { - return; - } - o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; - regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); - traverse(o.node, hightlightTextNode); - function hightlightTextNode(textNode) { - var match, patternNode, wrapperNode; - if (match = regex.exec(textNode.data)) { - wrapperNode = doc.createElement(o.tagName); - o.className && (wrapperNode.className = o.className); - patternNode = textNode.splitText(match.index); - patternNode.splitText(match[0].length); - wrapperNode.appendChild(patternNode.cloneNode(true)); - textNode.parentNode.replaceChild(wrapperNode, patternNode); - } - return !!match; - } - function traverse(el, hightlightTextNode) { - var childNode, TEXT_NODE_TYPE = 3; - for (var i = 0; i < el.childNodes.length; i++) { - childNode = el.childNodes[i]; - if (childNode.nodeType === TEXT_NODE_TYPE) { - i += hightlightTextNode(childNode) ? 1 : 0; - } else { - traverse(childNode, hightlightTextNode); - } - } - } - }; - function accent_replacer(chr) { - return accented[chr.toUpperCase()] || chr; - } - function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { - var escapedPatterns = [], regexStr; - for (var i = 0, len = patterns.length; i < len; i++) { - var escapedWord = _.escapeRegExChars(patterns[i]); - if (diacriticInsensitive) { - escapedWord = escapedWord.replace(/\S/g, accent_replacer); - } - escapedPatterns.push(escapedWord); - } - regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; - return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); - } - }(window.document); - var Input = function() { - "use strict"; - var specialKeyCodeMap; - specialKeyCodeMap = { - 9: "tab", - 27: "esc", - 37: "left", - 39: "right", - 13: "enter", - 38: "up", - 40: "down" - }; - function Input(o, www) { - var id; - o = o || {}; - if (!o.input) { - $.error("input is missing"); - } - www.mixin(this); - this.$hint = $(o.hint); - this.$input = $(o.input); - this.$menu = $(o.menu); - id = this.$input.attr("id") || _.guid(); - this.$menu.attr("id", id + "_listbox"); - this.$hint.attr({ - "aria-hidden": true - }); - this.$input.attr({ - "aria-owns": id + "_listbox", - role: "combobox", - "aria-autocomplete": "list", - "aria-expanded": false - }); - this.query = this.$input.val(); - this.queryWhenFocused = this.hasFocus() ? this.query : null; - this.$overflowHelper = buildOverflowHelper(this.$input); - this._checkLanguageDirection(); - if (this.$hint.length === 0) { - this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; - } - this.onSync("cursorchange", this._updateDescendent); - } - Input.normalizeQuery = function(str) { - return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); - }; - _.mixin(Input.prototype, EventEmitter, { - _onBlur: function onBlur() { - this.resetInputValue(); - this.trigger("blurred"); - }, - _onFocus: function onFocus() { - this.queryWhenFocused = this.query; - this.trigger("focused"); - }, - _onKeydown: function onKeydown($e) { - var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; - this._managePreventDefault(keyName, $e); - if (keyName && this._shouldTrigger(keyName, $e)) { - this.trigger(keyName + "Keyed", $e); - } - }, - _onInput: function onInput() { - this._setQuery(this.getInputValue()); - this.clearHintIfInvalid(); - this._checkLanguageDirection(); - }, - _managePreventDefault: function managePreventDefault(keyName, $e) { - var preventDefault; - switch (keyName) { - case "up": - case "down": - preventDefault = !withModifier($e); - break; - - default: - preventDefault = false; - } - preventDefault && $e.preventDefault(); - }, - _shouldTrigger: function shouldTrigger(keyName, $e) { - var trigger; - switch (keyName) { - case "tab": - trigger = !withModifier($e); - break; - - default: - trigger = true; - } - return trigger; - }, - _checkLanguageDirection: function checkLanguageDirection() { - var dir = (this.$input.css("direction") || "ltr").toLowerCase(); - if (this.dir !== dir) { - this.dir = dir; - this.$hint.attr("dir", dir); - this.trigger("langDirChanged", dir); - } - }, - _setQuery: function setQuery(val, silent) { - var areEquivalent, hasDifferentWhitespace; - areEquivalent = areQueriesEquivalent(val, this.query); - hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; - this.query = val; - if (!silent && !areEquivalent) { - this.trigger("queryChanged", this.query); - } else if (!silent && hasDifferentWhitespace) { - this.trigger("whitespaceChanged", this.query); - } - }, - _updateDescendent: function updateDescendent(event, id) { - this.$input.attr("aria-activedescendant", id); - }, - bind: function() { - var that = this, onBlur, onFocus, onKeydown, onInput; - onBlur = _.bind(this._onBlur, this); - onFocus = _.bind(this._onFocus, this); - onKeydown = _.bind(this._onKeydown, this); - onInput = _.bind(this._onInput, this); - this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); - if (!_.isMsie() || _.isMsie() > 9) { - this.$input.on("input.tt", onInput); - } else { - this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { - if (specialKeyCodeMap[$e.which || $e.keyCode]) { - return; - } - _.defer(_.bind(that._onInput, that, $e)); - }); - } - return this; - }, - focus: function focus() { - this.$input.focus(); - }, - blur: function blur() { - this.$input.blur(); - }, - getLangDir: function getLangDir() { - return this.dir; - }, - getQuery: function getQuery() { - return this.query || ""; - }, - setQuery: function setQuery(val, silent) { - this.setInputValue(val); - this._setQuery(val, silent); - }, - hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { - return this.query !== this.queryWhenFocused; - }, - getInputValue: function getInputValue() { - return this.$input.val(); - }, - setInputValue: function setInputValue(value) { - this.$input.val(value); - this.clearHintIfInvalid(); - this._checkLanguageDirection(); - }, - resetInputValue: function resetInputValue() { - this.setInputValue(this.query); - }, - getHint: function getHint() { - return this.$hint.val(); - }, - setHint: function setHint(value) { - this.$hint.val(value); - }, - clearHint: function clearHint() { - this.setHint(""); - }, - clearHintIfInvalid: function clearHintIfInvalid() { - var val, hint, valIsPrefixOfHint, isValid; - val = this.getInputValue(); - hint = this.getHint(); - valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; - isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); - !isValid && this.clearHint(); - }, - hasFocus: function hasFocus() { - return this.$input.is(":focus"); - }, - hasOverflow: function hasOverflow() { - var constraint = this.$input.width() - 2; - this.$overflowHelper.text(this.getInputValue()); - return this.$overflowHelper.width() >= constraint; - }, - isCursorAtEnd: function() { - var valueLength, selectionStart, range; - valueLength = this.$input.val().length; - selectionStart = this.$input[0].selectionStart; - if (_.isNumber(selectionStart)) { - return selectionStart === valueLength; - } else if (document.selection) { - range = document.selection.createRange(); - range.moveStart("character", -valueLength); - return valueLength === range.text.length; - } - return true; - }, - destroy: function destroy() { - this.$hint.off(".tt"); - this.$input.off(".tt"); - this.$overflowHelper.remove(); - this.$hint = this.$input = this.$overflowHelper = $("
"); - }, - setAriaExpanded: function setAriaExpanded(value) { - this.$input.attr("aria-expanded", value); - } - }); - return Input; - function buildOverflowHelper($input) { - return $('').css({ - position: "absolute", - visibility: "hidden", - whiteSpace: "pre", - fontFamily: $input.css("font-family"), - fontSize: $input.css("font-size"), - fontStyle: $input.css("font-style"), - fontVariant: $input.css("font-variant"), - fontWeight: $input.css("font-weight"), - wordSpacing: $input.css("word-spacing"), - letterSpacing: $input.css("letter-spacing"), - textIndent: $input.css("text-indent"), - textRendering: $input.css("text-rendering"), - textTransform: $input.css("text-transform") - }).insertAfter($input); - } - function areQueriesEquivalent(a, b) { - return Input.normalizeQuery(a) === Input.normalizeQuery(b); - } - function withModifier($e) { - return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; - } - }(); - var Dataset = function() { - "use strict"; - var keys, nameGenerator; - keys = { - dataset: "tt-selectable-dataset", - val: "tt-selectable-display", - obj: "tt-selectable-object" - }; - nameGenerator = _.getIdGenerator(); - function Dataset(o, www) { - o = o || {}; - o.templates = o.templates || {}; - o.templates.notFound = o.templates.notFound || o.templates.empty; - if (!o.source) { - $.error("missing source"); - } - if (!o.node) { - $.error("missing node"); - } - if (o.name && !isValidName(o.name)) { - $.error("invalid dataset name: " + o.name); - } - www.mixin(this); - this.highlight = !!o.highlight; - this.name = _.toStr(o.name || nameGenerator()); - this.limit = o.limit || 5; - this.displayFn = getDisplayFn(o.display || o.displayKey); - this.templates = getTemplates(o.templates, this.displayFn); - this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; - this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; - this._resetLastSuggestion(); - this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); - } - Dataset.extractData = function extractData(el) { - var $el = $(el); - if ($el.data(keys.obj)) { - return { - dataset: $el.data(keys.dataset) || "", - val: $el.data(keys.val) || "", - obj: $el.data(keys.obj) || null - }; - } - return null; - }; - _.mixin(Dataset.prototype, EventEmitter, { - _overwrite: function overwrite(query, suggestions) { - suggestions = suggestions || []; - if (suggestions.length) { - this._renderSuggestions(query, suggestions); - } else if (this.async && this.templates.pending) { - this._renderPending(query); - } else if (!this.async && this.templates.notFound) { - this._renderNotFound(query); - } else { - this._empty(); - } - this.trigger("rendered", suggestions, false, this.name); - }, - _append: function append(query, suggestions) { - suggestions = suggestions || []; - if (suggestions.length && this.$lastSuggestion.length) { - this._appendSuggestions(query, suggestions); - } else if (suggestions.length) { - this._renderSuggestions(query, suggestions); - } else if (!this.$lastSuggestion.length && this.templates.notFound) { - this._renderNotFound(query); - } - this.trigger("rendered", suggestions, true, this.name); - }, - _renderSuggestions: function renderSuggestions(query, suggestions) { - var $fragment; - $fragment = this._getSuggestionsFragment(query, suggestions); - this.$lastSuggestion = $fragment.children().last(); - this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); - }, - _appendSuggestions: function appendSuggestions(query, suggestions) { - var $fragment, $lastSuggestion; - $fragment = this._getSuggestionsFragment(query, suggestions); - $lastSuggestion = $fragment.children().last(); - this.$lastSuggestion.after($fragment); - this.$lastSuggestion = $lastSuggestion; - }, - _renderPending: function renderPending(query) { - var template = this.templates.pending; - this._resetLastSuggestion(); - template && this.$el.html(template({ - query: query, - dataset: this.name - })); - }, - _renderNotFound: function renderNotFound(query) { - var template = this.templates.notFound; - this._resetLastSuggestion(); - template && this.$el.html(template({ - query: query, - dataset: this.name - })); - }, - _empty: function empty() { - this.$el.empty(); - this._resetLastSuggestion(); - }, - _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { - var that = this, fragment; - fragment = document.createDocumentFragment(); - _.each(suggestions, function getSuggestionNode(suggestion) { - var $el, context; - context = that._injectQuery(query, suggestion); - $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); - fragment.appendChild($el[0]); - }); - this.highlight && highlight({ - className: this.classes.highlight, - node: fragment, - pattern: query - }); - return $(fragment); - }, - _getFooter: function getFooter(query, suggestions) { - return this.templates.footer ? this.templates.footer({ - query: query, - suggestions: suggestions, - dataset: this.name - }) : null; - }, - _getHeader: function getHeader(query, suggestions) { - return this.templates.header ? this.templates.header({ - query: query, - suggestions: suggestions, - dataset: this.name - }) : null; - }, - _resetLastSuggestion: function resetLastSuggestion() { - this.$lastSuggestion = $(); - }, - _injectQuery: function injectQuery(query, obj) { - return _.isObject(obj) ? _.mixin({ - _query: query - }, obj) : obj; - }, - update: function update(query) { - var that = this, canceled = false, syncCalled = false, rendered = 0; - this.cancel(); - this.cancel = function cancel() { - canceled = true; - that.cancel = $.noop; - that.async && that.trigger("asyncCanceled", query, that.name); - }; - this.source(query, sync, async); - !syncCalled && sync([]); - function sync(suggestions) { - if (syncCalled) { - return; - } - syncCalled = true; - suggestions = (suggestions || []).slice(0, that.limit); - rendered = suggestions.length; - that._overwrite(query, suggestions); - if (rendered < that.limit && that.async) { - that.trigger("asyncRequested", query, that.name); - } - } - function async(suggestions) { - suggestions = suggestions || []; - if (!canceled && rendered < that.limit) { - that.cancel = $.noop; - var idx = Math.abs(rendered - that.limit); - rendered += idx; - that._append(query, suggestions.slice(0, idx)); - that.async && that.trigger("asyncReceived", query, that.name); - } - } - }, - cancel: $.noop, - clear: function clear() { - this._empty(); - this.cancel(); - this.trigger("cleared"); - }, - isEmpty: function isEmpty() { - return this.$el.is(":empty"); - }, - destroy: function destroy() { - this.$el = $("
"); - } - }); - return Dataset; - function getDisplayFn(display) { - display = display || _.stringify; - return _.isFunction(display) ? display : displayFn; - function displayFn(obj) { - return obj[display]; - } - } - function getTemplates(templates, displayFn) { - return { - notFound: templates.notFound && _.templatify(templates.notFound), - pending: templates.pending && _.templatify(templates.pending), - header: templates.header && _.templatify(templates.header), - footer: templates.footer && _.templatify(templates.footer), - suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate - }; - function userSuggestionTemplate(context) { - var template = templates.suggestion; - return $(template(context)).attr("id", _.guid()); - } - function suggestionTemplate(context) { - return $('
').attr("id", _.guid()).text(displayFn(context)); - } - } - function isValidName(str) { - return /^[_a-zA-Z0-9-]+$/.test(str); - } - }(); - var Menu = function() { - "use strict"; - function Menu(o, www) { - var that = this; - o = o || {}; - if (!o.node) { - $.error("node is required"); - } - www.mixin(this); - this.$node = $(o.node); - this.query = null; - this.datasets = _.map(o.datasets, initializeDataset); - function initializeDataset(oDataset) { - var node = that.$node.find(oDataset.node).first(); - oDataset.node = node.length ? node : $("
").appendTo(that.$node); - return new Dataset(oDataset, www); - } - } - _.mixin(Menu.prototype, EventEmitter, { - _onSelectableClick: function onSelectableClick($e) { - this.trigger("selectableClicked", $($e.currentTarget)); - }, - _onRendered: function onRendered(type, dataset, suggestions, async) { - this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); - this.trigger("datasetRendered", dataset, suggestions, async); - }, - _onCleared: function onCleared() { - this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); - this.trigger("datasetCleared"); - }, - _propagate: function propagate() { - this.trigger.apply(this, arguments); - }, - _allDatasetsEmpty: function allDatasetsEmpty() { - return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { - var isEmpty = dataset.isEmpty(); - this.$node.attr("aria-expanded", !isEmpty); - return isEmpty; - }, this)); - }, - _getSelectables: function getSelectables() { - return this.$node.find(this.selectors.selectable); - }, - _removeCursor: function _removeCursor() { - var $selectable = this.getActiveSelectable(); - $selectable && $selectable.removeClass(this.classes.cursor); - }, - _ensureVisible: function ensureVisible($el) { - var elTop, elBottom, nodeScrollTop, nodeHeight; - elTop = $el.position().top; - elBottom = elTop + $el.outerHeight(true); - nodeScrollTop = this.$node.scrollTop(); - nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); - if (elTop < 0) { - this.$node.scrollTop(nodeScrollTop + elTop); - } else if (nodeHeight < elBottom) { - this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); - } - }, - bind: function() { - var that = this, onSelectableClick; - onSelectableClick = _.bind(this._onSelectableClick, this); - this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); - this.$node.on("mouseover", this.selectors.selectable, function() { - that.setCursor($(this)); - }); - this.$node.on("mouseleave", function() { - that._removeCursor(); - }); - _.each(this.datasets, function(dataset) { - dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); - }); - return this; - }, - isOpen: function isOpen() { - return this.$node.hasClass(this.classes.open); - }, - open: function open() { - this.$node.scrollTop(0); - this.$node.addClass(this.classes.open); - }, - close: function close() { - this.$node.attr("aria-expanded", false); - this.$node.removeClass(this.classes.open); - this._removeCursor(); - }, - setLanguageDirection: function setLanguageDirection(dir) { - this.$node.attr("dir", dir); - }, - selectableRelativeToCursor: function selectableRelativeToCursor(delta) { - var $selectables, $oldCursor, oldIndex, newIndex; - $oldCursor = this.getActiveSelectable(); - $selectables = this._getSelectables(); - oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; - newIndex = oldIndex + delta; - newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; - newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; - return newIndex === -1 ? null : $selectables.eq(newIndex); - }, - setCursor: function setCursor($selectable) { - this._removeCursor(); - if ($selectable = $selectable && $selectable.first()) { - $selectable.addClass(this.classes.cursor); - this._ensureVisible($selectable); - } - }, - getSelectableData: function getSelectableData($el) { - return $el && $el.length ? Dataset.extractData($el) : null; - }, - getActiveSelectable: function getActiveSelectable() { - var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); - return $selectable.length ? $selectable : null; - }, - getTopSelectable: function getTopSelectable() { - var $selectable = this._getSelectables().first(); - return $selectable.length ? $selectable : null; - }, - update: function update(query) { - var isValidUpdate = query !== this.query; - if (isValidUpdate) { - this.query = query; - _.each(this.datasets, updateDataset); - } - return isValidUpdate; - function updateDataset(dataset) { - dataset.update(query); - } - }, - empty: function empty() { - _.each(this.datasets, clearDataset); - this.query = null; - this.$node.addClass(this.classes.empty); - function clearDataset(dataset) { - dataset.clear(); - } - }, - destroy: function destroy() { - this.$node.off(".tt"); - this.$node = $("
"); - _.each(this.datasets, destroyDataset); - function destroyDataset(dataset) { - dataset.destroy(); - } - } - }); - return Menu; - }(); - var Status = function() { - "use strict"; - function Status(options) { - this.$el = $("", { - role: "status", - "aria-live": "polite" - }).css({ - position: "absolute", - padding: "0", - border: "0", - height: "1px", - width: "1px", - "margin-bottom": "-1px", - "margin-right": "-1px", - overflow: "hidden", - clip: "rect(0 0 0 0)", - "white-space": "nowrap" - }); - options.$input.after(this.$el); - _.each(options.menu.datasets, _.bind(function(dataset) { - if (dataset.onSync) { - dataset.onSync("rendered", _.bind(this.update, this)); - dataset.onSync("cleared", _.bind(this.cleared, this)); - } - }, this)); - } - _.mixin(Status.prototype, { - update: function update(event, suggestions) { - var length = suggestions.length; - var words; - if (length === 1) { - words = { - result: "result", - is: "is" - }; - } else { - words = { - result: "results", - is: "are" - }; - } - this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); - }, - cleared: function() { - this.$el.text(""); - } - }); - return Status; - }(); - var DefaultMenu = function() { - "use strict"; - var s = Menu.prototype; - function DefaultMenu() { - Menu.apply(this, [].slice.call(arguments, 0)); - } - _.mixin(DefaultMenu.prototype, Menu.prototype, { - open: function open() { - !this._allDatasetsEmpty() && this._show(); - return s.open.apply(this, [].slice.call(arguments, 0)); - }, - close: function close() { - this._hide(); - return s.close.apply(this, [].slice.call(arguments, 0)); - }, - _onRendered: function onRendered() { - if (this._allDatasetsEmpty()) { - this._hide(); - } else { - this.isOpen() && this._show(); - } - return s._onRendered.apply(this, [].slice.call(arguments, 0)); - }, - _onCleared: function onCleared() { - if (this._allDatasetsEmpty()) { - this._hide(); - } else { - this.isOpen() && this._show(); - } - return s._onCleared.apply(this, [].slice.call(arguments, 0)); - }, - setLanguageDirection: function setLanguageDirection(dir) { - this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); - return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); - }, - _hide: function hide() { - this.$node.hide(); - }, - _show: function show() { - this.$node.css("display", "block"); - } - }); - return DefaultMenu; - }(); - var Typeahead = function() { - "use strict"; - function Typeahead(o, www) { - var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; - o = o || {}; - if (!o.input) { - $.error("missing input"); - } - if (!o.menu) { - $.error("missing menu"); - } - if (!o.eventBus) { - $.error("missing event bus"); - } - www.mixin(this); - this.eventBus = o.eventBus; - this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; - this.input = o.input; - this.menu = o.menu; - this.enabled = true; - this.autoselect = !!o.autoselect; - this.active = false; - this.input.hasFocus() && this.activate(); - this.dir = this.input.getLangDir(); - this._hacks(); - this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); - onFocused = c(this, "activate", "open", "_onFocused"); - onBlurred = c(this, "deactivate", "_onBlurred"); - onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); - onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); - onEscKeyed = c(this, "isActive", "_onEscKeyed"); - onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); - onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); - onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); - onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); - onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); - onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); - this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); - } - _.mixin(Typeahead.prototype, { - _hacks: function hacks() { - var $input, $menu; - $input = this.input.$input || $("
"); - $menu = this.menu.$node || $("
"); - $input.on("blur.tt", function($e) { - var active, isActive, hasActive; - active = document.activeElement; - isActive = $menu.is(active); - hasActive = $menu.has(active).length > 0; - if (_.isMsie() && (isActive || hasActive)) { - $e.preventDefault(); - $e.stopImmediatePropagation(); - _.defer(function() { - $input.focus(); - }); - } - }); - $menu.on("mousedown.tt", function($e) { - $e.preventDefault(); - }); - }, - _onSelectableClicked: function onSelectableClicked(type, $el) { - this.select($el); - }, - _onDatasetCleared: function onDatasetCleared() { - this._updateHint(); - }, - _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { - this._updateHint(); - if (this.autoselect) { - var cursorClass = this.selectors.cursor.substr(1); - this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); - } - this.eventBus.trigger("render", suggestions, async, dataset); - }, - _onAsyncRequested: function onAsyncRequested(type, dataset, query) { - this.eventBus.trigger("asyncrequest", query, dataset); - }, - _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { - this.eventBus.trigger("asynccancel", query, dataset); - }, - _onAsyncReceived: function onAsyncReceived(type, dataset, query) { - this.eventBus.trigger("asyncreceive", query, dataset); - }, - _onFocused: function onFocused() { - this._minLengthMet() && this.menu.update(this.input.getQuery()); - }, - _onBlurred: function onBlurred() { - if (this.input.hasQueryChangedSinceLastFocus()) { - this.eventBus.trigger("change", this.input.getQuery()); - } - }, - _onEnterKeyed: function onEnterKeyed(type, $e) { - var $selectable; - if ($selectable = this.menu.getActiveSelectable()) { - if (this.select($selectable)) { - $e.preventDefault(); - $e.stopPropagation(); - } - } else if (this.autoselect) { - if (this.select(this.menu.getTopSelectable())) { - $e.preventDefault(); - $e.stopPropagation(); - } - } - }, - _onTabKeyed: function onTabKeyed(type, $e) { - var $selectable; - if ($selectable = this.menu.getActiveSelectable()) { - this.select($selectable) && $e.preventDefault(); - } else if (this.autoselect) { - if ($selectable = this.menu.getTopSelectable()) { - this.autocomplete($selectable) && $e.preventDefault(); - } - } - }, - _onEscKeyed: function onEscKeyed() { - this.close(); - }, - _onUpKeyed: function onUpKeyed() { - this.moveCursor(-1); - }, - _onDownKeyed: function onDownKeyed() { - this.moveCursor(+1); - }, - _onLeftKeyed: function onLeftKeyed() { - if (this.dir === "rtl" && this.input.isCursorAtEnd()) { - this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); - } - }, - _onRightKeyed: function onRightKeyed() { - if (this.dir === "ltr" && this.input.isCursorAtEnd()) { - this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); - } - }, - _onQueryChanged: function onQueryChanged(e, query) { - this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); - }, - _onWhitespaceChanged: function onWhitespaceChanged() { - this._updateHint(); - }, - _onLangDirChanged: function onLangDirChanged(e, dir) { - if (this.dir !== dir) { - this.dir = dir; - this.menu.setLanguageDirection(dir); - } - }, - _openIfActive: function openIfActive() { - this.isActive() && this.open(); - }, - _minLengthMet: function minLengthMet(query) { - query = _.isString(query) ? query : this.input.getQuery() || ""; - return query.length >= this.minLength; - }, - _updateHint: function updateHint() { - var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; - $selectable = this.menu.getTopSelectable(); - data = this.menu.getSelectableData($selectable); - val = this.input.getInputValue(); - if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { - query = Input.normalizeQuery(val); - escapedQuery = _.escapeRegExChars(query); - frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); - match = frontMatchRegEx.exec(data.val); - match && this.input.setHint(val + match[1]); - } else { - this.input.clearHint(); - } - }, - isEnabled: function isEnabled() { - return this.enabled; - }, - enable: function enable() { - this.enabled = true; - }, - disable: function disable() { - this.enabled = false; - }, - isActive: function isActive() { - return this.active; - }, - activate: function activate() { - if (this.isActive()) { - return true; - } else if (!this.isEnabled() || this.eventBus.before("active")) { - return false; - } else { - this.active = true; - this.eventBus.trigger("active"); - return true; - } - }, - deactivate: function deactivate() { - if (!this.isActive()) { - return true; - } else if (this.eventBus.before("idle")) { - return false; - } else { - this.active = false; - this.close(); - this.eventBus.trigger("idle"); - return true; - } - }, - isOpen: function isOpen() { - return this.menu.isOpen(); - }, - open: function open() { - if (!this.isOpen() && !this.eventBus.before("open")) { - this.input.setAriaExpanded(true); - this.menu.open(); - this._updateHint(); - this.eventBus.trigger("open"); - } - return this.isOpen(); - }, - close: function close() { - if (this.isOpen() && !this.eventBus.before("close")) { - this.input.setAriaExpanded(false); - this.menu.close(); - this.input.clearHint(); - this.input.resetInputValue(); - this.eventBus.trigger("close"); - } - return !this.isOpen(); - }, - setVal: function setVal(val) { - this.input.setQuery(_.toStr(val)); - }, - getVal: function getVal() { - return this.input.getQuery(); - }, - select: function select($selectable) { - var data = this.menu.getSelectableData($selectable); - if (data && !this.eventBus.before("select", data.obj, data.dataset)) { - this.input.setQuery(data.val, true); - this.eventBus.trigger("select", data.obj, data.dataset); - this.close(); - return true; - } - return false; - }, - autocomplete: function autocomplete($selectable) { - var query, data, isValid; - query = this.input.getQuery(); - data = this.menu.getSelectableData($selectable); - isValid = data && query !== data.val; - if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { - this.input.setQuery(data.val); - this.eventBus.trigger("autocomplete", data.obj, data.dataset); - return true; - } - return false; - }, - moveCursor: function moveCursor(delta) { - var query, $candidate, data, suggestion, datasetName, cancelMove, id; - query = this.input.getQuery(); - $candidate = this.menu.selectableRelativeToCursor(delta); - data = this.menu.getSelectableData($candidate); - suggestion = data ? data.obj : null; - datasetName = data ? data.dataset : null; - id = $candidate ? $candidate.attr("id") : null; - this.input.trigger("cursorchange", id); - cancelMove = this._minLengthMet() && this.menu.update(query); - if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { - this.menu.setCursor($candidate); - if (data) { - if (typeof data.val === "string") { - this.input.setInputValue(data.val); - } - } else { - this.input.resetInputValue(); - this._updateHint(); - } - this.eventBus.trigger("cursorchange", suggestion, datasetName); - return true; - } - return false; - }, - destroy: function destroy() { - this.input.destroy(); - this.menu.destroy(); - } - }); - return Typeahead; - function c(ctx) { - var methods = [].slice.call(arguments, 1); - return function() { - var args = [].slice.call(arguments); - _.each(methods, function(method) { - return ctx[method].apply(ctx, args); - }); - }; - } - }(); - (function() { - "use strict"; - var old, keys, methods; - old = $.fn.typeahead; - keys = { - www: "tt-www", - attrs: "tt-attrs", - typeahead: "tt-typeahead" - }; - methods = { - initialize: function initialize(o, datasets) { - var www; - datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); - o = o || {}; - www = WWW(o.classNames); - return this.each(attach); - function attach() { - var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; - _.each(datasets, function(d) { - d.highlight = !!o.highlight; - }); - $input = $(this); - $wrapper = $(www.html.wrapper); - $hint = $elOrNull(o.hint); - $menu = $elOrNull(o.menu); - defaultHint = o.hint !== false && !$hint; - defaultMenu = o.menu !== false && !$menu; - defaultHint && ($hint = buildHintFromInput($input, www)); - defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); - $hint && $hint.val(""); - $input = prepInput($input, www); - if (defaultHint || defaultMenu) { - $wrapper.css(www.css.wrapper); - $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); - $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); - } - MenuConstructor = defaultMenu ? DefaultMenu : Menu; - eventBus = new EventBus({ - el: $input - }); - input = new Input({ - hint: $hint, - input: $input, - menu: $menu - }, www); - menu = new MenuConstructor({ - node: $menu, - datasets: datasets - }, www); - status = new Status({ - $input: $input, - menu: menu - }); - typeahead = new Typeahead({ - input: input, - menu: menu, - eventBus: eventBus, - minLength: o.minLength, - autoselect: o.autoselect - }, www); - $input.data(keys.www, www); - $input.data(keys.typeahead, typeahead); - } - }, - isEnabled: function isEnabled() { - var enabled; - ttEach(this.first(), function(t) { - enabled = t.isEnabled(); - }); - return enabled; - }, - enable: function enable() { - ttEach(this, function(t) { - t.enable(); - }); - return this; - }, - disable: function disable() { - ttEach(this, function(t) { - t.disable(); - }); - return this; - }, - isActive: function isActive() { - var active; - ttEach(this.first(), function(t) { - active = t.isActive(); - }); - return active; - }, - activate: function activate() { - ttEach(this, function(t) { - t.activate(); - }); - return this; - }, - deactivate: function deactivate() { - ttEach(this, function(t) { - t.deactivate(); - }); - return this; - }, - isOpen: function isOpen() { - var open; - ttEach(this.first(), function(t) { - open = t.isOpen(); - }); - return open; - }, - open: function open() { - ttEach(this, function(t) { - t.open(); - }); - return this; - }, - close: function close() { - ttEach(this, function(t) { - t.close(); - }); - return this; - }, - select: function select(el) { - var success = false, $el = $(el); - ttEach(this.first(), function(t) { - success = t.select($el); - }); - return success; - }, - autocomplete: function autocomplete(el) { - var success = false, $el = $(el); - ttEach(this.first(), function(t) { - success = t.autocomplete($el); - }); - return success; - }, - moveCursor: function moveCursoe(delta) { - var success = false; - ttEach(this.first(), function(t) { - success = t.moveCursor(delta); - }); - return success; - }, - val: function val(newVal) { - var query; - if (!arguments.length) { - ttEach(this.first(), function(t) { - query = t.getVal(); - }); - return query; - } else { - ttEach(this, function(t) { - t.setVal(_.toStr(newVal)); - }); - return this; - } - }, - destroy: function destroy() { - ttEach(this, function(typeahead, $input) { - revert($input); - typeahead.destroy(); - }); - return this; - } - }; - $.fn.typeahead = function(method) { - if (methods[method]) { - return methods[method].apply(this, [].slice.call(arguments, 1)); - } else { - return methods.initialize.apply(this, arguments); - } - }; - $.fn.typeahead.noConflict = function noConflict() { - $.fn.typeahead = old; - return this; - }; - function ttEach($els, fn) { - $els.each(function() { - var $input = $(this), typeahead; - (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); - }); - } - function buildHintFromInput($input, www) { - return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ - readonly: true, - required: false - }).removeAttr("id name placeholder").removeClass("required").attr({ - spellcheck: "false", - tabindex: -1 - }); - } - function prepInput($input, www) { - $input.data(keys.attrs, { - dir: $input.attr("dir"), - autocomplete: $input.attr("autocomplete"), - spellcheck: $input.attr("spellcheck"), - style: $input.attr("style") - }); - $input.addClass(www.classes.input).attr({ - spellcheck: false - }); - try { - !$input.attr("dir") && $input.attr("dir", "auto"); - } catch (e) {} - return $input; - } - function getBackgroundStyles($el) { - return { - backgroundAttachment: $el.css("background-attachment"), - backgroundClip: $el.css("background-clip"), - backgroundColor: $el.css("background-color"), - backgroundImage: $el.css("background-image"), - backgroundOrigin: $el.css("background-origin"), - backgroundPosition: $el.css("background-position"), - backgroundRepeat: $el.css("background-repeat"), - backgroundSize: $el.css("background-size") - }; - } - function revert($input) { - var www, $wrapper; - www = $input.data(keys.www); - $wrapper = $input.parent().filter(www.selectors.wrapper); - _.each($input.data(keys.attrs), function(val, key) { - _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); - }); - $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); - if ($wrapper.length) { - $input.detach().insertAfter($wrapper); - $wrapper.remove(); - } - } - function $elOrNull(obj) { - var isValid, $el; - isValid = _.isJQuery(obj) || _.isElement(obj); - $el = isValid ? $(obj).first() : []; - return $el.length ? $el : null; - } - })(); -}); \ No newline at end of file diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/large_tuple.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/large_tuple.html deleted file mode 100644 index d1197bcaf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/large_tuple.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - large_tuple Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Large Tuple

- -

Tuples shouldn’t have too many members. Create a custom type instead.

- -
    -
  • Identifier: large_tuple
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -2 -
    -error - -3 -
  • -
-

Non Triggering Examples

-
let foo: (Int, Int)
-
-
let foo: (start: Int, end: Int)
-
-
let foo: (Int, (Int, String))
-
-
func foo() -> (Int, Int)
-
-
func foo() -> (Int, Int) {}
-
-
func foo(bar: String) -> (Int, Int)
-
-
func foo(bar: String) -> (Int, Int) {}
-
-
func foo() throws -> (Int, Int)
-
-
func foo() throws -> (Int, Int) {}
-
-
let foo: (Int, Int, Int) -> Void
-
-
let foo: (Int, Int, Int) throws -> Void
-
-
func foo(bar: (Int, String, Float) -> Void)
-
-
func foo(bar: (Int, String, Float) throws -> Void)
-
-
var completionHandler: ((_ data: Data?, _ resp: URLResponse?, _ e: NSError?) -> Void)!
-
-
func getDictionaryAndInt() -> (Dictionary<Int, String>, Int)?
-
-
func getGenericTypeAndInt() -> (Type<Int, String, Float>, Int)?
-
-
func foo() async -> (Int, Int)
-
-
func foo() async -> (Int, Int) {}
-
-
func foo(bar: String) async -> (Int, Int)
-
-
func foo(bar: String) async -> (Int, Int) {}
-
-
func foo() async throws -> (Int, Int)
-
-
func foo() async throws -> (Int, Int) {}
-
-
let foo: (Int, Int, Int) async -> Void
-
-
let foo: (Int, Int, Int) async throws -> Void
-
-
func foo(bar: (Int, String, Float) async -> Void)
-
-
func foo(bar: (Int, String, Float) async throws -> Void)
-
-
func getDictionaryAndInt() async -> (Dictionary<Int, String>, Int)?
-
-
func getGenericTypeAndInt() async -> (Type<Int, String, Float>, Int)?
-
-

Triggering Examples

-
let foo: ↓(Int, Int, Int)
-
-
let foo: ↓(start: Int, end: Int, value: String)
-
-
let foo: (Int, ↓(Int, Int, Int))
-
-
func foo(bar: ↓(Int, Int, Int))
-
-
func foo() -> ↓(Int, Int, Int)
-
-
func foo() -> ↓(Int, Int, Int) {}
-
-
func foo(bar: String) -> ↓(Int, Int, Int)
-
-
func foo(bar: String) -> ↓(Int, Int, Int) {}
-
-
func foo() throws -> ↓(Int, Int, Int)
-
-
func foo() throws -> ↓(Int, Int, Int) {}
-
-
func foo() throws -> ↓(Int, ↓(String, String, String), Int) {}
-
-
func getDictionaryAndInt() -> (Dictionary<Int, ↓(String, String, String)>, Int)?
-
-
func foo(bar: ↓(Int, Int, Int)) async
-
-
func foo() async -> ↓(Int, Int, Int)
-
-
func foo() async -> ↓(Int, Int, Int) {}
-
-
func foo(bar: String) async -> ↓(Int, Int, Int)
-
-
func foo(bar: String) async -> ↓(Int, Int, Int) {}
-
-
func foo() async throws -> ↓(Int, Int, Int)
-
-
func foo() async throws -> ↓(Int, Int, Int) {}
-
-
func foo() async throws -> ↓(Int, ↓(String, String, String), Int) {}
-
-
func getDictionaryAndInt() async -> (Dictionary<Int, ↓(String, String, String)>, Int)?
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/last_where.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/last_where.html deleted file mode 100644 index 9415a7d1f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/last_where.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - last_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Last Where

- -

Prefer using .last(where:) over .filter { }.last in collections

- -
    -
  • Identifier: last_where
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
kinds.filter(excludingKinds.contains).isEmpty && kinds.last == .identifier
-
-
myList.last(where: { $0 % 2 == 0 })
-
-
match(pattern: pattern).filter { $0.last == .identifier }
-
-
(myList.filter { $0 == 1 }.suffix(2)).last
-
-
collection.filter("stringCol = '3'").last
-
-

Triggering Examples

-
↓myList.filter { $0 % 2 == 0 }.last
-
-
↓myList.filter({ $0 % 2 == 0 }).last
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last?.something()
-
-
↓myList.filter(someFunction).last
-
-
↓myList.filter({ $0 % 2 == 0 })
-.last
-
-
(↓myList.filter { $0 == 1 }).last
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/leading_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/leading_whitespace.html deleted file mode 100644 index a3a9e3655..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/leading_whitespace.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - leading_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Leading Whitespace

- -

Files should not contain leading whitespace

- -
    -
  • Identifier: leading_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
//
-
-

Triggering Examples

-

-//
-
-
 //
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html deleted file mode 100644 index 6f1cd95dc..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - legacy_cggeometry_functions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy CGGeometry Functions

- -

Struct extension properties and methods are preferred over legacy functions

- -
    -
  • Identifier: legacy_cggeometry_functions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
rect.width
-
-
rect.height
-
-
rect.minX
-
-
rect.midX
-
-
rect.maxX
-
-
rect.minY
-
-
rect.midY
-
-
rect.maxY
-
-
rect.isNull
-
-
rect.isEmpty
-
-
rect.isInfinite
-
-
rect.standardized
-
-
rect.integral
-
-
rect.insetBy(dx: 5.0, dy: -7.0)
-
-
rect.offsetBy(dx: 5.0, dy: -7.0)
-
-
rect1.union(rect2)
-
-
rect1.intersect(rect2)
-
-
rect1.contains(rect2)
-
-
rect.contains(point)
-
-
rect1.intersects(rect2)
-
-

Triggering Examples

-
↓CGRectGetWidth(rect)
-
-
↓CGRectGetHeight(rect)
-
-
↓CGRectGetMinX(rect)
-
-
↓CGRectGetMidX(rect)
-
-
↓CGRectGetMaxX(rect)
-
-
↓CGRectGetMinY(rect)
-
-
↓CGRectGetMidY(rect)
-
-
↓CGRectGetMaxY(rect)
-
-
↓CGRectIsNull(rect)
-
-
↓CGRectIsEmpty(rect)
-
-
↓CGRectIsInfinite(rect)
-
-
↓CGRectStandardize(rect)
-
-
↓CGRectIntegral(rect)
-
-
↓CGRectInset(rect, 10, 5)
-
-
↓CGRectOffset(rect, -2, 8.3)
-
-
↓CGRectUnion(rect1, rect2)
-
-
↓CGRectIntersection(rect1, rect2)
-
-
↓CGRectContainsRect(rect1, rect2)
-
-
↓CGRectContainsPoint(rect, point)
-
-
↓CGRectIntersectsRect(rect1, rect2)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constant.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constant.html deleted file mode 100644 index b37ebeefe..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constant.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - legacy_constant Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Constant

- -

Struct-scoped constants are preferred over legacy global constants

- -
    -
  • Identifier: legacy_constant
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGRect.infinite
-
-
CGPoint.zero
-
-
CGRect.zero
-
-
CGSize.zero
-
-
NSPoint.zero
-
-
NSRect.zero
-
-
NSSize.zero
-
-
CGRect.null
-
-
CGFloat.pi
-
-
Float.pi
-
-

Triggering Examples

-
↓CGRectInfinite
-
-
↓CGPointZero
-
-
↓CGRectZero
-
-
↓CGSizeZero
-
-
↓NSZeroPoint
-
-
↓NSZeroRect
-
-
↓NSZeroSize
-
-
↓CGRectNull
-
-
↓CGFloat(M_PI)
-
-
↓Float(M_PI)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constructor.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constructor.html deleted file mode 100644 index 7a0343dec..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_constructor.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - legacy_constructor Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Constructor

- -

Swift constructors are preferred over legacy convenience functions

- -
    -
  • Identifier: legacy_constructor
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGPoint(x: 10, y: 10)
-
-
CGPoint(x: xValue, y: yValue)
-
-
CGSize(width: 10, height: 10)
-
-
CGSize(width: aWidth, height: aHeight)
-
-
CGRect(x: 0, y: 0, width: 10, height: 10)
-
-
CGRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
-
-
CGVector(dx: 10, dy: 10)
-
-
CGVector(dx: deltaX, dy: deltaY)
-
-
NSPoint(x: 10, y: 10)
-
-
NSPoint(x: xValue, y: yValue)
-
-
NSSize(width: 10, height: 10)
-
-
NSSize(width: aWidth, height: aHeight)
-
-
NSRect(x: 0, y: 0, width: 10, height: 10)
-
-
NSRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
-
-
NSRange(location: 10, length: 1)
-
-
NSRange(location: loc, length: len)
-
-
UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
-
-
UIEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
-
-
NSEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
-
-
NSEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
-
-
UIOffset(horizontal: 0, vertical: 10)
-
-
UIOffset(horizontal: horizontal, vertical: vertical)
-
-

Triggering Examples

-
↓CGPointMake(10, 10)
-
-
↓CGPointMake(xVal, yVal)
-
-
↓CGPointMake(calculateX(), 10)
-
-
↓CGSizeMake(10, 10)
-
-
↓CGSizeMake(aWidth, aHeight)
-
-
↓CGRectMake(0, 0, 10, 10)
-
-
↓CGRectMake(xVal, yVal, width, height)
-
-
↓CGVectorMake(10, 10)
-
-
↓CGVectorMake(deltaX, deltaY)
-
-
↓NSMakePoint(10, 10)
-
-
↓NSMakePoint(xVal, yVal)
-
-
↓NSMakeSize(10, 10)
-
-
↓NSMakeSize(aWidth, aHeight)
-
-
↓NSMakeRect(0, 0, 10, 10)
-
-
↓NSMakeRect(xVal, yVal, width, height)
-
-
↓NSMakeRange(10, 1)
-
-
↓NSMakeRange(loc, len)
-
-
↓UIEdgeInsetsMake(0, 0, 10, 10)
-
-
↓UIEdgeInsetsMake(top, left, bottom, right)
-
-
↓NSEdgeInsetsMake(0, 0, 10, 10)
-
-
↓NSEdgeInsetsMake(top, left, bottom, right)
-
-
↓CGVectorMake(10, 10)
-↓NSMakeRange(10, 1)
-
-
↓UIOffsetMake(0, 10)
-
-
↓UIOffsetMake(horizontal, vertical)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_hashing.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_hashing.html deleted file mode 100644 index e9d04f076..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_hashing.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - legacy_hashing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Hashing

- -

Prefer using the hash(into:) function instead of overriding hashValue

- -
    -
  • Identifier: legacy_hashing
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct Foo: Hashable {
-  let bar: Int = 10
-
-  func hash(into hasher: inout Hasher) {
-    hasher.combine(bar)
-  }
-}
-
-
class Foo: Hashable {
-  let bar: Int = 10
-
-  func hash(into hasher: inout Hasher) {
-    hasher.combine(bar)
-  }
-}
-
-
var hashValue: Int { return 1 }
-class Foo: Hashable { 
- }
-
-
class Foo: Hashable {
-  let bar: String = "Foo"
-
-  public var hashValue: String {
-    return bar
-  }
-}
-
-
class Foo: Hashable {
-  let bar: String = "Foo"
-
-  public var hashValue: String {
-    get { return bar }
-    set { bar = newValue }
-  }
-}
-
-

Triggering Examples

-
struct Foo: Hashable {
-    let bar: Int = 10
-
-    public ↓var hashValue: Int {
-        return bar
-    }
-}
-
-
class Foo: Hashable {
-    let bar: Int = 10
-
-    public ↓var hashValue: Int {
-        return bar
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_multiple.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_multiple.html deleted file mode 100644 index 37fe61119..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_multiple.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - legacy_multiple Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Multiple

- -

Prefer using the isMultiple(of:) function instead of using the remainder operator (%)

- -
    -
  • Identifier: legacy_multiple
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
cell.contentView.backgroundColor = indexPath.row.isMultiple(of: 2) ? .gray : .white
-
-
guard count.isMultiple(of: 2) else { throw DecodingError.dataCorrupted(...) }
-
-
sanityCheck(bytes > 0 && bytes.isMultiple(of: 4), "capacity must be multiple of 4 bytes")
-
-
guard let i = reversedNumbers.firstIndex(where: { $0.isMultiple(of: 2) }) else { return }
-
-
let constant = 56
-let isMultiple = value.isMultiple(of: constant)
-
-
let constant = 56
-let secret = value % constant == 5
-
-
let secretValue = (value % 3) + 2
-
-

Triggering Examples

-
cell.contentView.backgroundColor = indexPath.row ↓% 2 == 0 ? .gray : .white
-
-
cell.contentView.backgroundColor = 0 == indexPath.row ↓% 2 ? .gray : .white
-
-
cell.contentView.backgroundColor = indexPath.row ↓% 2 != 0 ? .gray : .white
-
-
guard count ↓% 2 == 0 else { throw DecodingError.dataCorrupted(...) }
-
-
sanityCheck(bytes > 0 && bytes ↓% 4 == 0, "capacity must be multiple of 4 bytes")
-
-
guard let i = reversedNumbers.firstIndex(where: { $0 ↓% 2 == 0 }) else { return }
-
-
let constant = 56
-let isMultiple = value ↓% constant == 0
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html deleted file mode 100644 index 976041f71..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - legacy_nsgeometry_functions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy NSGeometry Functions

- -

Struct extension properties and methods are preferred over legacy functions

- -
    -
  • Identifier: legacy_nsgeometry_functions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
rect.width
-
-
rect.height
-
-
rect.minX
-
-
rect.midX
-
-
rect.maxX
-
-
rect.minY
-
-
rect.midY
-
-
rect.maxY
-
-
rect.isEmpty
-
-
rect.integral
-
-
rect.insetBy(dx: 5.0, dy: -7.0)
-
-
rect.offsetBy(dx: 5.0, dy: -7.0)
-
-
rect1.union(rect2)
-
-
rect1.intersection(rect2)
-
-
rect1.contains(rect2)
-
-
rect.contains(point)
-
-
rect1.intersects(rect2)
-
-

Triggering Examples

-
↓NSWidth(rect)
-
-
↓NSHeight(rect)
-
-
↓NSMinX(rect)
-
-
↓NSMidX(rect)
-
-
↓NSMaxX(rect)
-
-
↓NSMinY(rect)
-
-
↓NSMidY(rect)
-
-
↓NSMaxY(rect)
-
-
↓NSEqualRects(rect1, rect2)
-
-
↓NSEqualSizes(size1, size2)
-
-
↓NSEqualPoints(point1, point2)
-
-
↓NSEdgeInsetsEqual(insets2, insets2)
-
-
↓NSIsEmptyRect(rect)
-
-
↓NSIntegralRect(rect)
-
-
↓NSInsetRect(rect, 10, 5)
-
-
↓NSOffsetRect(rect, -2, 8.3)
-
-
↓NSUnionRect(rect1, rect2)
-
-
↓NSIntersectionRect(rect1, rect2)
-
-
↓NSContainsRect(rect1, rect2)
-
-
↓NSPointInRect(rect, point)
-
-
↓NSIntersectsRect(rect1, rect2)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_objc_type.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_objc_type.html deleted file mode 100644 index ae742c22f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_objc_type.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - legacy_objc_type Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Objective-C Reference Type

- -

Prefer Swift value types to bridged Objective-C reference types

- -
    -
  • Identifier: legacy_objc_type
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var array = Array<Int>()
-
-
var calendar: Calendar? = nil
-
-
var formatter: NSDataDetector
-
-
var className: String = NSStringFromClass(MyClass.self)
-
-
_ = URLRequest.CachePolicy.reloadIgnoringLocalCacheData
-
-
_ = Notification.Name("com.apple.Music.playerInfo")
-
-

Triggering Examples

-
var array = ↓NSArray()
-
-
var calendar: ↓NSCalendar? = nil
-
-
_ = ↓NSURLRequest.CachePolicy.reloadIgnoringLocalCacheData
-
-
_ = ↓NSNotification.Name("com.apple.Music.playerInfo")
-
-
let keyValuePair: (Int) -> (↓NSString, ↓NSString) = {
-  let n = "\($0)" as ↓NSString; return (n, n)
-}
-dictionary = [↓NSString: ↓NSString](uniqueKeysWithValues:
-  (1...10_000).lazy.map(keyValuePair))
-
-
extension Foundation.Notification.Name {
-    static var reachabilityChanged: Foundation.↓NSNotification.Name {
-        return Foundation.Notification.Name("org.wordpress.reachability.changed")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_random.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_random.html deleted file mode 100644 index 932aa6c7e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/legacy_random.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - legacy_random Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Random

- -

Prefer using type.random(in:) over legacy functions

- -
    -
  • Identifier: legacy_random
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Int.random(in: 0..<10)
-
-
Double.random(in: 8.6...111.34)
-
-
Float.random(in: 0 ..< 1)
-
-

Triggering Examples

-
↓arc4random()
-
-
↓arc4random_uniform(83)
-
-
↓drand48()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/let_var_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/let_var_whitespace.html deleted file mode 100644 index b9b9891a3..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/let_var_whitespace.html +++ /dev/null @@ -1,565 +0,0 @@ - - - - let_var_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Variable Declaration Whitespace

- -

Variable declarations should be separated from other statements by a blank line

- -
    -
  • Identifier: let_var_whitespace
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    let a = 0
-    var x = 1
-
-    var y = 2
-}
-
-
class C {
-    let a = 5
-
-    var x = 1
-}
-
-
class C {
-    var a = 0
-}
-
-
class C {
-    let a = 1 +
-        2
-    let b = 5
-}
-
-
class C {
-    var x: Int {
-        return 0
-    }
-}
-
-
class C {
-    var x: Int {
-        let a = 0
-
-        return a
-    }
-}
-
-
class C {
-    #if os(macOS)
-    let a = 0
-
-    func f() {}
-    #endif
-}
-
-
class C {
-    #warning("TODO: remove it")
-    let a = 0
-    #warning("TODO: remove it")
-    let b = 0
-}
-
-
class C {
-    #error("TODO: remove it")
-    let a = 0
-}
-
-
class C {
-    @available(swift 4)
-    let a = 0
-}
-
-
class C {
-    @objc
-    var s: String = ""
-}
-
-
class C {
-    @objc
-    func a() {}
-}
-
-
class C {
-    var x = 0
-    lazy
-    var y = 0
-}
-
-
class C {
-    @available(OSX, introduced: 10.6)
-    @available(*, deprecated)
-    var x = 0
-}
-
-
class C {
-    // swiftlint:disable superfluous_disable_command
-    // swiftlint:disable force_cast
-
-    let x = bar as! Bar
-}
-
-
class C {
-    @available(swift 4)
-    @UserDefault("param", defaultValue: true)
-    var isEnabled = true
-
-    @Attribute
-    func f() {}
-}
-
-
class C {
-    var x: Int {
-        let a = 0
-        return a
-    }
-}
-
-
    a = 2
-
-
    a = 2
-
-    var b = 3
-
-
    #warning("message")
-    let a = 2
-
-
    #if os(macOS)
-    let a = 2
-    #endif
-
-
    f {
-        let a = 1
-        return a
-    }
-
-
    func f() {
-        #if os(macOS)
-        let a = 2
-        return a
-        #else
-        return 1
-        #endif
-    }
-
-

Triggering Examples

-
class C {
-    let a
-    ↓func x() {}
-}
-
-
class C {
-    var x = 0
-    ↓@objc func f() {}
-}
-
-
class C {
-    var x = 0
-    ↓@objc
-    func f() {}
-}
-
-
class C {
-    @objc func f() {
-    }
-    ↓var x = 0
-}
-
-
class C {
-    func f() {}
-    ↓@Wapper
-    let isNumber = false
-    @Wapper
-    var isEnabled = true
-    ↓func g() {}
-}
-
-
class C {
-    #if os(macOS)
-    let a = 0
-    ↓func f() {}
-    #endif
-}
-
-
    let a = 2
-    ↓b = 1
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/line_length.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/line_length.html deleted file mode 100644 index f0a056721..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/line_length.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - line_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Line Length

- -

Lines should not span too many characters.

- -
    -
  • Identifier: line_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -120 -
    -error - -200 -
    -ignores_urls - -false -
    -ignores_function_declarations - -false -
    -ignores_comments - -false -
    -ignores_interpolated_strings - -false -
    -excluded_lines_patterns - -[] -
  • -
-

Non Triggering Examples

-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
-
-

Triggering Examples

-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/literal_expression_end_indentation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/literal_expression_end_indentation.html deleted file mode 100644 index 8803c86a7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/literal_expression_end_indentation.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - literal_expression_end_indentation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Literal Expression End Indentation

- -

Array and dictionary literal end should have the same indentation as the line that started it

- -
    -
  • Identifier: literal_expression_end_indentation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2, 3]
-
-
[1,
- 2
-]
-
-
[
-   1,
-   2
-]
-
-
[
-   1,
-   2]
-
-
   let x = [
-       1,
-       2
-   ]
-
-
[key: 2, key2: 3]
-
-
[key: 1,
- key2: 2
-]
-
-
[
-   key: 0,
-   key2: 20
-]
-
-

Triggering Examples

-
let x = [
-   1,
-   2
-   ↓]
-
-
   let x = [
-       1,
-       2
-↓]
-
-
let x = [
-   key: value
-   ↓]
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/local_doc_comment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/local_doc_comment.html deleted file mode 100644 index 344d019ba..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/local_doc_comment.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - local_doc_comment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Local Doc Comment

- -

Prefer regular comments over doc comments in local scopes

- -
    -
  • Identifier: local_doc_comment
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-  // Local scope documentation should use normal comments.
-  print("foo")
-}
-
-
/// My great property
-var myGreatProperty: String!
-
-
/// Look here for more info: https://github.com.
-var myGreatProperty: String!
-
-
/// Look here for more info:
-/// https://github.com.
-var myGreatProperty: String!
-
-

Triggering Examples

-
func foo() {
-  ↓/// Docstring inside a function declaration
-  print("foo")
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/lower_acl_than_parent.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/lower_acl_than_parent.html deleted file mode 100644 index 8c09235ad..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/lower_acl_than_parent.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - lower_acl_than_parent Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Lower ACL than Parent

- -

Ensure declarations have a lower access control level than their enclosing parent

- -
    -
  • Identifier: lower_acl_than_parent
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
public struct Foo { public func bar() {} }
-
-
internal struct Foo { func bar() {} }
-
-
struct Foo { func bar() {} }
-
-
struct Foo { internal func bar() {} }
-
-
open class Foo { public func bar() {} }
-
-
open class Foo { open func bar() {} }
-
-
fileprivate struct Foo { private func bar() {} }
-
-
private struct Foo { private func bar(id: String) }
-
-
extension Foo { public func bar() {} }
-
-
private struct Foo { fileprivate func bar() {} }
-
-
private func foo(id: String) {}
-
-
private class Foo { func bar() {} }
-
-
public extension Foo { struct Bar { public func baz() {} }}
-
-
public extension Foo { struct Bar { internal func baz() {} }}
-
-
internal extension Foo { struct Bar { internal func baz() {} }}
-
-
extension Foo { struct Bar { internal func baz() {} }}
-
-

Triggering Examples

-
struct Foo { ↓public func bar() {} }
-
-
enum Foo { ↓public func bar() {} }
-
-
public class Foo { ↓open func bar() }
-
-
class Foo { ↓public private(set) var bar: String? }
-
-
private struct Foo { ↓public func bar() {} }
-
-
private class Foo { ↓public func bar() {} }
-
-
private actor Foo { ↓public func bar() {} }
-
-
fileprivate struct Foo { ↓public func bar() {} }
-
-
class Foo { ↓public func bar() {} }
-
-
actor Foo { ↓public func bar() {} }
-
-
private struct Foo { ↓internal func bar() {} }
-
-
fileprivate struct Foo { ↓internal func bar() {} }
-
-
extension Foo { struct Bar { ↓public func baz() {} }}
-
-
internal extension Foo { struct Bar { ↓public func baz() {} }}
-
-
private extension Foo { struct Bar { ↓public func baz() {} }}
-
-
fileprivate extension Foo { struct Bar { ↓public func baz() {} }}
-
-
private extension Foo { struct Bar { ↓internal func baz() {} }}
-
-
fileprivate extension Foo { struct Bar { ↓internal func baz() {} }}
-
-
public extension Foo { struct Bar { struct Baz { ↓public func qux() {} }}}
-
-
final class Foo { ↓public func bar() {} }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/mark.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/mark.html deleted file mode 100644 index f0c60b082..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/mark.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - mark Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Mark

- -

MARK comment should be in valid format. e.g. ‘// MARK: …’ or ‘// MARK: - …’

- -
    -
  • Identifier: mark
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// MARK: good
-
-
// MARK: - good
-
-
// MARK: -
-
-
// MARK: - 
-
-
// BOOKMARK
-
-
//BOOKMARK
-
-
// BOOKMARKS
-
-
// MARK: This is good.
-
-
// MARK: - This is good.
-
-
// MARK: --- This is good. ---
-
-
// MARK: – This is dash separator
-
-
// Mark text
-
-
//  MarkdownText.swift
-
-
// MARK: good
-func foo() {
-    let bar = 0
-      // MARK: good
-}
-
-
/*
-func test1() {
-}
-//MARK: mark
-func test2() {
-}
-*/
-
-

Triggering Examples

-
↓//MARK: bad
-
-
↓// MARK:bad
-
-
↓//MARK:bad
-
-
↓//  MARK: bad
-
-
↓// MARK:  bad
-
-
↓// MARK: -bad
-
-
↓// MARK:- bad
-
-
↓// MARK:-bad
-
-
↓//MARK: - bad
-
-
↓//MARK:- bad
-
-
↓//MARK: -bad
-
-
↓//MARK:-bad
-
-
↓//Mark: bad
-
-
↓// Mark: bad
-
-
↓// MARK bad
-
-
↓//MARK bad
-
-
↓// MARK - bad
-
-
↓//MARK : bad
-
-
↓// MARKL:
-
-
↓// MARKR 
-
-
↓// MARKK -
-
-
↓/// MARK:
-
-
↓/// MARK bad
-
-
// MARK: good
-func foo() {
-    let bar = 0
-      ↓//MARK: bad
-}
-
-
↓//MARK:- Top-Level bad mark
-↓//MARK:- Another bad mark
-struct MarkTest {}
-↓// MARK:- Bad mark
-extension MarkTest {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/missing_docs.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/missing_docs.html deleted file mode 100644 index f74b0addd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/missing_docs.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - missing_docs Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Missing Docs

- -

Declarations should be documented.

- -
    -
  • Identifier: missing_docs
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -[open, public] -
    -excludes_extensions - -true -
    -excludes_inherited_types - -true -
    -excludes_trivial_init - -false -
  • -
-

Non Triggering Examples

-
/// docs
-public class A {
-/// docs
-public func b() {}
-}
-// no docs
-public class B: A { override public func b() {} }
-
-
import Foundation
-// no docs
-public class B: NSObject {
-// no docs
-override public var description: String { fatalError() } }
-
-
/// docs
-public class A {
-    deinit {}
-}
-
-
public extension A {}
-
-
/// docs
-public class A {
-    public init() {}
-}
-
-

Triggering Examples

-
public func a() {}
-
-
// regular comment
-public func a() {}
-
-
/* regular comment */
-public func a() {}
-
-
/// docs
-public protocol A {
-// no docs
-var b: Int { get } }
-/// docs
-public struct C: A {
-
-public let b: Int
-}
-
-
/// docs
-public class A {
-    public init(argument: String) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/modifier_order.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/modifier_order.html deleted file mode 100644 index 0080e61b7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/modifier_order.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - modifier_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Modifier Order

- -

Modifier order should be consistent.

- -
    -
  • Identifier: modifier_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -preferred_modifier_order - -[override, acl, setterACL, dynamic, mutators, lazy, final, required, convenience, typeMethods, owned] -
  • -
-

Non Triggering Examples

-
public class Foo {
-   public required convenience init() {}
-}
-
-
public class Foo {
-   public static let bar = 42
-}
-
-
public class Foo {
-   public static var bar: Int {
-       return
-   }
-}
-
-
public class Foo {
-   public class var bar: Int {
-       return 42
-   }
-}
-
-
public class Bar {
-   public class var foo: String {
-       return "foo"
-   }
-}
-public class Foo: Bar {
-   override public final class var foo: String {
-       return "bar"
-   }
-}
-
-
open class Bar {
-   public var foo: Int? {
-       return 42
-   }
-}
-open class Foo: Bar {
-   override public var foo: Int? {
-       return 43
-   }
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   override open class func foo() -> Int {
-       return 43
-   }
-}
-
-
protocol Foo: class {}
-class Bar {
-    public private(set) weak var foo: Foo?
-}
-
-
@objc
-public final class Foo: NSObject {}
-
-
@objcMembers
-public final class Foo: NSObject {}
-
-
@objc
-override public private(set) weak var foo: Bar?
-
-
@objc
-public final class Foo: NSObject {}
-
-
@objc
-open final class Foo: NSObject {
-   open weak var weakBar: NSString? = nil
-}
-
-
public final class Foo {}
-
-
class Bar {
-   func bar() {}
-}
-
-
internal class Foo: Bar {
-   override internal func bar() {}
-}
-
-
public struct Foo {
-   internal weak var weakBar: NSObject? = nil
-}
-
-
class Foo {
-   internal lazy var bar: String = "foo"
-}
-
-

Triggering Examples

-
class Foo {
-   convenience required public init() {}
-}
-
-
public class Foo {
-   static public let bar = 42
-}
-
-
public class Foo {
-   static public var bar: Int {
-       return 42
-   }
-}
-
-
public class Foo {
-   class public var bar: Int {
-       return 42
-   }
-}
-
-
public class RootFoo {
-   class public var foo: String {
-       return "foo"
-   }
-}
-public class Foo: RootFoo {
-   override final class public var foo: String
-       return "bar"
-   }
-}
-
-
open class Bar {
-   public var foo: Int? {
-       return 42
-   }
-}
-open class Foo: Bar {
-    public override var foo: Int? {
-       return 43
-   }
-}
-
-
protocol Foo: class {}
-    class Bar {
-        private(set) public weak var foo: Foo?
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   class open override func foo() -> Int {
-       return 43
-   }
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   open override class func foo() -> Int {
-       return 43
-   }
-}
-
-
@objc
-final public class Foo: NSObject {}
-
-
@objcMembers
-final public class Foo: NSObject {}
-
-
@objc
-final open class Foo: NSObject {
-   weak open var weakBar: NSString? = nil
-}
-
-
final public class Foo {}
-
-
internal class Foo: Bar {
-   internal override func bar() {}
-}
-
-
public struct Foo {
-   weak internal var weakBar: NSObjetc? = nil
-}
-
-
class Foo {
-   lazy internal var bar: String = "foo"
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments.html deleted file mode 100644 index d12438c2e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - multiline_arguments Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Arguments

- -

Arguments should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_arguments
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -first_argument_location - -any_line -
    -only_enforce_after_first_closure_on_first_line - -false -
  • -
-

Non Triggering Examples

-
foo()
-
-
foo(
-)
-
-
foo { }
-
-
foo {
-
-}
-
-
foo(0)
-
-
foo(0, 1)
-
-
foo(0, 1) { }
-
-
foo(0, param1: 1)
-
-
foo(0, param1: 1) { }
-
-
foo(param1: 1)
-
-
foo(param1: 1) { }
-
-
foo(param1: 1, param2: true) { }
-
-
foo(param1: 1, param2: true, param3: [3]) { }
-
-
foo(param1: 1, param2: true, param3: [3]) {
-    bar()
-}
-
-
foo(param1: 1,
-    param2: true,
-    param3: [3])
-
-
foo(
-    param1: 1, param2: true, param3: [3]
-)
-
-
foo(
-    param1: 1,
-    param2: true,
-    param3: [3]
-)
-
-
Picker(selection: viewStore.binding(\.$someProperty)) {
-   ForEach(SomeEnum.allCases, id: \.rawValue) { someCase in
-      Text(someCase.rawValue)
-         .tag(someCase)
-   }
-} label: {
-   EmptyView()
-}
-
-
UIView.animate(withDuration: 1,
-               delay: 0) {
-    // sample
-    print("a")
-} completion: { _ in
-    // sample
-    print("b")
-}
-
-
UIView.animate(withDuration: 1, delay: 0) {
-    print("a")
-} completion: { _ in
-    print("b")
-}
-
-

Triggering Examples

-
foo(0,
-    param1: 1, ↓param2: true, ↓param3: [3])
-
-
foo(0, ↓param1: 1,
-    param2: true, ↓param3: [3])
-
-
foo(0, ↓param1: 1, ↓param2: true,
-    param3: [3])
-
-
foo(
-    0, ↓param1: 1,
-    param2: true, ↓param3: [3]
-)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments_brackets.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments_brackets.html deleted file mode 100644 index 38ed5cc9a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_arguments_brackets.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - multiline_arguments_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Arguments Brackets

- -

Multiline arguments should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_arguments_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo(param1: "Param1", param2: "Param2", param3: "Param3")
-
-
foo(
-    param1: "Param1", param2: "Param2", param3: "Param3"
-)
-
-
func foo(
-    param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"
-)
-
-
foo { param1, param2 in
-    print("hello world")
-}
-
-
foo(
-    bar(
-        x: 5,
-        y: 7
-    )
-)
-
-
AlertViewModel.AlertAction(title: "some title", style: .default) {
-    AlertManager.shared.presentNextDebugAlert()
-}
-
-
public final class Logger {
-    public static let shared = Logger(outputs: [
-        OSLoggerOutput(),
-        ErrorLoggerOutput()
-    ])
-}
-
-
let errors = try self.download([
-    (description: description, priority: priority),
-])
-
-
return SignalProducer({ observer, _ in
-    observer.sendCompleted()
-}).onMainQueue()
-
-
SomeType(a: [
-    1, 2, 3
-], b: [1, 2])
-
-
SomeType(
-  a: 1
-) { print("completion") }
-
-
SomeType(
-  a: 1
-) {
-  print("completion")
-}
-
-
SomeType(
-  a: .init() { print("completion") }
-)
-
-
SomeType(
-  a: .init() {
-    print("completion")
-  }
-)
-
-
SomeType(
-  a: 1
-) {} onError: {}
-
-

Triggering Examples

-
foo(↓param1: "Param1", param2: "Param2",
-         param3: "Param3"
-)
-
-
foo(
-    param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"↓)
-
-
foo(↓param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"↓)
-
-
foo(↓bar(
-    x: 5,
-    y: 7
-)
-)
-
-
foo(
-    bar(
-        x: 5,
-        y: 7
-)↓)
-
-
SomeOtherType(↓a: [
-        1, 2, 3
-    ],
-    b: "two"↓)
-
-
SomeOtherType(
-  a: 1↓) {}
-
-
SomeOtherType(
-  a: 1↓) {
-  print("completion")
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_function_chains.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_function_chains.html deleted file mode 100644 index 1fdd0bdb7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_function_chains.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - multiline_function_chains Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Function Chains

- -

Chained function calls should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_function_chains
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let evenSquaresSum = [20, 17, 35, 4].filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)
-
-
let evenSquaresSum = [20, 17, 35, 4]
-    .filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)",
-
-
let chain = a
-    .b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c { blah in print(blah) }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c(.init(
-        a: 1,
-        b, 2,
-        c, 3))
-    .d()
-
-
self.viewModel.outputs.postContextualNotification
-  .observeForUI()
-  .observeValues {
-    NotificationCenter.default.post(
-      Notification(
-        name: .ksr_showNotificationsDialog,
-        userInfo: [UserInfoKeys.context: PushNotificationDialog.Context.pledge,
-                   UserInfoKeys.viewController: self]
-     )
-    )
-  }
-
-
let remainingIDs = Array(Set(self.currentIDs).subtracting(Set(response.ids)))
-
-
self.happeningNewsletterOn = self.updateCurrentUser
-    .map { $0.newsletters.happening }.skipNil().skipRepeats()
-
-

Triggering Examples

-
let evenSquaresSum = [20, 17, 35, 4]
-    .filter { $0 % 2 == 0 }↓.map { $0 * $0 }
-    .reduce(0, +)
-
-
let evenSquaresSum = a.b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }↓.d()
-
-
let evenSquaresSum = a.b(1, 2, 3)
-    .c(2, 3, 4)↓.d()
-
-
let evenSquaresSum = a.b(1, 2, 3)↓.c { blah in
-        print(blah)
-    }
-    .d()
-
-
a.b {
-//  ““
-}↓.e()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_literal_brackets.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_literal_brackets.html deleted file mode 100644 index e9c9209a4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_literal_brackets.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - multiline_literal_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Literal Brackets

- -

Multiline literals should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_literal_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let trio = ["harry", "ronald", "hermione"]
-let houseCup = ["gryffindor": 460, "hufflepuff": 370, "ravenclaw": 410, "slytherin": 450]
-
-
let trio = [
-    "harry",
-    "ronald",
-    "hermione"
-]
-let houseCup = [
-    "gryffindor": 460,
-    "hufflepuff": 370,
-    "ravenclaw": 410,
-    "slytherin": 450
-]
-
-
let trio = [
-    "harry", "ronald", "hermione"
-]
-let houseCup = [
-    "gryffindor": 460, "hufflepuff": 370,
-    "ravenclaw": 410, "slytherin": 450
-]
-
-
    _ = [
-        1,
-        2,
-        3,
-        4,
-        5, 6,
-        7, 8, 9
-    ]
-
-

Triggering Examples

-
let trio = [↓"harry",
-            "ronald",
-            "hermione"
-]
-
-
let houseCup = [↓"gryffindor": 460, "hufflepuff": 370,
-                "ravenclaw": 410, "slytherin": 450
-]
-
-
let houseCup = [↓"gryffindor": 460,
-                "hufflepuff": 370,
-                "ravenclaw": 410,
-                "slytherin": 450↓]
-
-
let trio = [
-    "harry",
-    "ronald",
-    "hermione"↓]
-
-
let houseCup = [
-    "gryffindor": 460, "hufflepuff": 370,
-    "ravenclaw": 410, "slytherin": 450↓]
-
-
class Hogwarts {
-    let houseCup = [
-        "gryffindor": 460, "hufflepuff": 370,
-        "ravenclaw": 410, "slytherin": 450↓]
-}
-
-
    _ = [
-        1,
-        2,
-        3,
-        4,
-        5, 6,
-        7, 8, 9↓]
-
-
    _ = [↓1, 2, 3,
-         4, 5, 6,
-         7, 8, 9
-    ]
-
-
class Hogwarts {
-    let houseCup = [
-        "gryffindor": 460, "hufflepuff": 370,
-        "ravenclaw": 410, "slytherin": slytherinPoints.filter {
-            $0.isValid
-        }.sum()↓]
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters.html deleted file mode 100644 index 452bae98b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters.html +++ /dev/null @@ -1,756 +0,0 @@ - - - - multiline_parameters Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Parameters

- -

Functions and methods parameters should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_parameters
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allows_single_line - -true -
  • -
-

Non Triggering Examples

-
func foo() { }
-
-
func foo(param1: Int) { }
-
-
func foo(param1: Int, param2: Bool) { }
-
-
func foo(param1: Int, param2: Bool, param3: [String]) { }
-
-
func foo(param1: Int,
-         param2: Bool,
-         param3: [String]) { }
-
-
func foo(_ param1: Int, param2: Int, param3: Int) -> (Int) -> Int {
-   return { x in x + param1 + param2 + param3 }
-}
-
-
static func foo() { }
-
-
static func foo(param1: Int) { }
-
-
static func foo(param1: Int, param2: Bool) { }
-
-
static func foo(param1: Int, param2: Bool, param3: [String]) { }
-
-
static func foo(param1: Int,
-                param2: Bool,
-                param3: [String]) { }
-
-
protocol Foo {
-    func foo() { }
-}
-
-
protocol Foo {
-    func foo(param1: Int) { }
-}
-
-
protocol Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
protocol Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
protocol Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
protocol Foo {
-    class func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: [String]) { }
-}
-
-
enum Foo {
-    func foo() { }
-}
-
-
enum Foo {
-    func foo(param1: Int) { }
-}
-
-
enum Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
enum Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
enum Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
struct Foo {
-    func foo() { }
-}
-
-
struct Foo {
-    func foo(param1: Int) { }
-}
-
-
struct Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
struct Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
struct Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
class Foo {
-    func foo() { }
-}
-
-
class Foo {
-    func foo(param1: Int) { }
-}
-
-
class Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
class Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-    }
-
-
class Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
class Foo {
-    class func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: [String]) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int) -> Void = { _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping ((Int) -> Void)? = nil) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: @escaping ((Int) -> Void)? = { _ in },
-                  param3: Bool) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: @escaping ((Int) -> Void)? = { _ in },
-                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int) -> Void = { (x: Int) in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int, (Int) -> Void) -> Void = { (x: Int, f: (Int) -> Void) in }) { }
-}
-
-
class Foo {
-   init(param1: Int,
-        param2: Bool,
-        param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
func foo() { }
-
-
func foo(param1: Int) { }
-
-
protocol Foo {
-    func foo(param1: Int,
-             param2: Bool,
-             param3: [String]) { }
-}
-
-
protocol Foo {
-    func foo(
-        param1: Int
-    ) { }
-}
-
-
protocol Foo {
-    func foo(
-        param1: Int,
-        param2: Bool,
-        param3: [String]
-    ) { }
-}
-
-

Triggering Examples

-
func ↓foo(_ param1: Int,
-          param2: Int, param3: Int) -> (Int) -> Int {
-   return { x in x + param1 + param2 + param3 }
-}
-
-
protocol Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
protocol Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
protocol Foo {
-   class func ↓foo(param1: Int,
-                   param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   class func ↓foo(param1: Int, param2: Bool,
-                   param3: [String]) { }
-}
-
-
enum Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
enum Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
struct Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
struct Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
class Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                   param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int, param2: Bool,
-                   param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                  param2: Bool, param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                  param2: Bool, param3: @escaping (Int) -> Void = { (x: Int) in }) { }
-}
-
-
class Foo {
-  ↓init(param1: Int, param2: Bool,
-        param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
func ↓foo(param1: Int, param2: Bool) { }
-
-
func ↓foo(param1: Int, param2: Bool, param3: [String]) { }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters_brackets.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters_brackets.html deleted file mode 100644 index e5b853ad9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiline_parameters_brackets.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - multiline_parameters_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Parameters Brackets

- -

Multiline parameters should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_parameters_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo(param1: String, param2: String, param3: String)
-
-
func foo(
-    param1: String, param2: String, param3: String
-)
-
-
func foo(
-    param1: String,
-    param2: String,
-    param3: String
-)
-
-
class SomeType {
-    func foo(param1: String, param2: String, param3: String)
-}
-
-
class SomeType {
-    func foo(
-        param1: String, param2: String, param3: String
-    )
-}
-
-
class SomeType {
-    func foo(
-        param1: String,
-        param2: String,
-        param3: String
-    )
-}
-
-
func foo<T>(param1: T, param2: String, param3: String) -> T { /* some code */ }
-
-
    func foo(a: [Int] = [
-        1
-    ])
-
-

Triggering Examples

-
func foo(↓param1: String, param2: String,
-         param3: String
-)
-
-
func foo(
-    param1: String,
-    param2: String,
-    param3: String↓)
-
-
class SomeType {
-    func foo(↓param1: String, param2: String,
-             param3: String
-    )
-}
-
-
class SomeType {
-    func foo(
-        param1: String,
-        param2: String,
-        param3: String↓)
-}
-
-
func foo<T>(↓param1: T, param2: String,
-         param3: String
-) -> T
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html deleted file mode 100644 index ef9148192..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - multiple_closures_with_trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiple Closures with Trailing Closure

- -

Trailing closure syntax should not be used when passing more than one closure argument

- -
    -
  • Identifier: multiple_closures_with_trailing_closure
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.reduce(0) { $0 + $1 }
-
-
if let foo = bar.map({ $0 + 1 }) {
-
-}
-
-
foo.something(param1: { $0 }, param2: { $0 + 1 })
-
-
UIView.animate(withDuration: 1.0) {
-    someView.alpha = 0.0
-}
-
-
foo.method { print(0) } arg2: { print(1) }
-
-
foo.methodWithParenArgs((0, 1), arg2: (0, 1, 2)) { $0 } arg4: { $0 }
-
-

Triggering Examples

-
foo.something(param1: { $0 }) ↓{ $0 + 1 }
-
-
UIView.animate(withDuration: 1.0, animations: {
-    someView.alpha = 0.0
-}) ↓{ _ in
-    someView.removeFromSuperview()
-}
-
-
foo.multipleTrailing(arg1: { $0 }) { $0 } arg3: { $0 }
-
-
foo.methodWithParenArgs(param1: { $0 }, param2: (0, 1), (0, 1)) { $0 }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nesting.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nesting.html deleted file mode 100644 index 1d2ca5ac4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nesting.html +++ /dev/null @@ -1,1584 +0,0 @@ - - - - nesting Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Nesting

- -

Types should be nested at most 1 level deep, and functions should be nested at most 2 levels deep.

- -
    -
  • Identifier: nesting
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -type_level - - - - - - - - - - - -
    KeyValue
    -warning - -1 -
    -
    -function_level - - - - - - - - - - - -
    KeyValue
    -warning - -2 -
    -
    -check_nesting_in_closures_and_statements - -true -
    -always_allow_one_type_in_functions - -false -
    -ignore_typealiases_and_associatedtypes - -false -
  • -
-

Non Triggering Examples

-
    actor Example_0 {
-        actor Example_1 {}
-    }
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {}
-    }
-
-
    class Example_0 {
-        class Example_1 {}
-    }
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {}
-    }
-
-
    struct Example_0 {
-        struct Example_1 {}
-    }
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {}
-    }
-
-
    enum Example_0 {
-        enum Example_1 {}
-    }
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {}
-    }
-
-
    func f_0() {
-        func f_1() {
-            func f_2() {}
-        }
-    }
-
-
    var example: Int {
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            func f_0() {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    switch example {
-    case .exampleCase:
-        actor Example_0 {
-            actor Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        class Example_0 {
-            class Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        struct Example_0 {
-            struct Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        enum Example_0 {
-            enum Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
actor Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        actor Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
class Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        class Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
struct Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        struct Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
enum Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        enum Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            actor Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                actor Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    actor Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            class Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                class Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    class Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            struct Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                struct Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    struct Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            enum Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                enum Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    enum Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-

Triggering Examples

-
    actor Example_0 {
-        actor Example_1 {
-            ↓actor Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {
-                    ↓actor Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {
-            ↓actor Example_2 {}
-        }
-    }
-
-
    class Example_0 {
-        class Example_1 {
-            ↓class Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {
-                    ↓class Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {
-            ↓class Example_2 {}
-        }
-    }
-
-
    struct Example_0 {
-        struct Example_1 {
-            ↓struct Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {
-                    ↓struct Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {
-            ↓struct Example_2 {}
-        }
-    }
-
-
    enum Example_0 {
-        enum Example_1 {
-            ↓enum Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {
-                    ↓enum Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {
-            ↓enum Example_2 {}
-        }
-    }
-
-
    func f_0() {
-        func f_1() {
-            func f_2() {
-                ↓func f_3() {}
-            }
-        }
-    }
-
-
    var example: Int {
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            func f_0() {
-                func f_1() {
-                    func f_2() {
-                        ↓func f_3() {}
-                    }
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    switch example {
-    case .exampleCase:
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
actor Example_0 {
-    actor Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
class Example_0 {
-    class Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
struct Example_0 {
-    struct Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
enum Example_0 {
-    enum Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            actor Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓actor Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                actor Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓actor Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    actor Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓actor Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            class Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓class Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                class Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓class Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    class Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓class Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            struct Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓struct Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                struct Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓struct Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    struct Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓struct Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            enum Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓enum Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                enum Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓enum Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    enum Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓enum Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nimble_operator.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nimble_operator.html deleted file mode 100644 index 0287834d2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nimble_operator.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - nimble_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Nimble Operator

- -

Prefer Nimble operator overloads over free matcher functions

- -
    -
  • Identifier: nimble_operator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
expect(seagull.squawk) != "Hi!"
-
-
expect("Hi!") == "Hi!"
-
-
expect(10) > 2
-
-
expect(10) >= 10
-
-
expect(10) < 11
-
-
expect(10) <= 10
-
-
expect(x) === x
-
-
expect(10) == 10
-
-
expect(success) == true
-
-
expect(value) == nil
-
-
expect(value) != nil
-
-
expect(object.asyncFunction()).toEventually(equal(1))
-
-
expect(actual).to(haveCount(expected))
-
-
foo.method {
-    expect(value).to(equal(expectedValue), description: "Failed")
-    return Bar(value: ())
-}
-
-

Triggering Examples

-
↓expect(seagull.squawk).toNot(equal("Hi"))
-
-
↓expect(12).toNot(equal(10))
-
-
↓expect(10).to(equal(10))
-
-
↓expect(10, line: 1).to(equal(10))
-
-
↓expect(10).to(beGreaterThan(8))
-
-
↓expect(10).to(beGreaterThanOrEqualTo(10))
-
-
↓expect(10).to(beLessThan(11))
-
-
↓expect(10).to(beLessThanOrEqualTo(10))
-
-
↓expect(x).to(beIdenticalTo(x))
-
-
↓expect(success).to(beTrue())
-
-
↓expect(success).to(beFalse())
-
-
↓expect(value).to(beNil())
-
-
↓expect(value).toNot(beNil())
-
-
expect(10) > 2
- ↓expect(10).to(beGreaterThan(2))
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_extension_access_modifier.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_extension_access_modifier.html deleted file mode 100644 index db6012021..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_extension_access_modifier.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - no_extension_access_modifier Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Extension Access Modifier

- -

Prefer not to use extension access modifiers

- -
    -
  • Identifier: no_extension_access_modifier
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
extension String {}
-
-

-
- extension String {}
-
-

Triggering Examples

-
↓private extension String {}
-
-
↓public 
- extension String {}
-
-
↓open extension String {}
-
-
↓internal extension String {}
-
-
↓fileprivate extension String {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_fallthrough_only.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_fallthrough_only.html deleted file mode 100644 index 512cc8af3..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_fallthrough_only.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - no_fallthrough_only Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Fallthrough only

- -

Fallthroughs can only be used if the case contains at least one other statement

- -
    -
  • Identifier: no_fallthrough_only
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch myvar {
-case 1:
-    var a = 1
-    fallthrough
-case 2:
-    var a = 2
-}
-
-
switch myvar {
-case "a":
-    var one = 1
-    var two = 2
-    fallthrough
-case "b": /* comment */
-    var three = 3
-}
-
-
switch myvar {
-case 1:
-    let one = 1
-case 2:
-    // comment
-    var two = 2
-}
-
-
switch myvar {
-case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
-    var three = 3
-    fallthrough
-default:
-    var three = 4
-}
-
-
switch myvar {
-case .alpha:
-    var one = 1
-case .beta:
-    var three = 3
-    fallthrough
-default:
-    var four = 4
-}
-
-
let aPoint = (1, -1)
-switch aPoint {
-case let (x, y) where x == y:
-    let A = "A"
-case let (x, y) where x == -y:
-    let B = "B"
-    fallthrough
-default:
-    let C = "C"
-}
-
-
switch myvar {
-case MyFun(with: { $1 }):
-    let one = 1
-    fallthrough
-case "abc":
-    let two = 2
-}
-
-
switch enumInstance {
-case .caseA:
-    print("it's a")
-case .caseB:
-    fallthrough
-@unknown default:
-    print("it's not a")
-}
-
-

Triggering Examples

-
switch myvar {
-case 1:
-    ↓fallthrough
-case 2:
-    var a = 1
-}
-
-
switch myvar {
-case 1:
-    var a = 2
-case 2:
-    ↓fallthrough
-case 3:
-    var a = 3
-}
-
-
switch myvar {
-case 1: // comment
-    ↓fallthrough
-}
-
-
switch myvar {
-case 1: /* multi
-    line
-    comment */
-    ↓fallthrough
-case 2:
-    var a = 2
-}
-
-
switch myvar {
-case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
-    ↓fallthrough
-default:
-    var three = 4
-}
-
-
switch myvar {
-case .alpha:
-    var one = 1
-case .beta:
-    ↓fallthrough
-case .gamma:
-    var three = 3
-default:
-    var four = 4
-}
-
-
let aPoint = (1, -1)
-switch aPoint {
-case let (x, y) where x == y:
-    let A = "A"
-case let (x, y) where x == -y:
-    ↓fallthrough
-default:
-    let B = "B"
-}
-
-
switch myvar {
-case MyFun(with: { $1 }):
-    ↓fallthrough
-case "abc":
-    let two = 2
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_grouping_extension.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_grouping_extension.html deleted file mode 100644 index 9a676c2f0..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_grouping_extension.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - no_grouping_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Grouping Extension

- -

Extensions shouldn’t be used to group code within the same source file

- -
    -
  • Identifier: no_grouping_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol Food {}
-extension Food {}
-
-
class Apples {}
-extension Oranges {}
-
-
class Box<T> {}
-extension Box where T: Vegetable {}
-
-

Triggering Examples

-
enum Fruit {}
-↓extension Fruit {}
-
-
↓extension Tea: Error {}
-struct Tea {}
-
-
class Ham { class Spam {}}
-↓extension Ham.Spam {}
-
-
extension External { struct Gotcha {}}
-↓extension External.Gotcha {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_magic_numbers.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_magic_numbers.html deleted file mode 100644 index 01624ac86..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_magic_numbers.html +++ /dev/null @@ -1,514 +0,0 @@ - - - - no_magic_numbers Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Magic Numbers

- -

Magic numbers should be replaced by named constants

- -
    -
  • Identifier: no_magic_numbers
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
var foo = 123
-
-
static let bar: Double = 0.123
-
-
let a = b + 1.0
-
-
array[0] + array[1] 
-
-
let foo = 1_000.000_01
-
-
// array[1337]
-
-
baz("9999")
-
-
func foo() {
-    let x: Int = 2
-    let y = 3
-    let vector = [x, y, -1]
-}
-
-
class A {
-    var foo: Double = 132
-    static let bar: Double = 0.98
-}
-
-
@available(iOS 13, *)
-func version() {
-    if #available(iOS 13, OSX 10.10, *) {
-        return
-    }
-}
-
-
enum Example: Int {
-    case positive = 2
-    case negative = -2
-}
-
-
class FooTests: XCTestCase {
-    let array: [Int] = []
-    let bar = array[42]
-}
-
-
class FooTests: XCTestCase {
-    class Bar {
-        let array: [Int] = []
-        let bar = array[42]
-    }
-}
-
-
class MyTest: XCTestCase {}
-extension MyTest {
-    let a = Int(3)
-}
-
-
extension MyTest {
-    let a = Int(3)
-}
-class MyTest: XCTestCase {}
-
-
let foo = 1 << 2
-
-
let foo = 1 >> 2
-
-
let foo = 2 >> 2
-
-
let foo = 2 << 2
-
-
let a = b / 100.0
-
-
let range = 2 ..< 12
-
-
let range = ...12
-
-
let range = 12...
-
-
let (lowerBound, upperBound) = (400, 599)
-
-
let a = (5, 10)
-
-
let notFound = (statusCode: 404, description: "Not Found", isError: true)
-
-

Triggering Examples

-
foo(↓321)
-
-
bar(↓1_000.005_01)
-
-
array[↓42]
-
-
let box = array[↓12 + ↓14]
-
-
let a = b + ↓2.0
-
-
let range = 2 ... ↓12 + 1
-
-
let range = ↓2*↓6...
-
-
let slice = array[↓2...↓4]
-
-
for i in ↓3 ..< ↓8 {}
-
-
let n: Int = Int(r * ↓255) << ↓16 | Int(g * ↓255) << ↓8
-
-
Color.primary.opacity(isAnimate ? ↓0.1 : ↓1.5)
-
-
        class MyTest: XCTestCase {}
-        extension NSObject {
-            let a = Int(↓3)
-        }
-
-
if (fileSize > ↓1000000) {
-    return
-}
-
-
let imageHeight = (width - ↓24)
-
-
return (↓5, ↓10, ↓15)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_space_in_method_call.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_space_in_method_call.html deleted file mode 100644 index 43f2b1e78..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/no_space_in_method_call.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - no_space_in_method_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Space in Method Call

- -

Don’t add a space between the method name and the parentheses

- -
    -
  • Identifier: no_space_in_method_call
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo()
-
-
object.foo()
-
-
object.foo(1)
-
-
object.foo(value: 1)
-
-
object.foo { print($0 }
-
-
list.sorted { $0.0 < $1.0 }.map { $0.value }
-
-
self.init(rgb: (Int) (colorInt))
-
-
Button {
-    print("Button tapped")
-} label: {
-    Text("Button")
-}
-
-

Triggering Examples

-
foo↓ ()
-
-
object.foo↓ ()
-
-
object.foo↓ (1)
-
-
object.foo↓ (value: 1)
-
-
object.foo↓ () {}
-
-
object.foo↓     ()
-
-
object.foo↓     (value: 1) { x in print(x) }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_optional_string_data_conversion.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_optional_string_data_conversion.html deleted file mode 100644 index d8d14bf99..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_optional_string_data_conversion.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - non_optional_string_data_conversion Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Non-Optional String <-> Data Conversion

- -

Prefer using UTF-8 encoded strings when converting between String and Data

- -
    -
  • Identifier: non_optional_string_data_conversion
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Data("foo".utf8)
-
-
String(decoding: data, as: UTF8.self)
-
-

Triggering Examples

-
"foo".data(using: .utf8)
-
-
String(data: data, encoding: .utf8)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_overridable_class_declaration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_overridable_class_declaration.html deleted file mode 100644 index b647babff..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/non_overridable_class_declaration.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - non_overridable_class_declaration Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Class Declaration in Final Class

- -

Class methods and properties in final classes should themselves be final, just as if the declarations -are private. In both cases, they cannot be overridden. Using final class or static makes this explicit.

- -
    -
  • Identifier: non_overridable_class_declaration
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -final_class_modifier - -final class -
  • -
-

Non Triggering Examples

-
final class C {
-    final class var b: Bool { true }
-    final class func f() {}
-}
-
-
class C {
-    final class var b: Bool { true }
-    final class func f() {}
-}
-
-
class C {
-    class var b: Bool { true }
-    class func f() {}
-}
-
-
class C {
-    static var b: Bool { true }
-    static func f() {}
-}
-
-
final class C {
-    static var b: Bool { true }
-    static func f() {}
-}
-
-
final class C {
-    class D {
-        class var b: Bool { true }
-        class func f() {}
-    }
-}
-
-

Triggering Examples

-
final class C {
-    ↓class var b: Bool { true }
-    ↓class func f() {}
-}
-
-
class C {
-    final class D {
-        ↓class var b: Bool { true }
-        ↓class func f() {}
-    }
-}
-
-
class C {
-    private ↓class var b: Bool { true }
-    private ↓class func f() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/notification_center_detachment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/notification_center_detachment.html deleted file mode 100644 index e82b1f3dd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/notification_center_detachment.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - notification_center_detachment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Notification Center Detachment

- -

An object should only remove itself as an observer in deinit

- -
    -
  • Identifier: notification_center_detachment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-   deinit {
-       NotificationCenter.default.removeObserver(self)
-   }
-}
-
-
class Foo {
-   func bar() {
-       NotificationCenter.default.removeObserver(otherObject)
-   }
-}
-
-

Triggering Examples

-
class Foo {
-   func bar() {
-       ↓NotificationCenter.default.removeObserver(self)
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html deleted file mode 100644 index 8b6e30e04..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - ns_number_init_as_function_reference Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSNumber Init as Function Reference

- -

Passing NSNumber.init or NSDecimalNumber.init as a function reference is dangerous as it can cause the wrong initializer to be used, causing crashes; use .init(value:) instead

- -
    -
  • Identifier: ns_number_init_as_function_reference
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[0, 0.2].map(NSNumber.init(value:))
-
-
let value = NSNumber.init(value: 0.0)
-
-
[0, 0.2].map { NSNumber(value: $0) }
-
-
[0, 0.2].map(NSDecimalNumber.init(value:))
-
-
[0, 0.2].map { NSDecimalNumber(value: $0) }
-
-

Triggering Examples

-
[0, 0.2].map(↓NSNumber.init)
-
-
[0, 0.2].map(↓NSDecimalNumber.init)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_key.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_key.html deleted file mode 100644 index f3b36140b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_key.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - nslocalizedstring_key Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSLocalizedString Key

- -

Static strings should be used as key/comment in NSLocalizedString in order for genstrings to work

- -
    -
  • Identifier: nslocalizedstring_key
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
NSLocalizedString("key", comment: "")
-
-
NSLocalizedString("key" + "2", comment: "")
-
-
NSLocalizedString("key", comment: "comment")
-
-
NSLocalizedString("This is a multi-" +
-    "line string", comment: "")
-
-
let format = NSLocalizedString("%@, %@.", comment: "Accessibility label for a post in the post list." +
-" The parameters are the title, and date respectively." +
-" For example, "Let it Go, 1 hour ago."")
-
-

Triggering Examples

-
NSLocalizedString(↓method(), comment: "")
-
-
NSLocalizedString(↓"key_\(param)", comment: "")
-
-
NSLocalizedString("key", comment: ↓"comment with \(param)")
-
-
NSLocalizedString(↓"key_\(param)", comment: ↓method())
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html deleted file mode 100644 index 884993fa9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - nslocalizedstring_require_bundle Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSLocalizedString Require Bundle

- -

Calls to NSLocalizedString should specify the bundle which contains the strings file

- -
    -
  • Identifier: nslocalizedstring_require_bundle
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
NSLocalizedString("someKey", bundle: .main, comment: "test")
-
-
NSLocalizedString("someKey", tableName: "a",
-                  bundle: Bundle(for: A.self),
-                  comment: "test")
-
-
NSLocalizedString("someKey", tableName: "xyz",
-                  bundle: someBundle, value: "test"
-                  comment: "test")
-
-
arbitraryFunctionCall("something")
-
-

Triggering Examples

-
↓NSLocalizedString("someKey", comment: "test")
-
-
↓NSLocalizedString("someKey", tableName: "a", comment: "test")
-
-
↓NSLocalizedString("someKey", tableName: "xyz",
-                  value: "test", comment: "test")
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html deleted file mode 100644 index 66472783d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - nsobject_prefer_isequal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSObject Prefer isEqual

- -

NSObject subclasses should implement isEqual instead of ==

- -
    -
  • Identifier: nsobject_prefer_isequal
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class AClass: NSObject {
-}
-
-
@objc class AClass: SomeNSObjectSubclass {
-}
-
-
class AClass: Equatable {
-    static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return true
-    }
-
-
class AClass: NSObject {
-    override func isEqual(_ object: Any?) -> Bool {
-        return true
-    }
-}
-
-
@objc class AClass: SomeNSObjectSubclass {
-    override func isEqual(_ object: Any?) -> Bool {
-        return false
-    }
-}
-
-
class AClass: NSObject {
-    static func ==(lhs: AClass, rhs: BClass) -> Bool {
-        return true
-    }
-}
-
-
struct AStruct: Equatable {
-    static func ==(lhs: AStruct, rhs: AStruct) -> Bool {
-        return false
-    }
-}
-
-
enum AnEnum: Equatable {
-    static func ==(lhs: AnEnum, rhs: AnEnum) -> Bool {
-        return true
-    }
-}
-
-

Triggering Examples

-
class AClass: NSObject {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
-
@objc class AClass: SomeOtherNSObjectSubclass {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return true
-    }
-}
-
-
class AClass: NSObject, Equatable {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
-
class AClass: NSObject {
-    override func isEqual(_ object: Any?) -> Bool {
-        guard let other = object as? AClass else {
-            return false
-        }
-        return true
-    }
-
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/number_separator.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/number_separator.html deleted file mode 100644 index 48de3a7cd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/number_separator.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - number_separator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Number Separator

- -

Underscores should be used as thousand separator in large numbers with a configurable number of digits. In other words, there should be an underscore after every 3 digits in the integral as well as the fractional part of a number.

- -
    -
  • Identifier: number_separator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -minimum_length - -0 -
    -exclude_ranges - -[] -
  • -
-

Non Triggering Examples

-
let foo = -100
-
-
let foo = -1_000
-
-
let foo = -1_000_000
-
-
let foo = -1.0001
-
-
let foo = -1_000_000.0000001
-
-
let binary = -0b10000
-
-
let binary = -0b1000_0001
-
-
let hex = -0xA
-
-
let hex = -0xAA_BB
-
-
let octal = -0o21
-
-
let octal = -0o21_1
-
-
let exp = -1_000_000.000000e2
-
-
let foo: Double = -(200)
-
-
let foo: Double = -(200 / 447.214)
-
-
let foo = -6.2832e-6
-
-
let foo = +100
-
-
let foo = +1_000
-
-
let foo = +1_000_000
-
-
let foo = +1.0001
-
-
let foo = +1_000_000.0000001
-
-
let binary = +0b10000
-
-
let binary = +0b1000_0001
-
-
let hex = +0xA
-
-
let hex = +0xAA_BB
-
-
let octal = +0o21
-
-
let octal = +0o21_1
-
-
let exp = +1_000_000.000000e2
-
-
let foo: Double = +(200)
-
-
let foo: Double = +(200 / 447.214)
-
-
let foo = +6.2832e-6
-
-
let foo = 100
-
-
let foo = 1_000
-
-
let foo = 1_000_000
-
-
let foo = 1.0001
-
-
let foo = 1_000_000.0000001
-
-
let binary = 0b10000
-
-
let binary = 0b1000_0001
-
-
let hex = 0xA
-
-
let hex = 0xAA_BB
-
-
let octal = 0o21
-
-
let octal = 0o21_1
-
-
let exp = 1_000_000.000000e2
-
-
let foo: Double = (200)
-
-
let foo: Double = (200 / 447.214)
-
-
let foo = 6.2832e-6
-
-

Triggering Examples

-
let foo = -↓10_0
-
-
let foo = -↓1000
-
-
let foo = -↓1000e2
-
-
let foo = -↓1000E2
-
-
let foo = -↓1__000
-
-
let foo = -↓1.0001
-
-
let foo = -↓1_000_000.000000_1
-
-
let foo = -↓1000000.000000_1
-
-
let foo = -↓6.2832e-6
-
-
let foo = +↓10_0
-
-
let foo = +↓1000
-
-
let foo = +↓1000e2
-
-
let foo = +↓1000E2
-
-
let foo = +↓1__000
-
-
let foo = +↓1.0001
-
-
let foo = +↓1_000_000.000000_1
-
-
let foo = +↓1000000.000000_1
-
-
let foo = +↓6.2832e-6
-
-
let foo = ↓10_0
-
-
let foo = ↓1000
-
-
let foo = ↓1000e2
-
-
let foo = ↓1000E2
-
-
let foo = ↓1__000
-
-
let foo = ↓1.0001
-
-
let foo = ↓1_000_000.000000_1
-
-
let foo = ↓1000000.000000_1
-
-
let foo = ↓6.2832e-6
-
-
let foo: Double = -(↓100000)
-
-
let foo: Double = -(↓10.000000_1)
-
-
let foo: Double = -(↓123456 / ↓447.214214)
-
-
let foo: Double = +(↓100000)
-
-
let foo: Double = +(↓10.000000_1)
-
-
let foo: Double = +(↓123456 / ↓447.214214)
-
-
let foo: Double = (↓100000)
-
-
let foo: Double = (↓10.000000_1)
-
-
let foo: Double = (↓123456 / ↓447.214214)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/object_literal.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/object_literal.html deleted file mode 100644 index 82bccb1a6..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/object_literal.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - object_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Object Literal

- -

Prefer object literals over image and color inits

- -
    -
  • Identifier: object_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -image_literal - -true -
    -color_literal - -true -
  • -
-

Non Triggering Examples

-
let image = #imageLiteral(resourceName: "image.jpg")
-
-
let color = #colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
let image = UIImage(named: aVariable)
-
-
let image = UIImage(named: "interpolated \(variable)")
-
-
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
-
-
let image = NSImage(named: aVariable)
-
-
let image = NSImage(named: "interpolated \(variable)")
-
-
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
-
-

Triggering Examples

-
let image = ↓UIImage(named: "foo")
-
-
let color = ↓UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓UIColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓UIColor(white: 0.5, alpha: 1)
-
-
let image = ↓NSImage(named: "foo")
-
-
let color = ↓NSColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓NSColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓NSColor(white: 0.5, alpha: 1)
-
-
let image = ↓UIImage.init(named: "foo")
-
-
let color = ↓UIColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓UIColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓UIColor.init(white: 0.5, alpha: 1)
-
-
let image = ↓NSImage.init(named: "foo")
-
-
let color = ↓NSColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓NSColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓NSColor.init(white: 0.5, alpha: 1)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/one_declaration_per_file.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/one_declaration_per_file.html deleted file mode 100644 index dcd34e39e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/one_declaration_per_file.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - one_declaration_per_file Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

One Declaration per File

- -

Only a single declaration is allowed in a file

- -
    -
  • Identifier: one_declaration_per_file
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {}
-
-
class Foo {}
-extension Foo {}
-
-
struct S {
-    struct N {}
-}
-
-

Triggering Examples

-
class Foo {}
-↓class Bar {}
-
-
protocol Foo {}
-↓enum Bar {}
-
-
struct Foo {}
-↓struct Bar {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/opening_brace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/opening_brace.html deleted file mode 100644 index 1fba4c611..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/opening_brace.html +++ /dev/null @@ -1,628 +0,0 @@ - - - - opening_brace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Opening Brace Spacing

- -

Opening braces should be preceded by a single space and on the same line as the declaration

- -
    -
  • Identifier: opening_brace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_multiline_func - -false -
  • -
-

Non Triggering Examples

-
func abc() {
-}
-
-
[].map() { $0 }
-
-
[].map({ })
-
-
if let a = b { }
-
-
while a == b { }
-
-
guard let a = b else { }
-
-
struct Rule {}
-
-
struct Parent {
-    struct Child {
-        let foo: Int
-    }
-}
-
-
func f(rect: CGRect) {
-    {
-        let centre = CGPoint(x: rect.midX, y: rect.midY)
-        print(centre)
-    }()
-}
-
-
func f(rect: CGRect) -> () -> Void {
-    {
-        let centre = CGPoint(x: rect.midX, y: rect.midY)
-        print(centre)
-    }
-}
-
-
func f() -> () -> Void {
-    {}
-}
-
-
class Rule:
-  NSObject {
-  var a: String {
-    return ""
-  }
-}
-
-
self.foo(
-    (
-        "String parameter",
-        { "Do something here" }
-    )
-)
-
-
let pattern = #/(\{(?<key>\w+)\})/#
-
-
if c {}
-else {}
-
-

Triggering Examples

-
func abc()↓{
-}
-
-
func abc()
-    ↓{ }
-
-
func abc(a: A,
-    b: B)
-↓{
-
-
[].map()↓{ $0 }
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button(action: {
-      self.showOptions.toggle()
-    })↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button(action: {
-      self.showOptions.toggle()
-    })
-   ↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button {
-      self.showOptions.toggle()
-    } label:↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
if let a = b↓{ }
-
-
while a == b↓{ }
-
-
guard let a = b else↓{ }
-
-
if
-    let a = b,
-    let c = d
-    where a == c↓{ }
-
-
while
-    let a = b,
-    let c = d
-    where a == c↓{ }
-
-
guard
-    let a = b,
-    let c = d
-    where a == c else↓{ }
-
-
struct Rule↓{}
-
-
struct Rule
-↓{
-}
-
-
struct Rule
-
-    ↓{
-}
-
-
struct Parent {
-    struct Child
-    ↓{
-        let foo: Int
-    }
-}
-
-
switch a↓{}
-
-
if
-    let a = b,
-    let c = d,
-    a == c
-↓{ }
-
-
while
-    let a = b,
-    let c = d,
-    a == c
-↓{ }
-
-
guard
-    let a = b,
-    let c = d,
-    a == c else
-↓{ }
-
-
class Rule↓{}
-
-
-
actor Rule↓{}
-
-
-
enum Rule↓{}
-
-
-
protocol Rule↓{}
-
-
-
extension Rule↓{}
-
-
-
class Rule {
-  var a: String↓{
-    return ""
-  }
-}
-
-
class Rule {
-  var a: String {
-    willSet↓{
-
-    }
-    didSet  ↓{
-
-    }
-  }
-}
-
-
precedencegroup Group↓{
-  assignment: true
-}
-
-
if
-    "test".isEmpty
-↓{
-    // code here
-}
-
-
func fooFun() {
-    let foo: String? = "foo"
-    let bar: String? = "bar"
-
-    if
-        let foooo = foo,
-        let barrr = bar
-    ↓{
-        print(foooo + barrr)
-    }
-}
-
-
if
-    let a = ["A", "B"].first,
-    let b = ["B"].first
-↓{
-    print(a)
-}
-
-
if c  ↓{}
-else  ↓{}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_usage_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_usage_whitespace.html deleted file mode 100644 index 93eef7c29..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_usage_whitespace.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - operator_usage_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Operator Usage Whitespace

- -

Operators should be surrounded by a single whitespace when they are being used

- -
    -
  • Identifier: operator_usage_whitespace
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -lines_look_around - -2 -
    -skip_aligned_constants - -true -
    -allowed_no_space_operators - -[“…”, “..<”] -
  • -
-

Non Triggering Examples

-
let foo = 1 + 2
-
-
let foo = 1 > 2
-
-
let foo = !false
-
-
let foo: Int?
-
-
let foo: Array<String>
-
-
let model = CustomView<Container<Button>, NSAttributedString>()
-
-
let foo: [String]
-
-
let foo = 1 + 
-  2
-
-
let range = 1...3
-
-
let range = 1 ... 3
-
-
let range = 1..<3
-
-
#if swift(>=3.0)
-    foo()
-#endif
-
-
array.removeAtIndex(-200)
-
-
let name = "image-1"
-
-
button.setImage(#imageLiteral(resourceName: "image-1"), for: .normal)
-
-
let doubleValue = -9e-11
-
-
let foo = GenericType<(UIViewController) -> Void>()
-
-
let foo = Foo<Bar<T>, Baz>()
-
-
let foo = SignalProducer<Signal<Value, Error>, Error>([ self.signal, next ]).flatten(.concat)
-
-
"let foo =  1"
-
-
  enum Enum {
-  case hello   = 1
-  case hello2  = 1
-  }
-
-
let something = Something<GenericParameter1,
-                          GenericParameter2>()
-
-
return path.flatMap { path in
-    return compileCommands[path] ??
-        compileCommands[path.path(relativeTo: FileManager.default.currentDirectoryPath)]
-}
-
-
internal static func == (lhs: Vertex, rhs: Vertex) -> Bool {
-    return lhs.filePath == rhs.filePath
-        && lhs.originalRemoteString == rhs.originalRemoteString
-        && lhs.rootDirectory == rhs.rootDirectory
-}
-
-
internal static func == (lhs: Vertex, rhs: Vertex) -> Bool {
-    return lhs.filePath == rhs.filePath &&
-        lhs.originalRemoteString == rhs.originalRemoteString &&
-        lhs.rootDirectory == rhs.rootDirectory
-}
-
-
private static let pattern =
-    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
-    "|" +                       // or
-    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
-
-
private static let pattern =
-    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
-    "|"                       + // or
-    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
-
-
typealias Foo = Bar
-
-
protocol A {
-    associatedtype B = C
-}
-
-
tabbedViewController.title = nil
-
-

Triggering Examples

-
let foo = 1↓+2
-
-
let foo = 1↓   + 2
-
-
let foo = 1↓   +    2
-
-
let foo = 1↓ +    2
-
-
let foo↓=1↓+2
-
-
let foo↓=1 + 2
-
-
let foo↓=bar
-
-
let range = 1↓ ..<  3
-
-
let foo = bar↓   ?? 0
-
-
let foo = bar↓ !=  0
-
-
let foo = bar↓ !==  bar2
-
-
let v8 = Int8(1)↓  << 6
-
-
let v8 = 1↓ <<  (6)
-
-
let v8 = 1↓ <<  (6)
- let foo = 1 > 2
-
-
let foo↓  = [1]
-
-
let foo↓  = "1"
-
-
let foo↓ =  "1"
-
-
  enum Enum {
-  case one↓  =  1
-  case two  = 1
-  }
-
-
  enum Enum {
-  case one  = 1
-  case two↓  =  1
-  }
-
-
  enum Enum {
-  case one↓   = 1
-  case two↓  = 1
-  }
-
-
typealias Foo↓ =  Bar
-
-
protocol A {
-    associatedtype B↓  = C
-}
-
-
tabbedViewController.title↓  = nil
-
-
let foo = bar ? 0↓:1
-
-
let foo = bar↓ ?   0 : 1
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_whitespace.html deleted file mode 100644 index e2ad09fef..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/operator_whitespace.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - operator_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Operator Function Whitespace

- -

Operators should be surrounded by a single whitespace when defining them

- -
    -
  • Identifier: operator_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func <| (lhs: Int, rhs: Int) -> Int {}
-
-
func <|< <A>(lhs: A, rhs: A) -> A {}
-
-
func abc(lhs: Int, rhs: Int) -> Int {}
-
-

Triggering Examples

-
↓func <|(lhs: Int, rhs: Int) -> Int {}
-
-
↓func <|<<A>(lhs: A, rhs: A) -> A {}
-
-
↓func <|  (lhs: Int, rhs: Int) -> Int {}
-
-
↓func <|<  <A>(lhs: A, rhs: A) -> A {}
-
-
↓func  <| (lhs: Int, rhs: Int) -> Int {}
-
-
↓func  <|< <A>(lhs: A, rhs: A) -> A {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/optional_enum_case_matching.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/optional_enum_case_matching.html deleted file mode 100644 index e6d506ca2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/optional_enum_case_matching.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - optional_enum_case_matching Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Optional Enum Case Match

- -

Matching an enum case against an optional enum without ‘?’ is supported on Swift 5.1 and above

- -
    -
  • Identifier: optional_enum_case_matching
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
- case .bar: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case (.bar, .baz): break
- case (.bar, _): break
- case (_, .baz): break
- default: break
-}
-
-
switch (x, y) {
-case (.c, _?):
-    break
-case (.c, nil):
-    break
-case (_, _):
-    break
-}
-
-

Triggering Examples

-
switch foo {
- case .bar↓?: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case Foo.bar↓?: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case .bar↓?, .baz↓?: break
- default: break
-}
-
-
switch foo {
- case .bar↓? where x > 1: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case (.bar↓?, .baz↓?): break
- case (.bar↓?, _): break
- case (_, .bar↓?): break
- default: break
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/orphaned_doc_comment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/orphaned_doc_comment.html deleted file mode 100644 index 637c24022..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/orphaned_doc_comment.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - orphaned_doc_comment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Orphaned Doc Comment

- -

A doc comment should be attached to a declaration

- -
    -
  • Identifier: orphaned_doc_comment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/// My great property
-var myGreatProperty: String!
-
-
//////////////////////////////////////
-//
-// Copyright header.
-//
-//////////////////////////////////////
-
-
/// Look here for more info: https://github.com.
-var myGreatProperty: String!
-
-
/// Look here for more info:
-/// https://github.com.
-var myGreatProperty: String!
-
-

Triggering Examples

-
↓/// My great property
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-
-
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-// Not a doc string
-↓/// My great property
-// Not a doc string
-var myGreatProperty: String!
-
-
extension Nested {
-    ↓///
-    /// Look here for more info: https://github.com.
-
-    // Not a doc string
-    var myGreatProperty: String!
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/overridden_super_call.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/overridden_super_call.html deleted file mode 100644 index f7e27a3a8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/overridden_super_call.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - overridden_super_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Overridden Method Calls Super

- -

Some overridden methods should always call super.

- -
    -
  • Identifier: overridden_super_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -included - -[“*”] -
  • -
-

Non Triggering Examples

-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-    }
-}
-
-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {
-        self.method1()
-        super.viewWillAppear(animated)
-        self.method2()
-    }
-}
-
-
class VC: UIViewController {
-    override func loadView() {
-    }
-}
-
-
class Some {
-    func viewWillAppear(_ animated: Bool) {
-    }
-}
-
-
class VC: UIViewController {
-    override func viewDidLoad() {
-    defer {
-        super.viewDidLoad()
-        }
-    }
-}
-
-

Triggering Examples

-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {↓
-        //Not calling to super
-        self.method()
-    }
-}
-
-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {↓
-        super.viewWillAppear(animated)
-        //Other code
-        super.viewWillAppear(animated)
-    }
-}
-
-
class VC: UIViewController {
-    override func didReceiveMemoryWarning() {↓
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/override_in_extension.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/override_in_extension.html deleted file mode 100644 index 0651441e1..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/override_in_extension.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - override_in_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Override in Extension

- -

Extensions shouldn’t override declarations

- -
    -
  • Identifier: override_in_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension Person {
-  var age: Int { return 42 }
-}
-
-
extension Person {
-  func celebrateBirthday() {}
-}
-
-
class Employee: Person {
-  override func celebrateBirthday() {}
-}
-
-
class Foo: NSObject {}
-extension Foo {
-    override var description: String { return "" }
-}
-
-
struct Foo {
-    class Bar: NSObject {}
-}
-extension Foo.Bar {
-    override var description: String { return "" }
-}
-
-

Triggering Examples

-
extension Person {
-  override ↓var age: Int { return 42 }
-}
-
-
extension Person {
-  override ↓func celebrateBirthday() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/pattern_matching_keywords.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/pattern_matching_keywords.html deleted file mode 100644 index b7691e656..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/pattern_matching_keywords.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - pattern_matching_keywords Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Pattern Matching Keywords

- -

Combine multiple pattern matching bindings by moving keywords out of tuples

- -
    -
  • Identifier: pattern_matching_keywords
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-    default: break
-}
-
-
switch foo {
-    case 1: break
-}
-
-
switch foo {
-    case bar: break
-}
-
-
switch foo {
-    case let (x, y): break
-}
-
-
switch foo {
-    case .foo(let x): break
-}
-
-
switch foo {
-    case let .foo(x, y): break
-}
-
-
switch foo {
-    case .foo(let x), .bar(let x): break
-}
-
-
switch foo {
-    case .foo(let x, var y): break
-}
-
-
switch foo {
-    case var (x, y): break
-}
-
-
switch foo {
-    case .foo(var x): break
-}
-
-
switch foo {
-    case var .foo(x, y): break
-}
-
-
switch foo {
-    case (y, let x, z): break
-}
-
-

Triggering Examples

-
switch foo {
-    case (↓let x,  ↓let y): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, .foo): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, _): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, f()): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, s.f()): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, s.t): break
-}
-
-
switch foo {
-    case .foo(↓let x, ↓let y): break
-}
-
-
switch foo {
-    case (.yamlParsing(↓let x), .yamlParsing(↓let y)): break
-}
-
-
switch foo {
-    case (↓var x,  ↓var y): break
-}
-
-
switch foo {
-    case .foo(↓var x, ↓var y): break
-}
-
-
switch foo {
-    case (.yamlParsing(↓var x), .yamlParsing(↓var y)): break
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/period_spacing.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/period_spacing.html deleted file mode 100644 index 4bd90663c..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/period_spacing.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - period_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Period Spacing

- -

Periods should not be followed by more than one space

- -
    -
  • Identifier: period_spacing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let pi = 3.2
-
-
let pi = Double.pi
-
-
let pi = Double. pi
-
-
let pi = Double.  pi
-
-
// A. Single.
-
-
///   - code: Identifier of the error. Integer.
-
-
// value: Multiline.
-//        Comment.
-
-
/**
-Sentence ended in period.
-
-- Sentence 2 new line characters after.
-**/
-
-

Triggering Examples

-
/* Only god knows why. ↓ This symbol does nothing. */
-
-
// Only god knows why. ↓ This symbol does nothing.
-
-
// Single. Double. ↓ End.
-
-
// Single. Double. ↓ Triple. ↓  End.
-
-
// Triple. ↓  Quad. ↓   End.
-
-
///   - code: Identifier of the error. ↓ Integer.
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_nimble.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_nimble.html deleted file mode 100644 index df0b3df60..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_nimble.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - prefer_nimble Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Nimble

- -

Prefer Nimble matchers over XCTAssert functions

- -
    -
  • Identifier: prefer_nimble
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
expect(foo) == 1
-
-
expect(foo).to(equal(1))
-
-

Triggering Examples

-
↓XCTAssertTrue(foo)
-
-
↓XCTAssertEqual(foo, 2)
-
-
↓XCTAssertNotEqual(foo, 2)
-
-
↓XCTAssertNil(foo)
-
-
↓XCTAssert(foo)
-
-
↓XCTAssertGreaterThan(foo, 10)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_in_static_references.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_in_static_references.html deleted file mode 100644 index b55fb9fdf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_in_static_references.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - prefer_self_in_static_references Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Self in Static References

- -

Use Self to refer to the surrounding type name

- -
    -
  • Identifier: prefer_self_in_static_references
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    class C {
-        static let primes = [2, 3, 5, 7]
-        func isPrime(i: Int) -> Bool { Self.primes.contains(i) }
-
-
    struct T {
-        static let i = 0
-    }
-    struct S {
-        static let i = 0
-    }
-    extension T {
-        static let j = S.i + T.i
-        static let k = { T.j }()
-    }
-
-
    class `Self` {
-        static let i = 0
-        func f() -> Int { Self.i }
-    }
-
-

Triggering Examples

-
final class CheckCellView: NSTableCellView {
-  @IBOutlet var checkButton: NSButton!
-
-  override func awakeFromNib() {
-    checkButton.action = #selector(↓CheckCellView.check(_:))
-  }
-
-  @objc func check(_ button: AnyObject?) {}
-}
-
-
    class C {
-        static let i = 1
-        var j: Int {
-            let ii = ↓C.i
-            return ii
-        }
-    }
-
-
    class C {
-        func f() {
-            _ = [↓C]()
-            _ = [Int: ↓C]()
-        }
-    }
-
-
    struct S {
-        let j: Int
-        static let i = 1
-        static func f() -> Int { ↓S.i }
-        func g() -> Any { ↓S.self }
-        func h() -> ↓S { ↓S(j: 2) }
-        func i() -> KeyPath<↓S, Int> { \↓S.j }
-        func j(@Wrap(-↓S.i, ↓S.i) n: Int = ↓S.i) {}
-    }
-
-
    struct S {
-        struct T {
-            static let i = 3
-        }
-        struct R {
-            static let j = S.T.i
-        }
-        static let h = ↓S.T.i + ↓S.R.j
-    }
-
-
    enum E {
-        case A
-        static func f() -> ↓E { ↓E.A }
-        static func g() -> ↓E { ↓E.f() }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html deleted file mode 100644 index 0d9ae1f67..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - prefer_self_type_over_type_of_self Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Self Type Over Type of Self

- -

Prefer Self over type(of: self) when accessing properties or calling methods

- -
    -
  • Identifier: prefer_self_type_over_type_of_self
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    func bar() {
-        Self.baz()
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(Self.baz)
-    }
-}
-
-
class A {
-    func foo(param: B) {
-        type(of: param).bar()
-    }
-}
-
-
class A {
-    func foo() {
-        print(type(of: self))
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    func bar() {
-        ↓type(of: self).baz()
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(↓type(of: self).baz)
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(↓Swift.type(of: self).baz)
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html deleted file mode 100644 index 7aac798a3..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - prefer_zero_over_explicit_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Zero Over Explicit Init

- -

Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0))

- -
    -
  • Identifier: prefer_zero_over_explicit_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGRect(x: 0, y: 0, width: 0, height: 1)
-
-
CGPoint(x: 0, y: -1)
-
-
CGSize(width: 2, height: 4)
-
-
CGVector(dx: -5, dy: 0)
-
-
UIEdgeInsets(top: 0, left: 1, bottom: 0, right: 1)
-
-

Triggering Examples

-
↓CGPoint(x: 0, y: 0)
-
-
↓CGPoint(x: 0.000000, y: 0)
-
-
↓CGPoint(x: 0.000000, y: 0.000)
-
-
↓CGRect(x: 0, y: 0, width: 0, height: 0)
-
-
↓CGSize(width: 0, height: 0)
-
-
↓CGVector(dx: 0, dy: 0)
-
-
↓UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html deleted file mode 100644 index 3cc184ba6..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - prefixed_toplevel_constant Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefixed Top-Level Constant

- -

Top-level constants should be prefixed by k

- -
    -
  • Identifier: prefixed_toplevel_constant
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_private - -false -
  • -
-

Non Triggering Examples

-
private let kFoo = 20.0
-
-
public let kFoo = false
-
-
internal let kFoo = "Foo"
-
-
let kFoo = true
-
-
let Foo = true
-
-
struct Foo {
-    let bar = 20.0
-}
-
-
private var foo = 20.0
-
-
public var foo = false
-
-
internal var foo = "Foo"
-
-
var foo = true
-
-
var foo = true, bar = true
-
-
var foo = true, let kFoo = true
-
-
let
-    kFoo = true
-
-
var foo: Int {
-    return a + b
-}
-
-
let kFoo = {
-    return a + b
-}()
-
-
var foo: String {
-    let bar = ""
-    return bar
-}
-
-
if condition() {
-    let result = somethingElse()
-    print(result)
-    exit()
-}
-
-
[1, 2, 3, 1000, 4000].forEach { number in
-    let isSmall = number < 10
-    if isSmall {
-        print("\(number) is a small number")
-    }
-}
-
-

Triggering Examples

-
private let ↓Foo = 20.0
-
-
public let ↓Foo = false
-
-
internal let ↓Foo = "Foo"
-
-
let ↓Foo = true
-
-
let ↓foo = 2, ↓bar = true
-
-
let
-    ↓foo = true
-
-
let ↓foo = {
-    return a + b
-}()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_action.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_action.html deleted file mode 100644 index 35559bfe9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_action.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - private_action Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Actions

- -

IBActions should be private

- -
    -
  • Identifier: private_action
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    @IBAction private func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction private func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
-}
-
-
private extension Foo {
-    @IBAction func barButtonTapped(_ sender: UIButton) {}
-}
-
-
fileprivate extension Foo {
-    @IBAction func barButtonTapped(_ sender: UIButton) {}
-}
-
-

Triggering Examples

-
class Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
public extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
internal extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_outlet.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_outlet.html deleted file mode 100644 index 30bef4d3b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_outlet.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - private_outlet Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Outlets

- -

IBOutlets should be private to avoid leaking UIKit to higher layers

- -
    -
  • Identifier: private_outlet
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_private_set - -false -
  • -
-

Non Triggering Examples

-
class Foo { @IBOutlet private var label: UILabel? }
-
-
class Foo { @IBOutlet private var label: UILabel! }
-
-
class Foo { var notAnOutlet: UILabel }
-
-
class Foo { @IBOutlet weak private var label: UILabel? }
-
-
class Foo { @IBOutlet private weak var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate weak var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) var label: UILabel! }
-
-
class Foo { @IBOutlet weak private(set) var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) weak var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate(set) weak var label: UILabel? }
-
-

Triggering Examples

-
class Foo { @IBOutlet ↓var label: UILabel? }
-
-
class Foo { @IBOutlet ↓var label: UILabel! }
-
-
class Foo { @IBOutlet private(set) ↓var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate(set) ↓var label: UILabel? }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_over_fileprivate.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_over_fileprivate.html deleted file mode 100644 index be72c0f6d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_over_fileprivate.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - private_over_fileprivate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private over Fileprivate

- -

Prefer private over fileprivate declarations

- -
    -
  • Identifier: private_over_fileprivate
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -validate_extensions - -false -
  • -
-

Non Triggering Examples

-
extension String {}
-
-
private extension String {}
-
-
public 
- enum MyEnum {}
-
-
open extension 
- String {}
-
-
internal extension String {}
-
-
extension String {
-  fileprivate func Something(){}
-}
-
-
class MyClass {
-  fileprivate let myInt = 4
-}
-
-
actor MyActor {
-  fileprivate let myInt = 4
-}
-
-
class MyClass {
-  fileprivate(set) var myInt = 4
-}
-
-
struct Outter {
-  struct Inter {
-    fileprivate struct Inner {}
-  }
-}
-
-

Triggering Examples

-
↓fileprivate enum MyEnum {}
-
-
↓fileprivate class MyClass {
-  fileprivate(set) var myInt = 4
-}
-
-
↓fileprivate actor MyActor {
-  fileprivate let myInt = 4
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_subject.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_subject.html deleted file mode 100644 index dab40ad62..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_subject.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - private_subject Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Combine Subject

- -

Combine Subject should be private

- -
    -
  • Identifier: private_subject
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
final class Foobar {
-    private let goodSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    fileprivate let goodSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    fileprivate let goodSubject: CurrentValueSubject<String, Never>
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<String, Never> = .init("toto")
-}
-
-
final class Foobar {
-    private let goodSubject = PassthroughSubject<Set<String>, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Set<String>, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Set<String>, Never> = .init([])
-}
-
-
final class Foobar {
-    private let goodSubject =
-        PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject:
-        PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject =
-        CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    init() {
-        let goodSubject = CurrentValueSubject<Bool, Never>(true)
-        self.goosSubject = goodSubject
-    }
-}
-
-
func foo() {
-    let goodSubject = PassthroughSubject<Bool, Never>(true)
-}
-
-

Triggering Examples

-
final class Foobar {
-    let ↓badSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let goodSubject: PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never>
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-    private let goodSubject: PassthroughSubject<Bool, Never>
-    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject = CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    let ↓badSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    let goodSubject: CurrentValueSubject<String, Never> = .init("toto")
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    let ↓badSubject = PassthroughSubject<Set<String>, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject: PassthroughSubject<Set<String>, Never> = .init()
-}
-
-
final class Foobar {
-    let ↓badSubject: CurrentValueSubject<Set<String>, Never> = .init([])
-}
-
-
final class Foobar {
-    let ↓badSubject =
-        PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject:
-        PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    let ↓badSubject =
-        CurrentValueSubject<Bool, Never>(true)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_swiftui_state.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_swiftui_state.html deleted file mode 100644 index 7d6c7b084..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_swiftui_state.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - private_swiftui_state Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private SwiftUI State Properties

- -

SwiftUI state properties should be private

- -
    -
  • Identifier: private_swiftui_state
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyApp: App {
-    @State private var isPlaying: Bool = false
-}
-
-
struct MyScene: Scene {
-    @State private var isPlaying: Bool = false
-}
-
-
struct CofntentView: View {
-    @State private var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    @State private var isPlaying: Bool = false
-
-    struct InnerView: View {
-        @State private var showsIndicator: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-
-    @State var nonTriggeringState: Bool = false
-}
-
-
struct ContentView: View {
-    var s: Int {
-        @State
-        var s: Int = 3
-        return s
-    }
-
-    var body: some View { Text("") }
-}
-
-
struct ContentView: View {
-    var isPlaying = false
-}
-
-
struct MyApp: App {
-    @StateObject private var model = DataModel()
-}
-
-
struct MyScene: Scene {
-    @StateObject private var model = DataModel()
-}
-
-
struct ContentView: View {
-    @StateObject private var model = DataModel()
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @StateObject private var dataModel = DataModel()
-    }
-
-    @StateObject var nonTriggeringObject = MyModel()
-}
-
-
struct Foo {
-    @State var bar = false
-}
-
-
class Foo: ObservableObject {
-    @State var bar = Bar()
-}
-
-
extension MyObject {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-}
-
-
actor ContentView: View {
-    @State private var isPlaying: Bool = false
-}
-
-

Triggering Examples

-
struct MyApp: App {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyScene: Scene {
-    @State ↓public var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    struct InnerView: View {
-        @State private var showsIndicator: Bool = false
-    }
-
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-
-    @State var isPlaying: Bool = false
-}
-
-
final class ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
extension MyObject {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-}
-
-
actor ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyApp: App {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct MyScene: Scene {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct ContentView: View {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct ContentView: View {
-    @State ↓private(set) var isPlaying = false
-
-
struct ContentView: View {
-    @State ↓fileprivate(set) public var isPlaying = false
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_unit_test.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_unit_test.html deleted file mode 100644 index 7b2aa8b58..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/private_unit_test.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - private_unit_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Unit Test

- -

Unit tests marked private are silently skipped

- -
    -
  • Identifier: private_unit_test
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
    -regex - -“XCTestCase” -
  • -
-

Non Triggering Examples

-
class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
internal class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
public class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
@objc private class FooTest: XCTestCase {
-    @objc private func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
private class Foo: NSObject {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
private class Foo {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
public class FooTest: XCTestCase {
-    private func test1(param: Int) {}
-    private func test2() -> String { "" }
-    private func atest() {}
-    private static func test3() {}
-}
-
-

Triggering Examples

-
private ↓class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private func test4() {}
-}
-
-
class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
-
internal class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
-
public class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_interface_builder.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_interface_builder.html deleted file mode 100644 index 3334fc2e9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_interface_builder.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - prohibited_interface_builder Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prohibited Interface Builder

- -

Creating views using Interface Builder should be avoided

- -
    -
  • Identifier: prohibited_interface_builder
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-    var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @objc func buttonTapped(_ sender: UIButton) {}
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet ↓var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @IBAction ↓func buttonTapped(_ sender: UIButton) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_super_call.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_super_call.html deleted file mode 100644 index 31182923a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/prohibited_super_call.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - prohibited_super_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prohibited Calls to Super

- -

Some methods should not call super.

- -
    -
  • Identifier: prohibited_super_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -included - -[“*”] -
  • -
-

Non Triggering Examples

-
class VC: UIViewController {
-    override func loadView() {
-    }
-}
-
-
class NSView {
-    func updateLayer() {
-        self.method1()
-    }
-}
-
-
public class FileProviderExtension: NSFileProviderExtension {
-    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {
-        guard let identifier = persistentIdentifierForItem(at: url) else {
-            completionHandler(NSFileProviderError(.noSuchItem))
-            return
-        }
-    }
-}
-
-

Triggering Examples

-
class VC: UIViewController {
-    override func loadView() {↓
-        super.loadView()
-    }
-}
-
-
class VC: NSFileProviderExtension {
-    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {↓
-        self.method1()
-        super.providePlaceholder(at:url, completionHandler: completionHandler)
-    }
-}
-
-
class VC: NSView {
-    override func updateLayer() {↓
-        self.method1()
-        super.updateLayer()
-        self.method2()
-    }
-}
-
-
class VC: NSView {
-    override func updateLayer() {↓
-        defer {
-            super.updateLayer()
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/protocol_property_accessors_order.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/protocol_property_accessors_order.html deleted file mode 100644 index a063da82e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/protocol_property_accessors_order.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - protocol_property_accessors_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Protocol Property Accessors Order

- -

When declaring properties in protocols, the order of accessors should be get set

- -
    -
  • Identifier: protocol_property_accessors_order
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol Foo {
- var bar: String { get set }
- }
-
-
protocol Foo {
- var bar: String { get }
- }
-
-
protocol Foo {
- var bar: String { set }
- }
-
-

Triggering Examples

-
protocol Foo {
- var bar: String { ↓set get }
- }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_call.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_call.html deleted file mode 100644 index 1c32bae36..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_call.html +++ /dev/null @@ -1,682 +0,0 @@ - - - - quick_discouraged_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Call

- -

Discouraged call inside ‘describe’ and/or ‘context’ block.

- -
    -
  • Identifier: quick_discouraged_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests {
-   override func spec() {
-       describe("foo") {
-           let foo = Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           beforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           beforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-           afterEach {
-               let foo = Foo()
-               foo.toto()
-           }
-           describe("bar") {
-           }
-           context("bar") {
-           }
-           it("bar") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           justBeforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           aroundEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-          itBehavesLike("bar")
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           it("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xcontext("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xdescribe("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           xit("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fcontext("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fdescribe("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           fit("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xitBehavesLike("foo")
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override static func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("foo") {
-               let foo = ↓Foo()
-           }
-           context("bar") {
-               let foo = ↓Foo()
-               ↓foo.bar()
-               it("does something") {
-                   let foo = Foo()
-                   foo.toto()
-               }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("foo") {
-               context("foo") {
-                   beforeEach {
-                       let foo = Foo()
-                       foo.toto()
-                   }
-                   it("bar") {
-                   }
-                   context("foo") {
-                       let foo = ↓Foo()
-                   }
-               }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       sharedExamples("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       sharedExamples("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xdescribe("foo") {
-           let foo = ↓Foo()
-       }
-       fdescribe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xcontext("foo") {
-           let foo = ↓Foo()
-       }
-       fcontext("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       xcontext("foo") {
-           let foo = ↓Foo()
-       }
-       fcontext("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html deleted file mode 100644 index ec640b0f7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - quick_discouraged_focused_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Focused Test

- -

Non-focused tests won’t run as long as this test is focused

- -
    -
  • Identifier: quick_discouraged_focused_test
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           describe("bar") { }
-           context("bar") {
-               it("bar") { }
-           }
-           it("bar") { }
-           itBehavesLike("bar")
-       }
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fdescribe("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fcontext("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fit("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓fit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓fit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("bar") {
-               ↓fit("toto") { }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       ↓fitBehavesLike("foo")
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html deleted file mode 100644 index 5319fee84..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - quick_discouraged_pending_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Pending Test

- -

This test won’t run as long as it’s marked pending

- -
    -
  • Identifier: quick_discouraged_pending_test
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           describe("bar") { }
-           context("bar") {
-               it("bar") { }
-           }
-           it("bar") { }
-           itBehavesLike("bar")
-       }
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xdescribe("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xcontext("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xit("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓xit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓xit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("bar") {
-               ↓xit("toto") { }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓pending("foo")
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       ↓xitBehavesLike("foo")
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html deleted file mode 100644 index 57c92fc3a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - raw_value_for_camel_cased_codable_enum Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Raw Value for Camel Cased Codable Enum

- -

Camel cased cases of Codable String enums should have raw values

- -
    -
  • Identifier: raw_value_for_camel_cased_codable_enum
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers: Codable {
-  case int(Int)
-  case short(Int16)
-}
-
-
enum Numbers: Int, Codable {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: Double, Codable {
-  case one = 1.1
-  case two = 2.2
-}
-
-
enum Numbers: String, Codable {
-  case one = "one"
-  case two = "two"
-}
-
-
enum Status: String, Codable {
-    case OK, ACCEPTABLE
-}
-
-
enum Status: String, Codable {
-    case ok
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String {
-    case ok
-    case notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: Int, Codable {
-    case ok
-    case notAcceptable
-    case maybeAcceptable = -1
-}
-
-

Triggering Examples

-
enum Status: String, Codable {
-    case ok
-    case ↓notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Decodable {
-   case ok
-   case ↓notAcceptable
-   case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Encodable {
-   case ok
-   case ↓notAcceptable
-   case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Codable {
-    case ok
-    case ↓notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_boolean.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_boolean.html deleted file mode 100644 index c221864c5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_boolean.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - reduce_boolean Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Reduce Boolean

- -

Prefer using .allSatisfy() or .contains() over reduce(true) or reduce(false).

- -
    -
  • Identifier: reduce_boolean
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
nums.reduce(0) { $0.0 + $0.1 }
-
-
nums.reduce(0.0) { $0.0 + $0.1 }
-
-
nums.reduce(initial: true) { $0.0 && $0.1 == 3 }
-
-

Triggering Examples

-
let allNines = nums.↓reduce(true) { $0.0 && $0.1 == 9 }
-
-
let anyNines = nums.↓reduce(false) { $0.0 || $0.1 == 9 }
-
-
let allValid = validators.↓reduce(true) { $0 && $1(input) }
-
-
let anyValid = validators.↓reduce(false) { $0 || $1(input) }
-
-
let allNines = nums.↓reduce(true, { $0.0 && $0.1 == 9 })
-
-
let anyNines = nums.↓reduce(false, { $0.0 || $0.1 == 9 })
-
-
let allValid = validators.↓reduce(true, { $0 && $1(input) })
-
-
let anyValid = validators.↓reduce(false, { $0 || $1(input) })
-
-
nums.reduce(into: true) { (r: inout Bool, s) in r = r && (s == 3) }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_into.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_into.html deleted file mode 100644 index cec08ec2d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/reduce_into.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - reduce_into Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Reduce into

- -

Prefer reduce(into:_:) over reduce(_:_:) for copy-on-write types

- -
    -
  • Identifier: reduce_into
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = values.reduce(into: "abc") { $0 += "\($1)" }
-
-
values.reduce(into: Array<Int>()) { result, value in
-    result.append(value)
-}
-
-
let rows = violations.enumerated().reduce(into: "") { rows, indexAndViolation in
-    rows.append(generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1))
-}
-
-
zip(group, group.dropFirst()).reduce(into: []) { result, pair in
-    result.append(pair.0 + pair.1)
-}
-
-
let foo = values.reduce(into: [String: Int]()) { result, value in
-    result["\(value)"] = value
-}
-
-
let foo = values.reduce(into: Dictionary<String, Int>.init()) { result, value in
-    result["\(value)"] = value
-}
-
-
let foo = values.reduce(into: [Int](repeating: 0, count: 10)) { result, value in
-    result.append(value)
-}
-
-
let foo = values.reduce(MyClass()) { result, value in
-    result.handleValue(value)
-    return result
-}
-
-

Triggering Examples

-
let bar = values.↓reduce("abc") { $0 + "\($1)" }
-
-
values.↓reduce(Array<Int>()) { result, value in
-    result += [value]
-}
-
-
[1, 2, 3].↓reduce(Set<Int>()) { acc, value in
-    var result = acc
-    result.insert(value)
-    return result
-}
-
-
let rows = violations.enumerated().↓reduce("") { rows, indexAndViolation in
-    return rows + generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1)
-}
-
-
zip(group, group.dropFirst()).↓reduce([]) { result, pair in
-    result + [pair.0 + pair.1]
-}
-
-
let foo = values.↓reduce([String: Int]()) { result, value in
-    var result = result
-    result["\(value)"] = value
-    return result
-}
-
-
let bar = values.↓reduce(Dictionary<String, Int>.init()) { result, value in
-    var result = result
-    result["\(value)"] = value
-    return result
-}
-
-
let bar = values.↓reduce([Int](repeating: 0, count: 10)) { result, value in
-    return result + [value]
-}
-
-
extension Data {
-    var hexString: String {
-        return ↓reduce("") { (output, byte) -> String in
-            output + String(format: "%02x", byte)
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_discardable_let.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_discardable_let.html deleted file mode 100644 index 05ab78043..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_discardable_let.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - redundant_discardable_let Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Discardable Let

- -

Prefer _ = foo() over let _ = foo() when discarding a result from a function

- -
    -
  • Identifier: redundant_discardable_let
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
_ = foo()
-
-
if let _ = foo() { }
-
-
guard let _ = foo() else { return }
-
-
let _: ExplicitType = foo()
-
-
while let _ = SplashStyle(rawValue: maxValue) { maxValue += 1 }
-
-
async let _ = await foo()
-
-

Triggering Examples

-
↓let _ = foo()
-
-
if _ = foo() { ↓let _ = bar() }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_nil_coalescing.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_nil_coalescing.html deleted file mode 100644 index accac1d11..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_nil_coalescing.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - redundant_nil_coalescing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Nil Coalescing

- -

nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant

- -
    -
  • Identifier: redundant_nil_coalescing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var myVar: Int?; myVar ?? 0
-
-

Triggering Examples

-
var myVar: Int? = nil; myVar ↓?? nil
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_objc_attribute.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_objc_attribute.html deleted file mode 100644 index deae65214..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_objc_attribute.html +++ /dev/null @@ -1,580 +0,0 @@ - - - - redundant_objc_attribute Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant @objc Attribute

- -

Objective-C attribute (@objc) is redundant in declaration

- -
    -
  • Identifier: redundant_objc_attribute
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
@objc private var foo: String? {}
-
-
@IBInspectable private var foo: String? {}
-
-
@objc private func foo(_ sender: Any) {}
-
-
@IBAction private func foo(_ sender: Any) {}
-
-
@GKInspectable private var foo: String! {}
-
-
private @GKInspectable var foo: String! {}
-
-
@NSManaged var foo: String!
-
-
@objc @NSCopying var foo: String!
-
-
@objcMembers
-class Foo {
-    var bar: Any?
-    @objc
-    class Bar: NSObject {
-        @objc
-        var foo: Any?
-    }
-}
-
-
@objc
-extension Foo {
-    var bar: Int {
-        return 0
-    }
-}
-
-
extension Foo {
-    @objc
-    var bar: Int { return 0 }
-}
-
-
@objc @IBDesignable
-extension Foo {
-    var bar: Int { return 0 }
-}
-
-
@IBDesignable
-extension Foo {
-    @objc
-    var bar: Int { return 0 }
-    var fooBar: Int { return 1 }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc
-    private var bar: Int {
-        return 0
-    }
-}
-
-
@objcMembers
-class Foo {
-    @objc
-    class Bar: NSObject {
-        @objc var foo: Any?
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc class Bar {}
-}
-
-
extension BlockEditorSettings {
-    @objc(addElementsObject:)
-    @NSManaged public func addToElements(_ value: BlockEditorSettingElement)
-}
-
-
@objcMembers
-public class Foo: NSObject {
-    @objc
-    private func handler(_ notification: Notification) {
-    }
-
-    func registerForNotifications() {
-        NotificationCenter.default.addObserver(self, selector: #selector(handler(_:)), name: nil, object: nil)
-    }
-}
-
-
class Foo: NSObject { }
-
-@objc extension Foo {
-    @objc enum Bar: Int {
-       case bar
-    }
-
-    var bar: Bar { .bar }
-}
-
-
class Foo: NSObject { }
-
-@objc extension Foo {
-    @objc private enum Baz: Int {
-      case baz
-    }
-
-    private var baz: Baz { .baz }
-}
-
-
@objcMembers
-internal class Foo: NSObject {
-    @objc
-    private var baz: Int = 1
-
-    var x: Any? {
-        value(forKey: "baz")
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc enum Bar: Int {
-       case bar
-    }
-}
-
-

Triggering Examples

-
↓@objc @IBInspectable private var foo: String? {}
-
-
@IBInspectable ↓@objc private var foo: String? {}
-
-
↓@objc @IBAction private func foo(_ sender: Any) {}
-
-
@IBAction ↓@objc private func foo(_ sender: Any) {}
-
-
↓@objc @GKInspectable private var foo: String! {}
-
-
@GKInspectable ↓@objc private var foo: String! {}
-
-
↓@objc @NSManaged private var foo: String!
-
-
@NSManaged ↓@objc private var foo: String!
-
-
↓@objc @IBDesignable class Foo {}
-
-
@objcMembers
-class Foo: NSObject {
-    ↓@objc var bar: Any?
-}
-
-
@objcMembers
-class Foo: NSObject {
-    ↓@objc var bar: Any?
-    ↓@objc var foo: Any?
-    @objc
-    class Bar {
-        @objc
-        var foo: Any?
-    }
-}
-
-
@objc
-extension Foo {
-    ↓@objc
-    var bar: Int {
-        return 0
-    }
-}
-
-
@objc @IBDesignable
-extension Foo {
-    ↓@objc
-    var bar: Int {
-        return 0
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objcMembers
-    class Bar: NSObject {
-        ↓@objc var foo: Any
-    }
-}
-
-
@objc
-extension Foo {
-    ↓@objc
-    private var bar: Int {
-        return 0
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_optional_initialization.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_optional_initialization.html deleted file mode 100644 index 57d4ac06e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_optional_initialization.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - redundant_optional_initialization Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Optional Initialization

- -

Initializing an optional variable with nil is redundant

- -
    -
  • Identifier: redundant_optional_initialization
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var myVar: Int?
-
-
let myVar: Int? = nil
-
-
var myVar: Int? = 0
-
-
func foo(bar: Int? = 0) { }
-
-
var myVar: Optional<Int>
-
-
let myVar: Optional<Int> = nil
-
-
var myVar: Optional<Int> = 0
-
-
var foo: Int? {
-  if bar != nil { }
-  return 0
-}
-
-
var foo: Int? = {
-  if bar != nil { }
-  return 0
-}()
-
-
lazy var test: Int? = nil
-
-
func funcName() {
-  var myVar: String?
-}
-
-
func funcName() {
-  let myVar: String? = nil
-}
-
-

Triggering Examples

-
var myVar: Int?↓ = nil
-
-
var myVar: Optional<Int>↓ = nil
-
-
var myVar: Int?↓=nil
-
-
var myVar: Optional<Int>↓=nil
-)
-
-
var myVar: String?↓ = nil {
-  didSet { print("didSet") }
-}
-
-
func funcName() {
-    var myVar: String?↓ = nil
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_self_in_closure.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_self_in_closure.html deleted file mode 100644 index f44b6dbc1..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_self_in_closure.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - redundant_self_in_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Self in Closure

- -

Explicit use of ‘self’ is not required

- -
    -
  • Identifier: redundant_self_in_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    struct S {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f {
-                x = 1
-                f { x = 1 }
-                g()
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [weak self] in
-                self?.x = 1
-                self?.g()
-                guard let self = self ?? C() else { return }
-                self?.x = 1
-            }
-            C().f { self.x = 1 }
-            f { [weak self] in if let self { x = 1 } }
-        }
-    }
-
-
    struct S {
-        var x = 0, error = 0, exception = 0
-        var y: Int?, z: Int?, u: Int, v: Int?, w: Int?
-        func f(_ work: @escaping (Int) -> Void) { work() }
-        func g(x: Int) {
-            f { u in
-                self.x = x
-                let x = 1
-                self.x = 2
-                if let y, let v {
-                    self.y = 3
-                    self.v = 1
-                }
-                guard let z else {
-                    let v = 4
-                    self.x = 5
-                    self.v = 6
-                    return
-                }
-                self.z = 7
-                while let v { self.v = 8 }
-                for w in [Int]() { self.w = 9 }
-                self.u = u
-                do {} catch { self.error = 10 }
-                do {} catch let exception { self.exception = 11 }
-            }
-        }
-    }
-
-
    enum E {
-        case a(Int)
-        case b(Int, Int)
-    }
-    struct S {
-        var x: E = .a(3), y: Int, z: Int
-        func f(_ work: @escaping () -> Void) { work() }
-        func g(x: Int) {
-            f {
-                switch x {
-                case let .a(y):
-                    self.y = 1
-                case .b(let y, var z):
-                    self.y = 2
-                    self.z = 3
-                }
-            }
-        }
-    }
-
-

Triggering Examples

-
    struct S {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f {
-                ↓self.x = 1
-                if ↓self.x == 1 { ↓self.g() }
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func g() {
-            {
-                ↓self.x = 1
-                ↓self.g()
-            }()
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [self] in
-                ↓self.x = 1
-                ↓self.g()
-                f { self.x = 1 }
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [unowned self] in ↓self.x = 1 }
-            f { [self = self] in ↓self.x = 1 }
-            f { [s = self] in s.x = 1 }
-        }
-    }
-
-
    struct S {
-        var x = 0
-        var y: Int?, z: Int?, v: Int?, w: Int?
-        func f(_ work: @escaping () -> Void) { work() }
-        func g(w: Int, _ v: Int) {
-            f {
-                self.w = 1
-                ↓self.x = 2
-                if let y { ↓self.x = 3 }
-                else { ↓self.y = 3 }
-                guard let z else {
-                    ↓self.z = 4
-                    ↓self.x = 5
-                    return
-                }
-                ↓self.y = 6
-                while let y { ↓self.x = 7 }
-                for y in [Int]() { ↓self.x = 8 }
-                self.v = 9
-                do {
-                    let x = 10
-                    self.x = 11
-                }
-                ↓self.x = 12
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [weak self] in
-                self?.x = 1
-                guard let self else { return }
-                ↓self.x = 1
-            }
-            f { [weak self] in
-                self?.x = 1
-                if let self = self else { ↓self.x = 1 }
-                self?.x = 1
-            }
-            f { [weak self] in
-                self?.x = 1
-                while let self else { ↓self.x = 1 }
-                self?.x = 1
-            }
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_set_access_control.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_set_access_control.html deleted file mode 100644 index 902b1b779..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_set_access_control.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - redundant_set_access_control Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Access Control for Setter

- -

Property setter access level shouldn’t be explicit if it’s the same as the variable access level

- -
    -
  • Identifier: redundant_set_access_control
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
private(set) public var foo: Int
-
-
public let foo: Int
-
-
public var foo: Int
-
-
var foo: Int
-
-
private final class A {
-  private(set) var value: Int
-}
-
-
extension Color {
-    public internal(set) static var someColor = Color.anotherColor
-}
-
-

Triggering Examples

-
↓private(set) private var foo: Int
-
-
↓fileprivate(set) fileprivate var foo: Int
-
-
↓internal(set) internal var foo: Int
-
-
↓public(set) public var foo: Int
-
-
open class Foo {
-  ↓open(set) open var bar: Int
-}
-
-
class A {
-  ↓internal(set) var value: Int
-}
-
-
internal class A {
-  ↓internal(set) var value: Int
-}
-
-
fileprivate class A {
-  ↓fileprivate(set) var value: Int
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_string_enum_value.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_string_enum_value.html deleted file mode 100644 index cd3ee5a86..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_string_enum_value.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - redundant_string_enum_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant String Enum Value

- -

String enum values can be omitted when they are equal to the enumcase name

- -
    -
  • Identifier: redundant_string_enum_value
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers: String {
-  case one
-  case two
-}
-
-
enum Numbers: Int {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: String {
-  case one = "ONE"
-  case two = "TWO"
-}
-
-
enum Numbers: String {
-  case one = "ONE"
-  case two = "two"
-}
-
-
enum Numbers: String {
-  case one, two
-}
-
-

Triggering Examples

-
enum Numbers: String {
-  case one = ↓"one"
-  case two = ↓"two"
-}
-
-
enum Numbers: String {
-  case one = ↓"one", two = ↓"two"
-}
-
-
enum Numbers: String {
-  case one, two = ↓"two"
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_type_annotation.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_type_annotation.html deleted file mode 100644 index 89208d194..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_type_annotation.html +++ /dev/null @@ -1,550 +0,0 @@ - - - - redundant_type_annotation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Type Annotation

- -

Variables should not have redundant type annotation

- -
    -
  • Identifier: redundant_type_annotation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignore_attributes - -[“IBInspectable”] -
    -consider_default_literal_types_redundant - -false -
  • -
-

Non Triggering Examples

-
var url = URL()
-
-
var url: CustomStringConvertible = URL()
-
-
var one: Int = 1, two: Int = 2, three: Int
-
-
guard let url = URL() else { return }
-
-
if let url = URL() { return }
-
-
let alphanumerics = CharacterSet.alphanumerics
-
-
var set: Set<Int> = Set([])
-
-
var set: Set<Int> = Set.init([])
-
-
var set = Set<Int>([])
-
-
var set = Set<Int>.init([])
-
-
guard var set: Set<Int> = Set([]) else { return }
-
-
if var set: Set<Int> = Set.init([]) { return }
-
-
guard var set = Set<Int>([]) else { return }
-
-
if var set = Set<Int>.init([]) { return }
-
-
var one: A<T> = B()
-
-
var one: A = B<T>()
-
-
var one: A<T> = B<T>()
-
-
let a = A.b.c.d
-
-
let a: B = A.b.c.d
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction: Direction = .up
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction = Direction.up
-
-
@IgnoreMe var a: Int = Int(5)
-
-
var a: Int {
-    @IgnoreMe let i: Int = Int(1)
-    return i
-}
-
-
var bol: Bool = true
-
-
var dbl: Double = 0.0
-
-
var int: Int = 0
-
-
var str: String = "str"
-
-

Triggering Examples

-
var url↓:URL=URL()
-
-
var url↓:URL = URL(string: "")
-
-
var url↓: URL = URL()
-
-
let url↓: URL = URL()
-
-
lazy var url↓: URL = URL()
-
-
let url↓: URL = URL()!
-
-
var one: Int = 1, two↓: Int = Int(5), three: Int
-
-
guard let url↓: URL = URL() else { return }
-
-
if let url↓: URL = URL() { return }
-
-
let alphanumerics↓: CharacterSet = CharacterSet.alphanumerics
-
-
var set↓: Set<Int> = Set<Int>([])
-
-
var set↓: Set<Int> = Set<Int>.init([])
-
-
var set↓: Set = Set<Int>([])
-
-
var set↓: Set = Set<Int>.init([])
-
-
guard var set↓: Set = Set<Int>([]) else { return }
-
-
if var set↓: Set = Set<Int>.init([]) { return }
-
-
guard var set↓: Set<Int> = Set<Int>([]) else { return }
-
-
if var set↓: Set<Int> = Set<Int>.init([]) { return }
-
-
var set↓: Set = Set<Int>([]), otherSet: Set<Int>
-
-
var num↓: Int = Int.random(0..<10)
-
-
let a↓: A = A.b.c.d
-
-
let a↓: A = A.f().b
-
-
class ViewController: UIViewController {
-  func someMethod() {
-    let myVar↓: Int = Int(5)
-  }
-}
-
-
let a↓: [Int] = [Int]()
-
-
let a↓: A.B = A.B()
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction↓: Direction = Direction.up
-
-
@DontIgnoreMe var a↓: Int = Int(5)
-
-
@IgnoreMe
-var a: Int {
-    let i↓: Int = Int(1)
-    return i
-}
-
-
var bol↓: Bool = true
-
-
var dbl↓: Double = 0.0
-
-
var int↓: Int = 0
-
-
var str↓: String = "str"
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_void_return.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_void_return.html deleted file mode 100644 index ec9c3f685..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/redundant_void_return.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - redundant_void_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Void Return

- -

Returning Void in a function declaration is redundant

- -
    -
  • Identifier: redundant_void_return
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -include_closures - -true -
  • -
-

Non Triggering Examples

-
func foo() {}
-
-
func foo() -> Int {}
-
-
func foo() -> Int -> Void {}
-
-
func foo() -> VoidResponse
-
-
let foo: (Int) -> Void
-
-
func foo() -> Int -> () {}
-
-
let foo: (Int) -> ()
-
-
func foo() -> ()?
-
-
func foo() -> ()!
-
-
func foo() -> Void?
-
-
func foo() -> Void!
-
-
struct A {
-    subscript(key: String) {
-        print(key)
-    }
-}
-
-
doSomething { arg -> Void in
-    print(arg)
-}
-
-

Triggering Examples

-
func foo()↓ -> Void {}
-
-
protocol Foo {
-  func foo()↓ -> Void
-}
-
-
func foo()↓ -> () {}
-
-
func foo()↓ -> ( ) {}
-
-
protocol Foo {
-  func foo()↓ -> ()
-}
-
-
doSomething { arg↓ -> () in
-    print(arg)
-}
-
-
doSomething { arg↓ -> Void in
-    print(arg)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_deinit.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_deinit.html deleted file mode 100644 index 562d396ee..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_deinit.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - required_deinit Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Required Deinit

- -

Classes should have an explicit deinit method

- -
    -
  • Identifier: required_deinit
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Apple {
-    deinit { }
-}
-
-
enum Banana { }
-
-
protocol Cherry { }
-
-
struct Damson { }
-
-
class Outer {
-    deinit { print("Deinit Outer") }
-    class Inner {
-        deinit { print("Deinit Inner") }
-    }
-}
-
-

Triggering Examples

-
↓class Apple { }
-
-
↓class Banana: NSObject, Equatable { }
-
-
↓class Cherry {
-    // deinit { }
-}
-
-
↓class Damson {
-    func deinitialize() { }
-}
-
-
class Outer {
-    func hello() -> String { return "outer" }
-    deinit { }
-    ↓class Inner {
-        func hello() -> String { return "inner" }
-    }
-}
-
-
↓class Outer {
-    func hello() -> String { return "outer" }
-    class Inner {
-        func hello() -> String { return "inner" }
-        deinit { }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_enum_case.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_enum_case.html deleted file mode 100644 index 13ee6b523..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/required_enum_case.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - required_enum_case Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Required Enum Case

- -

Enums conforming to a specified protocol must implement a specific case(s).

- -
    -
  • Identifier: required_enum_case
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -{Protocol Name} - - - - - - - - - - - - - - - -
    KeyValue
    -{Case Name 1} - -{warning|error} -
    -{Case Name 2} - -{warning|error} -
    -
  • -
-

Non Triggering Examples

-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error, notConnected
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error, notConnected(error: Error)
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-    case notConnected
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-    case notConnected(error: Error)
-}
-
-

Triggering Examples

-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_arrow_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_arrow_whitespace.html deleted file mode 100644 index 64b94efe2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_arrow_whitespace.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - return_arrow_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Returning Whitespace

- -

Return arrow and return type should be separated by a single space or on a separate line

- -
    -
  • Identifier: return_arrow_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func abc() -> Int {}
-
-
func abc() -> [Int] {}
-
-
func abc() -> (Int, Int) {}
-
-
var abc = {(param: Int) -> Void in }
-
-
func abc() ->
-    Int {}
-
-
func abc()
-    -> Int {}
-
-
func reallyLongFunctionMethods<T>(withParam1: Int, param2: String, param3: Bool) where T: AGenericConstraint
-    -> Int {
-    return 1
-}
-
-
typealias SuccessBlock = ((Data) -> Void)
-
-

Triggering Examples

-
func abc()↓->Int {}
-
-
func abc()↓->[Int] {}
-
-
func abc()↓->(Int, Int) {}
-
-
func abc()↓-> Int {}
-
-
func abc()↓->   Int {}
-
-
func abc()↓ ->Int {}
-
-
func abc()↓  ->  Int {}
-
-
var abc = {(param: Int)↓ ->Bool in }
-
-
var abc = {(param: Int)↓->Bool in }
-
-
typealias SuccessBlock = ((Data)↓->Void)
-
-
func abc()
-  ↓->  Int {}
-
-
func abc()
- ↓->  Int {}
-
-
func abc()↓  ->
-  Int {}
-
-
func abc()↓  ->
-Int {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_value_from_void_function.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_value_from_void_function.html deleted file mode 100644 index aafa1c636..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/return_value_from_void_function.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - return_value_from_void_function Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Return Value from Void Function

- -

Returning values from Void functions should be avoided

- -
    -
  • Identifier: return_value_from_void_function
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-    return
-}
-
-
func foo() {
-    return /* a comment */
-}
-
-
func foo() -> Int {
-    return 1
-}
-
-
func foo() -> Void {
-    if condition {
-        return
-    }
-    bar()
-}
-
-
func foo() {
-    return;
-    bar()
-}
-
-
func test() {}
-
-
init?() {
-    guard condition else {
-        return nil
-    }
-}
-
-
init?(arg: String?) {
-    guard arg != nil else {
-        return nil
-    }
-}
-
-
func test() {
-    guard condition else {
-        return
-    }
-}
-
-
func test() -> Result<String, Error> {
-    func other() {}
-    func otherVoid() -> Void {}
-}
-
-
func test() -> Int? {
-    return nil
-}
-
-
func test() {
-    if bar {
-        print("")
-        return
-    }
-    let foo = [1, 2, 3].filter { return true }
-    return
-}
-
-
func test() {
-    guard foo else {
-        bar()
-        return
-    }
-}
-
-
func spec() {
-    var foo: Int {
-        return 0
-    }
-
-
func f() -> () { g() }
-
-
func f() { g() }
-
-
func f() { { return g() }() }
-
-
func f() {
-    func g() -> Int {
-        return 1
-    }
-}
-
-
init?() { return nil }
-
-
func f() {
-    var i: Int { return 1 }
-}
-
-

Triggering Examples

-
func foo() {
-    ↓return bar()
-}
-
-
func foo() -> () {
-    ↓return self.bar()
-}
-
-
func foo() -> Void {
-    ↓return bar()
-}
-
-
func foo() -> Void {
-    ↓return /* comment */ bar()
-}
-
-
func foo() {
-    ↓return
-    self.bar()
-}
-
-
func foo() {
-    variable += 1
-    ↓return
-    variable += 1
-}
-
-
func initThing() {
-    guard foo else {
-        ↓return print("")
-    }
-}
-
-
// Leading comment
-func test() {
-    guard condition else {
-        ↓return assertionfailure("")
-    }
-}
-
-
func test() -> Result<String, Error> {
-    func other() {
-        guard false else {
-            ↓return assertionfailure("")
-        }
-    }
-    func otherVoid() -> Void {}
-}
-
-
func test() {
-    guard conditionIsTrue else {
-        sideEffects()
-        return // comment
-    }
-    guard otherCondition else {
-        ↓return assertionfailure("")
-    }
-    differentSideEffect()
-}
-
-
func test() {
-    guard otherCondition else {
-        ↓return assertionfailure(""); // comment
-    }
-    differentSideEffect()
-}
-
-
func test() {
-  if x {
-    ↓return foo()
-  }
-  bar()
-}
-
-
func test() {
-  switch x {
-    case .a:
-      ↓return foo() // return to skip baz()
-    case .b:
-      bar()
-  }
-  baz()
-}
-
-
func test() {
-  if check {
-    if otherCheck {
-      ↓return foo()
-    }
-  }
-  bar()
-}
-
-
func test() {
-    ↓return foo()
-}
-
-
func test() {
-  ↓return foo({
-    return bar()
-  })
-}
-
-
func test() {
-  guard x else {
-    ↓return foo()
-  }
-  bar()
-}
-
-
func test() {
-  let closure: () -> () = {
-    return assert()
-  }
-  if check {
-    if otherCheck {
-      return // comments are fine
-    }
-  }
-  ↓return foo()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/rule-directory.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/rule-directory.html deleted file mode 100644 index 768dbd352..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/rule-directory.html +++ /dev/null @@ -1,611 +0,0 @@ - - - - Rule Directory Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Rule Directory

-

Default Rules

- - -

Opt-in Rules

- - -

Analyzer Rules

- - - -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/search.json b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/search.json deleted file mode 100644 index fcecd3151..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/search.json +++ /dev/null @@ -1 +0,0 @@ -{"Structs/ViolationCorrection.html#/s:13SwiftLintCore19ViolationCorrectionV5start0A6Syntax16AbsolutePositionVvp":{"name":"start","abstract":"

Start position of the violation range.

","parent_name":"ViolationCorrection"},"Structs/ViolationCorrection.html#/s:13SwiftLintCore19ViolationCorrectionV5start3end11replacementAC0A6Syntax16AbsolutePositionV_AISStcfc":{"name":"init(start:end:replacement:)","abstract":"

Create a ViolationCorrection.

","parent_name":"ViolationCorrection"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV7warningSivp":{"name":"warning","abstract":"

The threshold for a violation to be a warning.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV5errorSiSgvp":{"name":"error","abstract":"

The threshold for a violation to be an error.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV7warning5errorACyxGSi_SiSgtcfc":{"name":"init(warning:error:)","abstract":"

Create a SeverityLevelsConfiguration based on the sepecified warning and error thresholds.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV6paramsSayAA13RuleParameterVySiGGvp":{"name":"params","abstract":"

The rule parameters that define the thresholds that should map to each severity.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"SeverityLevelsConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV10identifierSSvp":{"name":"identifier","abstract":"

The identifier for this custom rule.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV4nameSSSgvp":{"name":"name","abstract":"

The name for this custom rule.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV7messageSSvp":{"name":"message","abstract":"

The message to be presented when producing violations.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV8includedSaySo19NSRegularExpressionCGvp":{"name":"included","abstract":"

Regular expressions to include when matching the file path.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV8excludedSaySo19NSRegularExpressionCGvp":{"name":"excluded","abstract":"

Regular expressions to exclude when matching the file path.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV18excludedMatchKindsShy21SourceKittenFramework10SyntaxKindOGvp":{"name":"excludedMatchKinds","abstract":"

The syntax kinds to exclude from matches. If the regex matched syntax kinds from this list, it would","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV12captureGroupSivp":{"name":"captureGroup","abstract":"

The index of the regex capture group to match.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore24CacheDescriptionProviderP05cacheE0SSvp":{"name":"cacheDescription","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV11descriptionAA15RuleDescriptionVvp":{"name":"description","abstract":"

The RuleDescription for the custom rule defined here.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV10identifierACyxGSS_tcfc":{"name":"init(identifier:)","abstract":"

Create a RegexConfiguration with the specified identifier, with other properties to be set later.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"RegexConfiguration"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8position0A6Syntax16AbsolutePositionVvp":{"name":"position","abstract":"

The violation’s position.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV6reasonSSSgvp":{"name":"reason","abstract":"

A specific reason for the violation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8severityAA0F8SeverityOSgvp":{"name":"severity","abstract":"

The violation’s severity.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8position6reason8severityAC0A6Syntax16AbsolutePositionV_SSSgAA0F8SeverityOSgtcfc":{"name":"init(position:reason:severity:)","abstract":"

Creates a ReasonedRuleViolation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ReasonedRuleViolation"},"Structs/YamlParser.html#/s:13SwiftLintCore10YamlParserV5parse_3envSDySSypGSS_SDyS2SGtKFZ":{"name":"parse(_:env:)","abstract":"

Parses the input YAML string as an untyped dictionary.

","parent_name":"YamlParser"},"Structs/Version.html#/s:13SwiftLintCore7VersionV5valueSSvp":{"name":"value","abstract":"

The string value for this version.

","parent_name":"Version"},"Structs/Version.html#/s:13SwiftLintCore7VersionV7currentACvpZ":{"name":"current","abstract":"

The current SwiftLint version.

","parent_name":"Version"},"Structs/SwiftVersion.html#/s:SY8RawValueQa":{"name":"RawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValuexSg03RawB0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV4fiveACvpZ":{"name":"five","abstract":"

Swift 5.0.x - https://swift.org/download/#swift-50

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotOneACvpZ":{"name":"fiveDotOne","abstract":"

Swift 5.1.x - https://swift.org/download/#swift-51

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotTwoACvpZ":{"name":"fiveDotTwo","abstract":"

Swift 5.2.x - https://swift.org/download/#swift-52

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotThreeACvpZ":{"name":"fiveDotThree","abstract":"

Swift 5.3.x - https://swift.org/download/#swift-53

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotFourACvpZ":{"name":"fiveDotFour","abstract":"

Swift 5.4.x - https://swift.org/download/#swift-54

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotFiveACvpZ":{"name":"fiveDotFive","abstract":"

Swift 5.5.x - https://swift.org/download/#swift-55

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotSixACvpZ":{"name":"fiveDotSix","abstract":"

Swift 5.6.x - https://swift.org/download/#swift-56

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotSevenACvpZ":{"name":"fiveDotSeven","abstract":"

Swift 5.7.x - https://swift.org/download/#swift-57

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotEightACvpZ":{"name":"fiveDotEight","abstract":"

Swift 5.8.x - https://swift.org/download/#swift-58

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotNineACvpZ":{"name":"fiveDotNine","abstract":"

Swift 5.9.x - https://swift.org/download/#swift-59

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV7currentACvpZ":{"name":"current","abstract":"

The current detected Swift compiler version, based on the currently accessible SourceKit version.

","parent_name":"SwiftVersion"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5value21SourceKittenFramework0dE0Vvp":{"name":"value","abstract":"

The raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV4kind21SourceKittenFramework0D4KindOSgvp":{"name":"kind","abstract":"

The syntax kind associated with is token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5valueAC21SourceKittenFramework0dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5range21SourceKittenFramework9ByteRangeVvp":{"name":"range","abstract":"

The byte range in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV6offset21SourceKittenFramework9ByteCountVvp":{"name":"offset","abstract":"

The starting byte offset in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV6length21SourceKittenFramework9ByteCountVvp":{"name":"length","abstract":"

The length in bytes for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5value21SourceKittenFramework0dE0Vvp":{"name":"value","abstract":"

The raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV6tokensSayAA0abD5TokenVGvp":{"name":"tokens","abstract":"

The SwiftLint-specific syntax tokens for this syntax map.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5valueAC21SourceKittenFramework0dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV6tokens11inByteRangeSayAA0abD5TokenVG21SourceKittenFramework0hI0V_tF":{"name":"tokens(inByteRange:)","abstract":"

Returns array of syntax tokens intersecting with byte range.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5kinds11inByteRangeSay21SourceKittenFramework0D4KindOGAF0hI0V_tF":{"name":"kinds(inByteRange:)","abstract":"

Returns the syntax kinds in the specified byte range.

","parent_name":"SwiftLintSyntaxMap"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV14ruleIdentifierSSvp":{"name":"ruleIdentifier","abstract":"

The identifier of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV15ruleDescriptionSSvp":{"name":"ruleDescription","abstract":"

The description of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8ruleNameSSvp":{"name":"ruleName","abstract":"

The name of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8severityAA0E8SeverityOvp":{"name":"severity","abstract":"

The severity of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8locationAA8LocationVvp":{"name":"location","abstract":"

The location of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV6reasonSSvp":{"name":"reason","abstract":"

The justification for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV11descriptionSSvp":{"name":"description","abstract":"

A printable description for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV15ruleDescription8severity8location6reasonAcA04RuleG0V_AA0E8SeverityOAA8LocationVSSSgtcfc":{"name":"init(ruleDescription:severity:location:reason:)","abstract":"

Creates a StyleViolation by specifying its properties directly.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV4with8severityAcA0E8SeverityO_tF":{"name":"with(severity:)","abstract":"

Returns the same violation, but with the severity that is passed in

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV4with8locationAcA8LocationV_tF":{"name":"with(location:)","abstract":"

Returns the same violation, but with the location that is passed in

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"StyleViolation"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV8severityAA17ViolationSeverityOvp":{"name":"severity","abstract":"

The severity that should be assigned to the violation of this parameter’s value is met.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV5valuexvp":{"name":"value","abstract":"

The value to configure the rule.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV8severity5valueACyxGAA17ViolationSeverityO_xtcfc":{"name":"init(severity:value:)","abstract":"

Creates a RuleParameter by specifying its properties directly.

","parent_name":"RuleParameter"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV4listSDySSAA0D0_pXpGvp":{"name":"list","abstract":"

The rules contained in this list.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV5rulesAcA0D0_pXpd_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV5rulesACSayAA0D0_pXpG_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleList"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV10identifierSSvp":{"name":"identifier","abstract":"

The rule’s unique identifier, to be used in configuration files and SwiftLint commands.","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV4nameSSvp":{"name":"name","abstract":"

The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV11descriptionSSvp":{"name":"description","abstract":"

The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV4kindAA0D4KindOvp":{"name":"kind","abstract":"

The RuleKind that best categorizes this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV21nonTriggeringExamplesSayAA7ExampleVGvp":{"name":"nonTriggeringExamples","abstract":"

Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV18triggeringExamplesSayAA7ExampleVGvp":{"name":"triggeringExamples","abstract":"

Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV11correctionsSDyAA7ExampleVAFGvp":{"name":"corrections","abstract":"

Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV17deprecatedAliasesShySSGvp":{"name":"deprecatedAliases","abstract":"

Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV03minA7VersionAA0aG0Vvp":{"name":"minSwiftVersion","abstract":"

The oldest version of the Swift compiler supported by this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV18requiresFileOnDiskSbvp":{"name":"requiresFileOnDisk","abstract":"

Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV07consoleE0SSvp":{"name":"consoleDescription","abstract":"

The console-printable string for this description.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV14allIdentifiersSaySSGvp":{"name":"allIdentifiers","abstract":"

All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV10identifier4name11description4kind03minA7Version21nonTriggeringExamples010triggeringN011corrections17deprecatedAliases18requiresFileOnDiskACSS_S2SAA0D4KindOAA0aK0VSayAA7ExampleVGATSDyA2SGShySSGSbtcfc":{"name":"init(identifier:name:description:kind:minSwiftVersion:nonTriggeringExamples:triggeringExamples:corrections:deprecatedAliases:requiresFileOnDisk:)","abstract":"

Creates a RuleDescription by specifying all its properties directly.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleDescription"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV5errorACyxGvpZ":{"name":"error","abstract":"

Configuration with a warning severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV7warningACyxGvpZ":{"name":"warning","abstract":"

Configuration with an error severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationVyACyxGAA09ViolationD0Ocfc":{"name":"init(_:)","abstract":"

Create a SeverityConfiguration with the specified severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV13asDescription4withAA04RuleeG0VSS_tF":{"name":"asDescription(with:)","abstract":"

Severity configurations are special in that they shall not be nested when an option name is provided.","parent_name":"SeverityConfiguration"},"Structs/ConfigurationElement/DeprecationNotice.html#/s:13SwiftLintCore20ConfigurationElementV17DeprecationNoticeO18suggestAlternativeyAEyx_GSS_SStcAGmSQRzAA012AcceptableBydE0RzlF":{"name":"suggestAlternative(ruleID:name:)","abstract":"

Warning suggesting an alternative option.

","parent_name":"DeprecationNotice"},"Structs/ConfigurationElement/DeprecationNotice.html":{"name":"DeprecationNotice","abstract":"

A deprecation notice.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

Wrapped option value.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV14projectedValueACyxGvp":{"name":"projectedValue","abstract":"

The wrapper itself providing access to all its data. This field can only be accessed by the","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV3keySSvp":{"name":"key","abstract":"

Name of this configuration entry.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV6inlineSbvp":{"name":"inline","abstract":"

Whether this configuration element will be inlined into its description.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3key17deprecationNotice13postprocessorACyxGx_SSAC011DeprecationJ0Oyx_GSgyxzctcfc":{"name":"init(wrappedValue:key:deprecationNotice:postprocessor:)","abstract":"

Default constructor.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV3keyACyqd__SgGSS_tcAERszSQRd__AA012AcceptableBydE0Rd__lufc":{"name":"init(key:)","abstract":"

Constructor for optional values.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue6inlineACyxGx_SbtcAA19InlinableOptionTypeRzrlufc":{"name":"init(wrappedValue:inline:)","abstract":"

Constructor for an InlinableOptionType without a key.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3keyACyxGx_SStcAA19InlinableOptionTypeRzrlufc":{"name":"init(wrappedValue:key:)","abstract":"

Constructor for an InlinableOptionType with a name. The configuration will explicitly not be inlined.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"ConfigurationElement"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore23RuleConfigurationOptionV9noOptionsACvpZ":{"name":"noOptions","abstract":"

An option serving as a marker for an empty configuration description.

","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"RuleConfigurationDescription"},"Structs/Region.html#/s:13SwiftLintCore6RegionV5startAA8LocationVvp":{"name":"start","abstract":"

The location describing the start of the region. All locations that are less than this value","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV3endAA8LocationVvp":{"name":"end","abstract":"

The location describing the end of the region. All locations that are greater than this value","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV23disabledRuleIdentifiersShyAA0F10IdentifierOGvp":{"name":"disabledRuleIdentifiers","abstract":"

All SwiftLint rule identifiers that are disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV5start3end23disabledRuleIdentifiersAcA8LocationV_AHShyAA0H10IdentifierOGtcfc":{"name":"init(start:end:disabledRuleIdentifiers:)","abstract":"

Creates a Region by setting explicit values for all its properties.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV8containsySbAA8LocationVF":{"name":"contains(_:)","abstract":"

Whether the specific location is contained in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV13isRuleEnabledySbxAA0F0RzlF":{"name":"isRuleEnabled(_:)","abstract":"

Whether the specified rule is enabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV14isRuleDisabledySbxAA0F0RzlF":{"name":"isRuleDisabled(_:)","abstract":"

Whether the specified rule is disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV16areRulesDisabled7ruleIDsSbSaySSG_tF":{"name":"areRulesDisabled(ruleIDs:)","abstract":"

Whether the given rules are disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV26deprecatedAliasesDisabling4ruleShySSGx_tAA4RuleRzlF":{"name":"deprecatedAliasesDisabling(rule:)","abstract":"

Returns the deprecated rule aliases that are disabling the specified rule in this region.","parent_name":"Region"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4fileSSSgvp":{"name":"file","abstract":"

The file path on disk for this location.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4lineSiSgvp":{"name":"line","abstract":"

The line offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV9characterSiSgvp":{"name":"character","abstract":"

The character offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV11descriptionSSvp":{"name":"description","abstract":"

A lossless printable description of this location.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV12relativeFileSSSgvp":{"name":"relativeFile","abstract":"

The file path for this location relative to the current working directory.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file4line9characterACSSSg_SiSgAHtcfc":{"name":"init(file:line:character:)","abstract":"

Creates a Location by specifying its properties directly.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file10byteOffsetAcA0aB4FileC_21SourceKittenFramework9ByteCountVtcfc":{"name":"init(file:byteOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a byte-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file8positionAcA0aB4FileC_0A6Syntax16AbsolutePositionVtcfc":{"name":"init(file:position:)","abstract":"

Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file.","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file15characterOffsetAcA0aB4FileC_Sitcfc":{"name":"init(file:characterOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Location"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV15styleViolations5usingSayAA14StyleViolationVGAA11RuleStorageC_tF":{"name":"styleViolations(using:)","abstract":"

Computes or retrieves style violations.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV27styleViolationsAndRuleTimes5usingSayAA14StyleViolationVG_SaySS2id_Sd4timetGtAA0I7StorageC_tF":{"name":"styleViolationsAndRuleTimes(using:)","abstract":"

Computes or retrieves style violations and the time spent executing each rule.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV7correct5usingSayAA10CorrectionVGAA11RuleStorageC_tF":{"name":"correct(using:)","abstract":"

Applies corrections for all rules to this file, returning performed corrections.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV6format7useTabs11indentWidthySb_SitF":{"name":"format(useTabs:indentWidth:)","abstract":"

Formats the file associated with this linter.

","parent_name":"CollectedLinter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV12isCollectingSbvp":{"name":"isCollecting","abstract":"

Whether or not this linter will be used to collect information from several files.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV4file13configuration5cache17compilerArgumentsAcA0aB4FileC_AA13ConfigurationVAA0D5CacheCSgSaySSGtcfc":{"name":"init(file:configuration:cache:compilerArguments:)","abstract":"

Creates a Linter by specifying its properties directly.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV7collect4intoAA09CollectedD0VAA11RuleStorageC_tF":{"name":"collect(into:)","abstract":"

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

","parent_name":"Linter"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4codeSSvp":{"name":"code","abstract":"

The contents of the example

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV13configurationSDySSs8Sendable_pGSgvp":{"name":"configuration","abstract":"

The untyped configuration to apply to the rule, if deviating from the default configuration.","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV20testMultiByteOffsetsSbvp":{"name":"testMultiByteOffsets","abstract":"

Whether the example should be tested by prepending multibyte grapheme clusters

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV11testOnLinuxSbvp":{"name":"testOnLinux","abstract":"

Whether the example should be tested on Linux

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4files12StaticStringVvp":{"name":"file","abstract":"

The path to the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4lineSuvp":{"name":"line","abstract":"

The line in the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV_13configuration20testMultiByteOffsets0F17WrappingInComment0fjK6String0F14DisableCommand0F7OnLinux4file4line24excludeFromDocumentationACSS_SDySSs8Sendable_pGSgS5bs06StaticM0VSuSbtcfc":{"name":"init(_:configuration:testMultiByteOffsets:testWrappingInComment:testWrappingInString:testDisableCommand:testOnLinux:file:line:excludeFromDocumentation:)","abstract":"

Create a new Example with the specified code, file, and line.

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4with4codeACSS_tF":{"name":"with(code:)","abstract":"

Returns the same example, but with the code that is passed in

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV24removingViolationMarkersACyF":{"name":"removingViolationMarkers()","abstract":"

Returns a copy of the Example with all instances of the “↓” character removed.

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV7focusedACyF":{"name":"focused()","abstract":"

Makes the current example focused. This is for debugging purposes only.

","parent_name":"Example"},"Structs/Example.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Example"},"Structs/Example.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Example"},"Structs/Example.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Example"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV15ruleDescriptionAA04RuleF0Vvp":{"name":"ruleDescription","abstract":"

The description of the rule for which this correction was applied.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV8locationAA8LocationVvp":{"name":"location","abstract":"

The location of the original violation that was corrected.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV18consoleDescriptionSSvp":{"name":"consoleDescription","abstract":"

The console-printable description for this correction.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV15ruleDescription8locationAcA04RuleF0V_AA8LocationVtcfc":{"name":"init(ruleDescription:location:)","abstract":"

Memberwise initializer.

","parent_name":"Correction"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV7defaultACvpZ":{"name":"default","abstract":"

The default Configuration resulting from an empty configuration file.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV15defaultFileNameSSvpZ":{"name":"defaultFileName","abstract":"

The default file name to look for user-defined configurations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13includedPathsSaySSGvp":{"name":"includedPaths","abstract":"

The paths that should be included when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13excludedPathsSaySSGvp":{"name":"excludedPaths","abstract":"

The paths that should be excluded when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV11indentationAC16IndentationStyleOvp":{"name":"indentation","abstract":"

The style to use when indenting Swift source code.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV16warningThresholdSiSgvp":{"name":"warningThreshold","abstract":"

The threshold for the number of warnings to tolerate before treating the lint as having failed.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV8reporterSSSgvp":{"name":"reporter","abstract":"

The identifier for the Reporter to use to report style violations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV9cachePathSSSgvp":{"name":"cachePath","abstract":"

The location of the persisted cache to use with this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV22allowZeroLintableFilesSbvp":{"name":"allowZeroLintableFiles","abstract":"

Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV6strictSbvp":{"name":"strict","abstract":"

Treat warnings as errors

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV013basedOnCustomD5FilesSbvp":{"name":"basedOnCustomConfigurationFiles","abstract":"

This value is true iff the --config parameter was used to specify (a) configuration file(s)","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV5rulesSayAA4Rule_pGvp":{"name":"rules","abstract":"

All rules enabled in this configuration

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13rootDirectorySSvp":{"name":"rootDirectory","abstract":"

The root directory is the directory that included & excluded paths relate to.","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV9rulesModeAC05RulesF0Ovp":{"name":"rulesMode","abstract":"

The rules mode used for this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV18configurationFiles14enableAllRules9cachePath27ignoreParentAndChildConfigs20mockedNetworkResults25useDefaultConfigOnFailureACSaySSG_SbSSSgSbSDyS2SGSbSgtcfc":{"name":"init(configurationFiles:enableAllRules:cachePath:ignoreParentAndChildConfigs:mockedNetworkResults:useDefaultConfigOnFailure:)","abstract":"

Creates a Configuration with convenience parameters.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"Configuration"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO8previousyA2EmF":{"name":"previous","abstract":"

The command should only apply to the line preceding its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO4thisyA2EmF":{"name":"this","abstract":"

The command should only apply to the same line as its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO4nextyA2EmF":{"name":"next","abstract":"

The command should only apply to the line following its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO7invalidyA2EmF":{"name":"invalid","abstract":"

The modifier string was invalid.

","parent_name":"Modifier"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO6enableyA2EmF":{"name":"enable","abstract":"

The rule(s) associated with this command should be enabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO7disableyA2EmF":{"name":"disable","abstract":"

The rule(s) associated with this command should be disabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO7invalidyA2EmF":{"name":"invalid","abstract":"

The action string was invalid.

","parent_name":"Action"},"Structs/Command/Action.html":{"name":"Action","abstract":"

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

","parent_name":"Command"},"Structs/Command/Modifier.html":{"name":"Modifier","abstract":"

The modifier for a command, used to modify its scope.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV6actionAC6ActionOvp":{"name":"action","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV15ruleIdentifiersShyAA14RuleIdentifierOGvp":{"name":"ruleIdentifiers","abstract":"

The identifiers for the rules associated with this command.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV4lineSivp":{"name":"line","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV9characterSiSgvp":{"name":"character","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV8modifierAC8ModifierOSgvp":{"name":"modifier","abstract":"

This command’s modifier, if any.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV6action15ruleIdentifiers4line9character8modifier15trailingCommentA2C6ActionO_ShyAA14RuleIdentifierOGS2iSgAC8ModifierOSgSSSgtcfc":{"name":"init(action:ruleIdentifiers:line:character:modifier:trailingComment:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV12actionString4line9characterACSS_S2itcfc":{"name":"init(actionString:line:character:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV5errorACyxGvpZ":{"name":"error","abstract":"

Configuration with a warning severity.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV7warningACyxGvpZ":{"name":"warning","abstract":"

Configuration with an error severity.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV3offACyxGvpZ":{"name":"off","abstract":"

Configuration disabling an option.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV8severityAA09ViolationF0OSgvp":{"name":"severity","abstract":"

The ChildOptionSeverityConfiguration mapped to a usually used ViolationSeverity. It’s nil if the option","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"ChildOptionSeverityConfiguration"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV10violationsSayAA14StyleViolationVGvp":{"name":"violations","abstract":"

The stored violations.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV8fromPathACSS_tKcfc":{"name":"init(fromPath:)","abstract":"

Creates a Baseline from a saved file.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV10violationsACSayAA14StyleViolationVG_tcfc":{"name":"init(violations:)","abstract":"

Creates a Baseline from a list of violations.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV5write6toPathySS_tKF":{"name":"write(toPath:)","abstract":"

Writes a Baseline to disk in JSON format.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV6filterySayAA14StyleViolationVGAGF":{"name":"filter(_:)","abstract":"

Filters out violations that are present in the Baseline.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV7compareySayAA14StyleViolationVGACF":{"name":"compare(_:)","abstract":"

Returns the violations that are present in another Baseline, but not in this one.

","parent_name":"Baseline"},"Structs/Stack.html#/s:13SwiftLintCore5StackVACyxGycfc":{"name":"init()","abstract":"

Creates an empty Stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV5countSivp":{"name":"count","abstract":"

The number of elements in this stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV4pushyyxF":{"name":"push(_:)","abstract":"

Pushes (appends) an element onto the stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV3popxSgyF":{"name":"pop()","abstract":"

Removes and returns the last element of the stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV4peekxSgyF":{"name":"peek()","abstract":"

Returns the last element of the stack if the stack is not empty; otherwise, nil.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV8contains5whereS2bxXE_tF":{"name":"contains(where:)","abstract":"

Check whether the sequence contains an element that satisfies the given predicate.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV10modifyLast2byyyxzXE_tF":{"name":"modifyLast(by:)","abstract":"

Modify the last element.

","parent_name":"Stack"},"Structs/Stack.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"Stack"},"Structs/RuleListDocumentation.html#/s:13SwiftLintCore21RuleListDocumentationVyAcA0dE0Vcfc":{"name":"init(_:)","abstract":"

Creates a RuleListDocumentation instance from a RuleList.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html#/s:13SwiftLintCore21RuleListDocumentationV5write2toy10Foundation3URLV_tKF":{"name":"write(to:)","abstract":"

Write the rule list documentation as markdown files to the specified directory.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html":{"name":"RuleListDocumentation","abstract":"

User-facing documentation for a SwiftLint RuleList.

"},"Structs/Stack.html":{"name":"Stack","abstract":"

A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

"},"Structs/Baseline.html":{"name":"Baseline","abstract":"

A set of violations that can be used to filter newly detected violations.

"},"Structs/ChildOptionSeverityConfiguration.html":{"name":"ChildOptionSeverityConfiguration","abstract":"

A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which"},"Structs/Command.html":{"name":"Command","abstract":"

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

"},"Structs/Configuration.html":{"name":"Configuration","abstract":"

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

"},"Structs/Correction.html":{"name":"Correction","abstract":"

A value describing a SwiftLint violation that was corrected.

"},"Structs/Example.html":{"name":"Example","abstract":"

Captures code and context information for an example of a triggering or"},"Structs/Linter.html":{"name":"Linter","abstract":"

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

"},"Structs/CollectedLinter.html":{"name":"CollectedLinter","abstract":"

Represents a file that can compute style violations and corrections for a list of rules.

"},"Structs/Location.html":{"name":"Location","abstract":"

The placement of a segment of Swift in a collection of source files.

"},"Structs/Region.html":{"name":"Region","abstract":"

A contiguous region of Swift source code.

"},"Structs/RuleConfigurationDescription.html":{"name":"RuleConfigurationDescription","abstract":"

Description of a rule configuration.

"},"Structs/RuleConfigurationOption.html":{"name":"RuleConfigurationOption","abstract":"

A single option of a RuleConfigurationDescription.

"},"Structs.html#/s:13SwiftLintCore35RuleConfigurationDescriptionBuilderV":{"name":"RuleConfigurationDescriptionBuilder","abstract":"

A result builder creating configuration descriptions.

"},"Structs/ConfigurationElement.html":{"name":"ConfigurationElement","abstract":"

A single parameter of a rule configuration.

"},"Structs/SeverityConfiguration.html":{"name":"SeverityConfiguration","abstract":"

A rule configuration that allows specifying the desired severity level for violations.

"},"Structs/RuleDescription.html":{"name":"RuleDescription","abstract":"

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

"},"Structs/RuleList.html":{"name":"RuleList","abstract":"

A list of available SwiftLint rules.

"},"Structs/RuleParameter.html":{"name":"RuleParameter","abstract":"

A configuration parameter for rules.

"},"Structs/StyleViolation.html":{"name":"StyleViolation","abstract":"

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

"},"Structs/SwiftLintSyntaxMap.html":{"name":"SwiftLintSyntaxMap","abstract":"

Represents a Swift file’s syntax information.

"},"Structs/SwiftLintSyntaxToken.html":{"name":"SwiftLintSyntaxToken","abstract":"

A SwiftLint-aware Swift syntax token.

"},"Structs/SwiftVersion.html":{"name":"SwiftVersion","abstract":"

A value describing the version of the Swift compiler.

"},"Structs/Version.html":{"name":"Version","abstract":"

A type describing the SwiftLint version.

"},"Structs/YamlParser.html":{"name":"YamlParser","abstract":"

An interface for parsing YAML.

"},"Structs/ReasonedRuleViolation.html":{"name":"ReasonedRuleViolation","abstract":"

A violation produced by ViolationsSyntaxVisitors.

"},"Structs/RegexConfiguration.html":{"name":"RegexConfiguration","abstract":"

A rule configuration used for defining custom rules in yaml.

"},"Structs/SeverityLevelsConfiguration.html":{"name":"SeverityLevelsConfiguration","abstract":"

A rule configuration that allows specifying thresholds for warning and error severities.

"},"Structs/ViolationCorrection.html":{"name":"ViolationCorrection","abstract":"

The correction of a violation that is basically the violation’s range in the source code and a"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP11makeVisitor4fileAA010ViolationsdG0Cy17ConfigurationTypeQzGAA0aB4FileC_tF":{"name":"makeVisitor(file:)","abstract":"

Produce a ViolationsSyntaxVisitor for the given file.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP13makeViolation4file9violationAA05StyleG0VAA0aB4FileC_AA08ReasonedeG0VtF":{"name":"makeViolation(file:violation:)","abstract":"

Produce a violation for the given file and absolute position.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP10preprocess4file0aD0010SourceFileD0VSgAA0abI0C_tF":{"name":"preprocess(file:)","abstract":"

Gives a chance for the rule to do some pre-processing on the syntax tree.","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxCorrectableRule.html#/s:13SwiftLintCore0A21SyntaxCorrectableRuleP12makeRewriter4fileAA010ViolationsdH0Cy17ConfigurationTypeQzGSgAA0aB4FileC_tF":{"name":"makeRewriter(file:)","abstract":"

Produce a ViolationsSyntaxRewriter for the given file.

","parent_name":"SwiftSyntaxCorrectableRule"},"Protocols/SwiftSyntaxCorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","parent_name":"SwiftSyntaxCorrectableRule"},"Protocols/SeverityBasedRuleConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","abstract":"

The configuration of a rule’s severity.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/SeverityBasedRuleConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationPAAE8severityAA09ViolationD0Ovp":{"name":"severity","abstract":"

The severity of a rule.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP6ParentQa":{"name":"Parent","abstract":"

The type of the rule that’s using this configuration.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP20parameterDescriptionAA0deG0VSgvp":{"name":"parameterDescription","abstract":"

A description for this configuration’s parameters. It can be built using the annotated result builder.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","abstract":"

Apply an untyped configuration to the current value.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationPAAE13supportedKeysShySSGvp":{"name":"supportedKeys","abstract":"

All keys supported by this configuration.

","parent_name":"RuleConfiguration"},"Protocols/AnalyzerRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"AnalyzerRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore27SubstitutionCorrectableRuleP15violationRanges2inSaySo8_NSRangeVGAA0aB4FileC_tF":{"name":"violationRanges(in:)","abstract":"

Returns the NSString-based NSRanges to be replaced in the specified file.

","parent_name":"SubstitutionCorrectableRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore27SubstitutionCorrectableRuleP12substitution3for2inSo8_NSRangeV_SStSgAH_AA0aB4FileCtF":{"name":"substitution(for:in:)","abstract":"

Returns the substitution to apply for the given range.

","parent_name":"SubstitutionCorrectableRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","parent_name":"SubstitutionCorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4file17compilerArgumentsSayAA10CorrectionVGAA0aB4FileC_SaySSGtF":{"name":"correct(file:compilerArguments:)","abstract":"

Attempts to correct the violations to this rule in the specified file.

","parent_name":"CorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","abstract":"

Attempts to correct the violations to this rule in the specified file.

","parent_name":"CorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4file5using17compilerArgumentsSayAA10CorrectionVGAA0aB4FileC_AA0E7StorageCSaySSGtF":{"name":"correct(file:using:compilerArguments:)","abstract":"

Attempts to correct the violations to this rule in the specified file after collecting file info for all files","parent_name":"CorrectableRule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11DescriptionQa":{"name":"Description","abstract":"

The rule’s description type.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP17ConfigurationTypeQa":{"name":"ConfigurationType","abstract":"

The type of the configuration used to configure this rule.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11descriptionAA0D11DescriptionVvpZ":{"name":"description","abstract":"

A verbose description of many of this rule’s properties.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP24configurationDescription0F0Qzvp":{"name":"configurationDescription","abstract":"

A description of how this rule has been configured to run. It can be built using the annotated result builder.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP13configuration17ConfigurationTypeQzvp":{"name":"configuration","abstract":"

This rule’s configuration.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP06shouldB10EmptyFilesSbvp":{"name":"shouldLintEmptyFiles","abstract":"

Whether this rule should be used on empty files. Defaults to false.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePxycfc":{"name":"init()","abstract":"

A default initializer for rules. All rules need to be trivially initializable.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP13configurationxyp_tKcfc":{"name":"init(configuration:)","abstract":"

Creates a rule by applying its configuration.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP9isEqualToySbAaB_pF":{"name":"isEqualTo(_:)","abstract":"

Whether or not the specified rule is equivalent to the current rule.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","abstract":"

Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePAAE16cacheDescriptionSSvp":{"name":"cacheDescription","abstract":"

The cache description which will be used to determine if a previous","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePAAE10identifierSSvpZ":{"name":"identifier","abstract":"

The rule’s unique identifier which is the same as Rule.description.identifier.

","parent_name":"Rule"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP10identifierSSvpZ":{"name":"identifier","abstract":"

The unique identifier for this reporter.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","abstract":"

Whether or not this reporter can output incrementally as violations are found or if all violations must be","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP11descriptionSSvpZ":{"name":"description","abstract":"

A more detailed description of the reporter’s output.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP11descriptionSSvp":{"name":"description","abstract":"

For CustomStringConvertible conformance.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","abstract":"

Return a string with the report for the specified violations.

","parent_name":"Reporter"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8FileInfoQa":{"name":"FileInfo","abstract":"

The kind of information to collect for each file being linted for this rule.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP11collectInfo3for17compilerArguments04FileG0QzAA0abK0C_SaySSGtF":{"name":"collectInfo(for:compilerArguments:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP11collectInfo3for04FileG0QzAA0abI0C_tF":{"name":"collectInfo(for:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8validate4file13collectedInfo17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SDyAL0nI0QzGSaySSGtF":{"name":"validate(file:collectedInfo:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8validate4file13collectedInfoSayAA14StyleViolationVGAA0aB4FileC_SDyAK0lI0QzGtF":{"name":"validate(file:collectedInfo:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CacheDescriptionProvider.html#/s:13SwiftLintCore24CacheDescriptionProviderP05cacheE0SSvp":{"name":"cacheDescription","abstract":"

The cache description which will be used to determine if a previous","parent_name":"CacheDescriptionProvider"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP8KindTypeQa":{"name":"KindType","abstract":"

The kind of token being recursed over.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP8validate4file4kind10dictionarySayAA14StyleViolationVGAA0aB4FileC_8KindTypeQzAA22SourceKittenDictionaryVtF":{"name":"validate(file:kind:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP4kind4from8KindTypeQzSgAA22SourceKittenDictionaryV_tF":{"name":"kind(from:)","abstract":"

Get the kind from the specified dictionary.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRulePAAE8validate4file10dictionarySayAA14StyleViolationVGAA0aB4FileC_AA22SourceKittenDictionaryVtF":{"name":"validate(file:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","abstract":"

Initializer taking a value from a configuration to create an element of Self.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","abstract":"

Make the object an option.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP13asDescription4withAA04RulefI0VSS_tF":{"name":"asDescription(with:)","abstract":"

Make the object a description.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP5apply_6ruleIDyypSg_SStKF":{"name":"apply(_:ruleID:)","abstract":"

Update the object.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","abstract":"

Convert an object to Markdown.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","abstract":"

Convert an object to a single line string.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","abstract":"

Indicate if the item has some content that is useful to document.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","abstract":"

Convert an object to YAML as used in .swiftlint.yml.

","parent_name":"Documentable"},"Protocols/Documentable.html":{"name":"Documentable","abstract":"

A type that can be converted into a human-readable representation.

"},"Protocols/AcceptableByConfigurationElement.html":{"name":"AcceptableByConfigurationElement","abstract":"

Type of an object that can be used as a configuration element.

"},"Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP":{"name":"InlinableOptionType","abstract":"

An option type that can appear inlined into its using configuration.

"},"Protocols/ASTRule.html":{"name":"ASTRule","abstract":"

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s"},"Protocols/CacheDescriptionProvider.html":{"name":"CacheDescriptionProvider","abstract":"

Interface providing access to a cache description.

"},"Protocols.html#/s:13SwiftLintCore17AnyCollectingRuleP":{"name":"AnyCollectingRule","abstract":"

Type-erased protocol used to check whether a rule is collectable.

"},"Protocols/CollectingRule.html":{"name":"CollectingRule","abstract":"

A rule that requires knowledge of all other files being linted.

"},"Protocols/Reporter.html":{"name":"Reporter","abstract":"

An interface for reporting violations as strings.

"},"Protocols/Rule.html":{"name":"Rule","abstract":"

An executable value that can identify issues (violations) in Swift source code.

"},"Protocols.html#/s:13SwiftLintCore9OptInRuleP":{"name":"OptInRule","abstract":"

A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

"},"Protocols/CorrectableRule.html":{"name":"CorrectableRule","abstract":"

A rule that can correct violations.

"},"Protocols/SubstitutionCorrectableRule.html":{"name":"SubstitutionCorrectableRule","abstract":"

A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with"},"Protocols.html#/s:13SwiftLintCore17SourceKitFreeRuleP":{"name":"SourceKitFreeRule","abstract":"

A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

"},"Protocols/AnalyzerRule.html":{"name":"AnalyzerRule","abstract":"

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like"},"Protocols/RuleConfiguration.html":{"name":"RuleConfiguration","abstract":"

A configuration value for a rule to allow users to modify its behavior.

"},"Protocols/SeverityBasedRuleConfiguration.html":{"name":"SeverityBasedRuleConfiguration","abstract":"

A configuration for a rule that allows to configure at least the severity.

"},"Protocols/SwiftSyntaxCorrectableRule.html":{"name":"SwiftSyntaxCorrectableRule","abstract":"

A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

"},"Protocols/SwiftSyntaxRule.html":{"name":"SwiftSyntaxRule","abstract":"

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

"},"Functions.html#/s:13SwiftLintCore12reporterFrom10identifierAA8Reporter_pXpSSSg_tF":{"name":"reporterFrom(identifier:)","abstract":"

Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any"},"Extensions/Double.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Double"},"Extensions/Double.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Double"},"Extensions/Int.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Int"},"Extensions/Int.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Int"},"Extensions/Set.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Set"},"Extensions/Set.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Set"},"Extensions/String.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"String"},"Extensions/String.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"String"},"Extensions/Bool.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Bool"},"Extensions/Bool.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Bool"},"Extensions/Optional.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Optional"},"Extensions/Optional.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Optional"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE26skipWrappingInCommentTestsSayACGyF":{"name":"skipWrappingInCommentTests()","abstract":"

Make these examples skip wrapping in comment tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE25skipWrappingInStringTestsSayACGyF":{"name":"skipWrappingInStringTests()","abstract":"

Make these examples skip wrapping in string tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE24skipMultiByteOffsetTestsSayACGyF":{"name":"skipMultiByteOffsetTests()","abstract":"

Make these examples skip multi-byte offset tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE23skipDisableCommandTestsSayACGyF":{"name":"skipDisableCommandTests()","abstract":"

Make these examples skip disable command tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE23removingViolationMarkerSayACGyF":{"name":"removingViolationMarker()","abstract":"

Remove all violation markers from the examples.

","parent_name":"Array"},"Extensions/Array.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Array"},"Extensions/Array.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA0aB11SyntaxTokenVRszlE5kindsSay21SourceKittenFramework0D4KindOGvp":{"name":"kinds","abstract":"

The kinds for these tokens.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA21ReasonedRuleViolationVRszlE6appendyy0A6Syntax16AbsolutePositionVF":{"name":"append(_:)","abstract":"

Append a minimal violation for the specified position.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA21ReasonedRuleViolationVRszlE6append10contentsOfySay0A6Syntax16AbsolutePositionVG_tF":{"name":"append(contentsOf:)","abstract":"

Append minimal violations for the specified positions.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCore0A6Syntax04DeclD8Protocol_pXpRszlE3allSayAbC_pXpGvpZ":{"name":"all","abstract":"

All visitable declaration syntax types.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCore0A6Syntax04DeclD8Protocol_pXpRszlE9allExceptySayAbC_pXpGAbC_pXpd_tFZ":{"name":"allExcept(_:)","abstract":"

All declarations except for the specified ones.

","parent_name":"Array"},"Extensions/Array.html":{"name":"Array"},"Extensions/Optional.html":{"name":"Optional"},"Extensions/Bool.html":{"name":"Bool"},"Extensions/String.html":{"name":"String"},"Extensions/Set.html":{"name":"Set"},"Extensions/Int.html":{"name":"Int"},"Extensions/Double.html":{"name":"Double"},"Enums/ViolationSeverity.html#/s:13SwiftLintCore17ViolationSeverityO7warningyA2CmF":{"name":"warning","abstract":"

Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:13SwiftLintCore17ViolationSeverityO5erroryA2CmF":{"name":"error","abstract":"

Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ViolationSeverity"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO4callyA2CmF":{"name":"call","abstract":"

A call to a named function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO8argumentyA2CmF":{"name":"argument","abstract":"

An argument value for a function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO5arrayyA2CmF":{"name":"array","abstract":"

An Array expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO10dictionaryyA2CmF":{"name":"dictionary","abstract":"

A Dictionary expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO13objectLiteralyA2CmF":{"name":"objectLiteral","abstract":"

An object literal expression. https://developer.apple.com/swift/blog/?id=33

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO7closureyA2CmF":{"name":"closure","abstract":"

A closure expression. https://docs.swift.org/swift-book/LanguageGuide/Closures.html

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO5tupleyA2CmF":{"name":"tuple","abstract":"

A tuple expression. https://docs.swift.org/swift-book/ReferenceManual/Types.html#ID448

","parent_name":"SwiftExpressionKind"},"Enums/RuleListError.html#/s:13SwiftLintCore13RuleListErrorO24duplicatedConfigurationsyAcA0D0_pXp_tcACmF":{"name":"duplicatedConfigurations(rule:)","abstract":"

The rule list contains more than one configuration for the specified rule.

","parent_name":"RuleListError"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO4lintyA2CmF":{"name":"lint","abstract":"

Describes rules that validate Swift source conventions.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO9idiomaticyA2CmF":{"name":"idiomatic","abstract":"

Describes rules that validate common practices in the Swift community.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO5styleyA2CmF":{"name":"style","abstract":"

Describes rules that validate stylistic choices.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO7metricsyA2CmF":{"name":"metrics","abstract":"

Describes rules that validate magnitudes or measurements of Swift source.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO11performanceyA2CmF":{"name":"performance","abstract":"

Describes rules that validate that code patterns with poor performance are avoided.

","parent_name":"RuleKind"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO3allyA2CmF":{"name":"all","abstract":"

Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO6singleyACSS_tcACmF":{"name":"single(identifier:)","abstract":"

Represents a single SwiftLint rule with the specified identifier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO20stringRepresentationSSvp":{"name":"stringRepresentation","abstract":"

The spelling of the string for this idenfitier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierOyACSScfc":{"name":"init(_:)","abstract":"

Creates a RuleIdentifier by its string representation.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:s26ExpressibleByStringLiteralP06stringD0x0cD4TypeQz_tcfc":{"name":"init(stringLiteral:)","parent_name":"RuleIdentifier"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO5emptyyA2CmF":{"name":"empty","abstract":"

An irrelevant option. It will be ignored in documentation serialization.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4flagyACSbcACmF":{"name":"flag(_:)","abstract":"

A boolean flag.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6stringyACSScACmF":{"name":"string(_:)","abstract":"

A string option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6symbolyACSScACmF":{"name":"symbol(_:)","abstract":"

Like a string option but without quotes in the serialized output.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO7integeryACSicACmF":{"name":"integer(_:)","abstract":"

An integer option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO5floatyACSdcACmF":{"name":"float(_:)","abstract":"

A floating point number option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO8severityyAcA17ViolationSeverityOcACmF":{"name":"severity(_:)","abstract":"

Special option for a ViolationSeverity.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4listyACSayACGcACmF":{"name":"list(_:)","abstract":"

A list of options.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6nestedyAcA28RuleConfigurationDescriptionVcACmF":{"name":"nested(_:)","abstract":"

An option which is another set of configuration options to be nested in the serialized output.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO2egoiyAA017RuleConfigurationD0VSS_ACtFZ":{"name":"=>(_:_:)","abstract":"

Operator enabling an easy way to create a configuration option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4nestyAcA28RuleConfigurationDescriptionVyXEFZ":{"name":"nest(_:)","abstract":"

Create an option defined by nested configuration description.

","parent_name":"OptionType"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO20invalidConfigurationyACSS_tcACmF":{"name":"invalidConfiguration(ruleID:)","abstract":"

The configuration didn’t match internal expectations.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO29deprecatedConfigurationOptionyACSS_S2SSgtcACmF":{"name":"deprecatedConfigurationOption(ruleID:key:alternative:)","abstract":"

Issued when an option is deprecated. Suggests an alternative optionally.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14nothingAppliedyACSS_tcACmF":{"name":"nothingApplied(ruleID:)","abstract":"

Used in configuration parsing when no changes have been applied. Use only internally!

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO18listedMultipleTimeyACSS_SitcACmF":{"name":"listedMultipleTime(ruleID:times:)","abstract":"

Rule is listed multiple times in the configuration.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO17renamedIdentifieryACSS_SStcACmF":{"name":"renamedIdentifier(old:new:)","abstract":"

An identifier old has been renamed to new.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24invalidConfigurationKeysyACSS_ShySSGtcACmF":{"name":"invalidConfigurationKeys(ruleID:keys:)","abstract":"

Some configuration keys are invalid.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14invalidRuleIDsyACShySSGcACmF":{"name":"invalidRuleIDs(_:)","abstract":"

Used rule IDs are invalid.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO25ruleNotPresentInOnlyRulesyACSS_tcACmF":{"name":"ruleNotPresentInOnlyRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not present in only_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO014ruleDisabledInF5RulesyACSS_tcACmF":{"name":"ruleDisabledInDisabledRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is disabled.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO33ruleDisabledInParentConfigurationyACSS_tcACmF":{"name":"ruleDisabledInParentConfiguration(ruleID:)","abstract":"

Found a rule configuration for a rule that is disabled in the parent configuration.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO019ruleNotEnabledInOptH5RulesyACSS_tcACmF":{"name":"ruleNotEnabledInOptInRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not enabled in opt_in_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO31ruleNotEnabledInParentOnlyRulesyACSS_tcACmF":{"name":"ruleNotEnabledInParentOnlyRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not enabled in parent only_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14genericWarningyACSScACmF":{"name":"genericWarning(_:)","abstract":"

A generic warning specified by a string.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO12genericErroryACSScACmF":{"name":"genericError(_:)","abstract":"

A generic error specified by a string.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14ruleDeprecatedyACSS_tcACmF":{"name":"ruleDeprecated(ruleID:)","abstract":"

A deprecation warning for a rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO19initialFileNotFoundyACSS_tcACmF":{"name":"initialFileNotFound(path:)","abstract":"

The initial configuration file was not found.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO12fileNotFoundyACSS_tcACmF":{"name":"fileNotFound(path:)","abstract":"

A file at specified path was not found.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO15fileNotReadableyACSSSg_SStcACmF":{"name":"fileNotReadable(path:ruleID:)","abstract":"

The file at path is not readable or cannot be opened.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO15fileNotWritableyACSS_tcACmF":{"name":"fileNotWritable(path:)","abstract":"

The file at path is not writable.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO13indexingErroryACSSSg_SStcACmF":{"name":"indexingError(path:ruleID:)","abstract":"

The file at path cannot be indexed by a specific rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24missingCompilerArgumentsyACSSSg_SStcACmF":{"name":"missingCompilerArguments(path:ruleID:)","abstract":"

No arguments were provided to compile a file at path within a specific rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO17missingCursorInfoyACSSSg_SStcACmF":{"name":"missingCursorInfo(path:ruleID:)","abstract":"

Cursor information cannot be extracted from a specific location.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO11yamlParsingyACSScACmF":{"name":"yamlParsing(_:)","abstract":"

An error that occurred when parsing YAML.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO19baselineNotReadableyACSS_tcACmF":{"name":"baselineNotReadable(path:)","abstract":"

The baseline file at path is not readable or cannot be opened.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24printDeprecationWarningsSbvpZ":{"name":"printDeprecationWarnings","abstract":"

Flag to enable warnings for deprecations being printed to the console. Printing is enabled by default.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO5printyyF":{"name":"print()","abstract":"

Print the issue to the console.

","parent_name":"Issue"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO7privateyA2CmF":{"name":"private","abstract":"

Accessible by the declaration’s immediate lexical scope.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO11fileprivateyA2CmF":{"name":"fileprivate","abstract":"

Accessible by the declaration’s same file.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO8internalyA2CmF":{"name":"internal","abstract":"

Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO7packageyA2CmF":{"name":"package","abstract":"

Accessible by all the modules defined in the same Swift package.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO6publicyA2CmF":{"name":"public","abstract":"

Accessible by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO4openyA2CmF":{"name":"open","abstract":"

Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO11descriptionACSgSS_tcfc":{"name":"init(description:)","abstract":"

Initializes an access control level by its Swift source keyword value.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO9isPrivateSbvp":{"name":"isPrivate","abstract":"

Returns true if is private or fileprivate

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"AccessControlLevel"},"Enums/ExecutableInfo.html#/s:13SwiftLintCore14ExecutableInfoO7buildIDSSSgvpZ":{"name":"buildID","abstract":"

A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

","parent_name":"ExecutableInfo"},"Enums/ExecutableInfo.html":{"name":"ExecutableInfo","abstract":"

Information about this executable.

"},"Enums/AccessControlLevel.html":{"name":"AccessControlLevel","abstract":"

The accessibility of a Swift source declaration.

"},"Enums/Issue.html":{"name":"Issue","abstract":"

All possible SwiftLint issues which are printed as warnings by default.

"},"Enums/OptionType.html":{"name":"OptionType","abstract":"

Type of an option.

"},"Enums/RuleIdentifier.html":{"name":"RuleIdentifier","abstract":"

An identifier representing a SwiftLint rule, or all rules.

"},"Enums/RuleKind.html":{"name":"RuleKind","abstract":"

All the possible rule kinds (categories).

"},"Enums/RuleListError.html":{"name":"RuleListError","abstract":"

All possible rule list configuration errors.

"},"Enums/SwiftExpressionKind.html":{"name":"SwiftExpressionKind","abstract":"

The kind of expression for a contiguous set of Swift source tokens.

"},"Enums/ViolationSeverity.html":{"name":"ViolationSeverity","abstract":"

The magnitude of a StyleViolation.

"},"Global%20Variables.html#/s:13SwiftLintCore13reportersListSayAA8Reporter_pXpGvp":{"name":"reportersList","abstract":"

The reporters list containing all the reporters built into SwiftLint.

"},"Global%20Variables.html#/s:13SwiftLintCore9coreRulesSayAA4Rule_pXpGvp":{"name":"coreRules","abstract":"

The rule list containing all available rules built into SwiftLintCore.

"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC13configurationxvp":{"name":"configuration","abstract":"

A rule’s configuration.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file from which the traversed syntax tree stems from.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC17locationConverter0aE0014SourceLocationH0Cvp":{"name":"locationConverter","abstract":"

A source location converter associated with the syntax tree being traversed.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC13configuration4fileACyxGx_AA0aB4FileCtcfc":{"name":"init(configuration:file:)","abstract":"

Initializer for a ViolationsSyntaxVisitor.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC10violationsSayAA21ReasonedRuleViolationVGvp":{"name":"violations","abstract":"

Positions in a source file where violations should be reported.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC20violationCorrectionsSayAA19ViolationCorrectionVGvp":{"name":"violationCorrections","abstract":"

Ranges of violations to be used in rewriting (see SwiftSyntaxCorrectableRule). It is not mandatory to fill","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC21skippableDeclarationsSay0aE004DeclE8Protocol_pXpGvp":{"name":"skippableDeclarations","abstract":"

List of declaration types that shall be skipped while traversing the AST.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ActorDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ClassDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE08EnumDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE013ExtensionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012FunctionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE015InitializerDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012ProtocolDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE010StructDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE013SubscriptDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012VariableDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5Scopea":{"name":"Scope","abstract":"

A type that remembers the declared identifiers (in order) up to the current position in the code.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5scopeAA5StackVyShySSGGvp":{"name":"scope","abstract":"

The hierarchical stack of identifiers declared up to the current position in the code.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC13configuration4file5scopeACyxGx_AA0aB4FileCAA5StackVyShySSGGtcfc":{"name":"init(configuration:file:scope:)","abstract":"

Initializer.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC18hasSeenDeclaration3forSbSS_tF":{"name":"hasSeenDeclaration(for:)","abstract":"

Indicate whether a given identifier is in scope.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5visity0A6Syntax0iG12ContinueKindOAE017CodeBlockItemListI0VF":{"name":"visit(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax017CodeBlockItemListJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax012VariableDeclJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax09GuardStmtJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO12indentSpacesyAESicAEmF":{"name":"indentSpaces(_:)","abstract":"

Indentation with a number of spaces.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO14unindentSpacesyAESicAEmF":{"name":"unindentSpaces(_:)","abstract":"

Reverse indentation of a number of spaces.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO10indentTabsyAESicAEmF":{"name":"indentTabs(_:)","abstract":"

Indentation with a number of tabs

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO12unindentTabsyAESicAEmF":{"name":"unindentTabs(_:)","abstract":"

Reverse indentation of a number of tabs.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html":{"name":"IndentationStyle","abstract":"

Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and","parent_name":"CodeIndentingRewriter"},"Classes/CodeIndentingRewriter.html#/s:13SwiftLintCore21CodeIndentingRewriterC5styleA2C16IndentationStyleO_tcfc":{"name":"init(style:)","abstract":"

Initializer accepting an indentation style.

","parent_name":"CodeIndentingRewriter"},"Classes/CodeIndentingRewriter.html#/s:13SwiftLintCore21CodeIndentingRewriterC5visity0A6Syntax05TokenH0VAGF":{"name":"visit(_:)","parent_name":"CodeIndentingRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC13configurationxvp":{"name":"configuration","abstract":"

A rule’s configuration.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file from which the traversed syntax tree stems from.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC17locationConverter0aE0014SourceLocationH0Cvp":{"name":"locationConverter","abstract":"

A converter of positions in the traversed source file.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC15disabledRegionsSay0aE011SourceRangeVGvp":{"name":"disabledRegions","abstract":"

The regions in the traversed file that are disabled by a command.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC19correctionPositionsSay0aE016AbsolutePositionVGvp":{"name":"correctionPositions","abstract":"

Positions in a source file where corrections were applied.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC13configuration4fileACyxGx_AA0aB4FileCtcfc":{"name":"init(configuration:file:)","abstract":"

Initilizer for a ViolationsSyntaxRewriter.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC8visitAnyy0aE00E0VSgAGF":{"name":"visitAny(_:)","parent_name":"ViolationsSyntaxRewriter"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4file21SourceKittenFramework0D0Cvp":{"name":"file","abstract":"

The underlying SourceKitten file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC2id10Foundation4UUIDVvp":{"name":"id","abstract":"

The associated unique identifier for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC06isTestD0Sbvp":{"name":"isTestFile","abstract":"

Whether or not this is a file generated for testing purposes.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC9isVirtualSbvp":{"name":"isVirtual","abstract":"

A file is virtual if it is not backed by a filesystem path.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4fileAC21SourceKittenFramework0D0C_tcfc":{"name":"init(file:)","abstract":"

Creates a SwiftLintFile with a SourceKitten File.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4pathACSgSS_tcfc":{"name":"init(path:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk.","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC20pathDeferringReadingACSS_tcfc":{"name":"init(pathDeferringReading:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC8contentsACSS_tcfc":{"name":"init(contents:)","abstract":"

Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4pathSSSgvp":{"name":"path","abstract":"

The path on disk for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC8contentsSSvp":{"name":"contents","abstract":"

The file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC10stringView21SourceKittenFramework06StringF0Vvp":{"name":"stringView","abstract":"

A string view into the contents of this file optimized for string manipulation operations.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC5linesSay21SourceKittenFramework4LineVGvp":{"name":"lines","abstract":"

The parsed lines for this file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"SwiftLintFile"},"Classes/RuleStorage.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"RuleStorage"},"Classes/RuleStorage.html#/s:13SwiftLintCore11RuleStorageCACycfc":{"name":"init()","abstract":"

Creates a RuleStorage with no initial stored data.

","parent_name":"RuleStorage"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC6sharedACvpZ":{"name":"shared","abstract":"

Shared rule registry instance.

","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC4listAA0D4ListVvp":{"name":"list","abstract":"

Rule list associated with this registry. Lazily created, and","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC8register5rulesySayAA0D0_pXpG_tF":{"name":"register(rules:)","abstract":"

Register rules.

","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC4rule5forIDAA0D0_pXpSgSS_tF":{"name":"rule(forID:)","abstract":"

Look up a rule for a given ID.

","parent_name":"RuleRegistry"},"Classes/LinterCache.html#/s:13SwiftLintCore11LinterCacheC13configuration11fileManagerAcA13ConfigurationV_xtcAA012LintableFileH0Rzlufc":{"name":"init(configuration:fileManager:)","abstract":"

Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

","parent_name":"LinterCache"},"Classes/LinterCache.html#/s:13SwiftLintCore11LinterCacheC4saveyyKF":{"name":"save()","abstract":"

Persists the cache to disk.

","parent_name":"LinterCache"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC6sharedACvpZ":{"name":"shared","abstract":"

Singleton.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC8activateyyF":{"name":"activate()","abstract":"

Tell the timer it should record time spent in rules.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC4dumpSDySSSdGyF":{"name":"dump()","abstract":"

Return all time spent for each custom rule, keyed by rule ID.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html":{"name":"CustomRuleTimer","abstract":"

Utility to measure the time spent in each custom rule.

"},"Classes/LinterCache.html":{"name":"LinterCache","abstract":"

A persisted cache for storing and retrieving linter results.

"},"Classes/RuleRegistry.html":{"name":"RuleRegistry","abstract":"

Container to register and look up SwiftLint rules.

"},"Classes/RuleStorage.html":{"name":"RuleStorage","abstract":"

A storage mechanism for aggregating the results of CollectingRules.

"},"Classes/SwiftLintFile.html":{"name":"SwiftLintFile","abstract":"

A unit of Swift source code, either on disk or in memory.

"},"Classes/ViolationsSyntaxRewriter.html":{"name":"ViolationsSyntaxRewriter","abstract":"

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

"},"Classes/CodeIndentingRewriter.html":{"name":"CodeIndentingRewriter","abstract":"

Rewriter that indents or unindents a syntax piece including comments and nested"},"Classes/DeclaredIdentifiersTrackingVisitor.html":{"name":"DeclaredIdentifiersTrackingVisitor","abstract":"

A specialized ViolationsSyntaxVisitor that tracks declared identifiers per scope while traversing the AST.

"},"Classes/ViolationsSyntaxVisitor.html":{"name":"ViolationsSyntaxVisitor","abstract":"

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

"},"swift-syntax-dashboard.html":{"name":"Swift Syntax Dashboard"},"accessibility_label_for_image.html":{"name":"accessibility_label_for_image"},"accessibility_trait_for_button.html":{"name":"accessibility_trait_for_button"},"anonymous_argument_in_multiline_closure.html":{"name":"anonymous_argument_in_multiline_closure"},"anyobject_protocol.html":{"name":"anyobject_protocol"},"array_init.html":{"name":"array_init"},"attributes.html":{"name":"attributes"},"balanced_xctest_lifecycle.html":{"name":"balanced_xctest_lifecycle"},"blanket_disable_command.html":{"name":"blanket_disable_command"},"block_based_kvo.html":{"name":"block_based_kvo"},"capture_variable.html":{"name":"capture_variable"},"class_delegate_protocol.html":{"name":"class_delegate_protocol"},"closing_brace.html":{"name":"closing_brace"},"closure_body_length.html":{"name":"closure_body_length"},"closure_end_indentation.html":{"name":"closure_end_indentation"},"closure_parameter_position.html":{"name":"closure_parameter_position"},"closure_spacing.html":{"name":"closure_spacing"},"collection_alignment.html":{"name":"collection_alignment"},"colon.html":{"name":"colon"},"comma.html":{"name":"comma"},"comma_inheritance.html":{"name":"comma_inheritance"},"comment_spacing.html":{"name":"comment_spacing"},"compiler_protocol_init.html":{"name":"compiler_protocol_init"},"computed_accessors_order.html":{"name":"computed_accessors_order"},"conditional_returns_on_newline.html":{"name":"conditional_returns_on_newline"},"contains_over_filter_count.html":{"name":"contains_over_filter_count"},"contains_over_filter_is_empty.html":{"name":"contains_over_filter_is_empty"},"contains_over_first_not_nil.html":{"name":"contains_over_first_not_nil"},"contains_over_range_nil_comparison.html":{"name":"contains_over_range_nil_comparison"},"control_statement.html":{"name":"control_statement"},"convenience_type.html":{"name":"convenience_type"},"custom_rules.html":{"name":"custom_rules"},"cyclomatic_complexity.html":{"name":"cyclomatic_complexity"},"deployment_target.html":{"name":"deployment_target"},"direct_return.html":{"name":"direct_return"},"discarded_notification_center_observer.html":{"name":"discarded_notification_center_observer"},"discouraged_assert.html":{"name":"discouraged_assert"},"discouraged_direct_init.html":{"name":"discouraged_direct_init"},"discouraged_none_name.html":{"name":"discouraged_none_name"},"discouraged_object_literal.html":{"name":"discouraged_object_literal"},"discouraged_optional_boolean.html":{"name":"discouraged_optional_boolean"},"discouraged_optional_collection.html":{"name":"discouraged_optional_collection"},"duplicate_conditions.html":{"name":"duplicate_conditions"},"duplicate_enum_cases.html":{"name":"duplicate_enum_cases"},"duplicate_imports.html":{"name":"duplicate_imports"},"duplicated_key_in_dictionary_literal.html":{"name":"duplicated_key_in_dictionary_literal"},"dynamic_inline.html":{"name":"dynamic_inline"},"empty_collection_literal.html":{"name":"empty_collection_literal"},"empty_count.html":{"name":"empty_count"},"empty_enum_arguments.html":{"name":"empty_enum_arguments"},"empty_parameters.html":{"name":"empty_parameters"},"empty_parentheses_with_trailing_closure.html":{"name":"empty_parentheses_with_trailing_closure"},"empty_string.html":{"name":"empty_string"},"empty_xctest_method.html":{"name":"empty_xctest_method"},"enum_case_associated_values_count.html":{"name":"enum_case_associated_values_count"},"expiring_todo.html":{"name":"expiring_todo"},"explicit_acl.html":{"name":"explicit_acl"},"explicit_enum_raw_value.html":{"name":"explicit_enum_raw_value"},"explicit_init.html":{"name":"explicit_init"},"explicit_self.html":{"name":"explicit_self"},"explicit_top_level_acl.html":{"name":"explicit_top_level_acl"},"explicit_type_interface.html":{"name":"explicit_type_interface"},"extension_access_modifier.html":{"name":"extension_access_modifier"},"fallthrough.html":{"name":"fallthrough"},"fatal_error_message.html":{"name":"fatal_error_message"},"file_header.html":{"name":"file_header"},"file_length.html":{"name":"file_length"},"file_name.html":{"name":"file_name"},"file_name_no_space.html":{"name":"file_name_no_space"},"file_types_order.html":{"name":"file_types_order"},"final_test_case.html":{"name":"final_test_case"},"first_where.html":{"name":"first_where"},"flatmap_over_map_reduce.html":{"name":"flatmap_over_map_reduce"},"for_where.html":{"name":"for_where"},"force_cast.html":{"name":"force_cast"},"force_try.html":{"name":"force_try"},"force_unwrapping.html":{"name":"force_unwrapping"},"function_body_length.html":{"name":"function_body_length"},"function_default_parameter_at_end.html":{"name":"function_default_parameter_at_end"},"function_parameter_count.html":{"name":"function_parameter_count"},"generic_type_name.html":{"name":"generic_type_name"},"ibinspectable_in_extension.html":{"name":"ibinspectable_in_extension"},"identical_operands.html":{"name":"identical_operands"},"identifier_name.html":{"name":"identifier_name"},"implicit_getter.html":{"name":"implicit_getter"},"implicit_return.html":{"name":"implicit_return"},"implicitly_unwrapped_optional.html":{"name":"implicitly_unwrapped_optional"},"inclusive_language.html":{"name":"inclusive_language"},"indentation_width.html":{"name":"indentation_width"},"inert_defer.html":{"name":"inert_defer"},"invalid_swiftlint_command.html":{"name":"invalid_swiftlint_command"},"is_disjoint.html":{"name":"is_disjoint"},"joined_default_parameter.html":{"name":"joined_default_parameter"},"large_tuple.html":{"name":"large_tuple"},"last_where.html":{"name":"last_where"},"leading_whitespace.html":{"name":"leading_whitespace"},"legacy_cggeometry_functions.html":{"name":"legacy_cggeometry_functions"},"legacy_constant.html":{"name":"legacy_constant"},"legacy_constructor.html":{"name":"legacy_constructor"},"legacy_hashing.html":{"name":"legacy_hashing"},"legacy_multiple.html":{"name":"legacy_multiple"},"legacy_nsgeometry_functions.html":{"name":"legacy_nsgeometry_functions"},"legacy_objc_type.html":{"name":"legacy_objc_type"},"legacy_random.html":{"name":"legacy_random"},"let_var_whitespace.html":{"name":"let_var_whitespace"},"line_length.html":{"name":"line_length"},"literal_expression_end_indentation.html":{"name":"literal_expression_end_indentation"},"local_doc_comment.html":{"name":"local_doc_comment"},"lower_acl_than_parent.html":{"name":"lower_acl_than_parent"},"mark.html":{"name":"mark"},"missing_docs.html":{"name":"missing_docs"},"modifier_order.html":{"name":"modifier_order"},"multiline_arguments.html":{"name":"multiline_arguments"},"multiline_arguments_brackets.html":{"name":"multiline_arguments_brackets"},"multiline_function_chains.html":{"name":"multiline_function_chains"},"multiline_literal_brackets.html":{"name":"multiline_literal_brackets"},"multiline_parameters.html":{"name":"multiline_parameters"},"multiline_parameters_brackets.html":{"name":"multiline_parameters_brackets"},"multiple_closures_with_trailing_closure.html":{"name":"multiple_closures_with_trailing_closure"},"nesting.html":{"name":"nesting"},"nimble_operator.html":{"name":"nimble_operator"},"no_extension_access_modifier.html":{"name":"no_extension_access_modifier"},"no_fallthrough_only.html":{"name":"no_fallthrough_only"},"no_grouping_extension.html":{"name":"no_grouping_extension"},"no_magic_numbers.html":{"name":"no_magic_numbers"},"no_space_in_method_call.html":{"name":"no_space_in_method_call"},"non_optional_string_data_conversion.html":{"name":"non_optional_string_data_conversion"},"non_overridable_class_declaration.html":{"name":"non_overridable_class_declaration"},"notification_center_detachment.html":{"name":"notification_center_detachment"},"ns_number_init_as_function_reference.html":{"name":"ns_number_init_as_function_reference"},"nslocalizedstring_key.html":{"name":"nslocalizedstring_key"},"nslocalizedstring_require_bundle.html":{"name":"nslocalizedstring_require_bundle"},"nsobject_prefer_isequal.html":{"name":"nsobject_prefer_isequal"},"number_separator.html":{"name":"number_separator"},"object_literal.html":{"name":"object_literal"},"one_declaration_per_file.html":{"name":"one_declaration_per_file"},"opening_brace.html":{"name":"opening_brace"},"operator_usage_whitespace.html":{"name":"operator_usage_whitespace"},"operator_whitespace.html":{"name":"operator_whitespace"},"optional_enum_case_matching.html":{"name":"optional_enum_case_matching"},"orphaned_doc_comment.html":{"name":"orphaned_doc_comment"},"overridden_super_call.html":{"name":"overridden_super_call"},"override_in_extension.html":{"name":"override_in_extension"},"pattern_matching_keywords.html":{"name":"pattern_matching_keywords"},"period_spacing.html":{"name":"period_spacing"},"prefer_nimble.html":{"name":"prefer_nimble"},"prefer_self_in_static_references.html":{"name":"prefer_self_in_static_references"},"prefer_self_type_over_type_of_self.html":{"name":"prefer_self_type_over_type_of_self"},"prefer_zero_over_explicit_init.html":{"name":"prefer_zero_over_explicit_init"},"prefixed_toplevel_constant.html":{"name":"prefixed_toplevel_constant"},"private_action.html":{"name":"private_action"},"private_outlet.html":{"name":"private_outlet"},"private_over_fileprivate.html":{"name":"private_over_fileprivate"},"private_subject.html":{"name":"private_subject"},"private_swiftui_state.html":{"name":"private_swiftui_state"},"private_unit_test.html":{"name":"private_unit_test"},"prohibited_interface_builder.html":{"name":"prohibited_interface_builder"},"prohibited_super_call.html":{"name":"prohibited_super_call"},"protocol_property_accessors_order.html":{"name":"protocol_property_accessors_order"},"quick_discouraged_call.html":{"name":"quick_discouraged_call"},"quick_discouraged_focused_test.html":{"name":"quick_discouraged_focused_test"},"quick_discouraged_pending_test.html":{"name":"quick_discouraged_pending_test"},"raw_value_for_camel_cased_codable_enum.html":{"name":"raw_value_for_camel_cased_codable_enum"},"reduce_boolean.html":{"name":"reduce_boolean"},"reduce_into.html":{"name":"reduce_into"},"redundant_discardable_let.html":{"name":"redundant_discardable_let"},"redundant_nil_coalescing.html":{"name":"redundant_nil_coalescing"},"redundant_objc_attribute.html":{"name":"redundant_objc_attribute"},"redundant_optional_initialization.html":{"name":"redundant_optional_initialization"},"redundant_self_in_closure.html":{"name":"redundant_self_in_closure"},"redundant_set_access_control.html":{"name":"redundant_set_access_control"},"redundant_string_enum_value.html":{"name":"redundant_string_enum_value"},"redundant_type_annotation.html":{"name":"redundant_type_annotation"},"redundant_void_return.html":{"name":"redundant_void_return"},"required_deinit.html":{"name":"required_deinit"},"required_enum_case.html":{"name":"required_enum_case"},"return_arrow_whitespace.html":{"name":"return_arrow_whitespace"},"return_value_from_void_function.html":{"name":"return_value_from_void_function"},"self_binding.html":{"name":"self_binding"},"self_in_property_initialization.html":{"name":"self_in_property_initialization"},"shorthand_argument.html":{"name":"shorthand_argument"},"shorthand_operator.html":{"name":"shorthand_operator"},"shorthand_optional_binding.html":{"name":"shorthand_optional_binding"},"single_test_class.html":{"name":"single_test_class"},"sorted_enum_cases.html":{"name":"sorted_enum_cases"},"sorted_first_last.html":{"name":"sorted_first_last"},"sorted_imports.html":{"name":"sorted_imports"},"statement_position.html":{"name":"statement_position"},"static_operator.html":{"name":"static_operator"},"static_over_final_class.html":{"name":"static_over_final_class"},"strict_fileprivate.html":{"name":"strict_fileprivate"},"strong_iboutlet.html":{"name":"strong_iboutlet"},"superfluous_disable_command.html":{"name":"superfluous_disable_command"},"superfluous_else.html":{"name":"superfluous_else"},"switch_case_alignment.html":{"name":"switch_case_alignment"},"switch_case_on_newline.html":{"name":"switch_case_on_newline"},"syntactic_sugar.html":{"name":"syntactic_sugar"},"test_case_accessibility.html":{"name":"test_case_accessibility"},"todo.html":{"name":"todo"},"toggle_bool.html":{"name":"toggle_bool"},"trailing_closure.html":{"name":"trailing_closure"},"trailing_comma.html":{"name":"trailing_comma"},"trailing_newline.html":{"name":"trailing_newline"},"trailing_semicolon.html":{"name":"trailing_semicolon"},"trailing_whitespace.html":{"name":"trailing_whitespace"},"type_body_length.html":{"name":"type_body_length"},"type_contents_order.html":{"name":"type_contents_order"},"type_name.html":{"name":"type_name"},"typesafe_array_init.html":{"name":"typesafe_array_init"},"unavailable_condition.html":{"name":"unavailable_condition"},"unavailable_function.html":{"name":"unavailable_function"},"unhandled_throwing_task.html":{"name":"unhandled_throwing_task"},"unneeded_break_in_switch.html":{"name":"unneeded_break_in_switch"},"unneeded_override.html":{"name":"unneeded_override"},"unneeded_parentheses_in_closure_argument.html":{"name":"unneeded_parentheses_in_closure_argument"},"unneeded_synthesized_initializer.html":{"name":"unneeded_synthesized_initializer"},"unowned_variable_capture.html":{"name":"unowned_variable_capture"},"untyped_error_in_catch.html":{"name":"untyped_error_in_catch"},"unused_capture_list.html":{"name":"unused_capture_list"},"unused_closure_parameter.html":{"name":"unused_closure_parameter"},"unused_control_flow_label.html":{"name":"unused_control_flow_label"},"unused_declaration.html":{"name":"unused_declaration"},"unused_enumerated.html":{"name":"unused_enumerated"},"unused_import.html":{"name":"unused_import"},"unused_optional_binding.html":{"name":"unused_optional_binding"},"unused_setter_value.html":{"name":"unused_setter_value"},"valid_ibinspectable.html":{"name":"valid_ibinspectable"},"vertical_parameter_alignment.html":{"name":"vertical_parameter_alignment"},"vertical_parameter_alignment_on_call.html":{"name":"vertical_parameter_alignment_on_call"},"vertical_whitespace.html":{"name":"vertical_whitespace"},"vertical_whitespace_between_cases.html":{"name":"vertical_whitespace_between_cases"},"vertical_whitespace_closing_braces.html":{"name":"vertical_whitespace_closing_braces"},"vertical_whitespace_opening_braces.html":{"name":"vertical_whitespace_opening_braces"},"void_function_in_ternary.html":{"name":"void_function_in_ternary"},"void_return.html":{"name":"void_return"},"weak_delegate.html":{"name":"weak_delegate"},"xct_specific_matcher.html":{"name":"xct_specific_matcher"},"xctfail_message.html":{"name":"xctfail_message"},"yoda_condition.html":{"name":"yoda_condition"},"rule-directory.html":{"name":"Rule Directory"},"Rules.html":{"name":"Rules"},"Guides.html":{"name":"Guides","abstract":"

The following guides are available globally.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Global%20Variables.html":{"name":"Global Variables","abstract":"

The following global variables are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Functions.html":{"name":"Functions","abstract":"

The following functions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"}} \ No newline at end of file diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_binding.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_binding.html deleted file mode 100644 index 6929c3983..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_binding.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - self_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Self Binding

- -

Re-bind self to a consistent identifier name.

- -
    -
  • Identifier: self_binding
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -bind_identifier - -“self” -
  • -
-

Non Triggering Examples

-
if let self = self { return }
-
-
guard let self = self else { return }
-
-
if let this = this { return }
-
-
guard let this = this else { return }
-
-
if let this = self { return }
-
-
guard let this = self else { return }
-
-

Triggering Examples

-
if let ↓`self` = self { return }
-
-
guard let ↓`self` = self else { return }
-
-
if let ↓this = self { return }
-
-
guard let ↓this = self else { return }
-
-
if let ↓self = self { return }
-
-
guard let ↓self = self else { return }
-
-
if let ↓self { return }
-
-
guard let ↓self else { return }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_in_property_initialization.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_in_property_initialization.html deleted file mode 100644 index 2bd2e7e19..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/self_in_property_initialization.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - self_in_property_initialization Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Self in Property Initialization

- -

self refers to the unapplied NSObject.self() method, which is likely not expected; make the variable lazy to be able to refer to the current instance or use ClassName.self

- -
    -
  • Identifier: self_in_property_initialization
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class View: UIView {
-    let button: UIButton = {
-        return UIButton()
-    }()
-}
-
-
class View: UIView {
-    lazy var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(otherObject, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    private let collectionView: UICollectionView = {
-        let layout = UICollectionViewFlowLayout()
-        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
-        collectionView.registerReusable(Cell.self)
-
-        return collectionView
-    }()
-}
-
-

Triggering Examples

-
class View: UIView {
-    ↓var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    ↓let button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_argument.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_argument.html deleted file mode 100644 index e4ca4c607..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_argument.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - shorthand_argument Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Argument

- -

Shorthand arguments like $0, $1, etc. in closures can be confusing. Avoid using them too far away from the beginning of the closure. Optionally, while usage of a single shorthand argument is okay, more than one or complex ones with field accesses might increase the risk of obfuscation.

- -
    -
  • Identifier: shorthand_argument
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_until_line_after_opening_brace - -4 -
    -always_disallow_more_than_one - -false -
    -always_disallow_member_access - -false -
  • -
-

Non Triggering Examples

-
    f { $0 }
-
-
    f {
-        $0
-      + $1
-      + $2
-    }
-
-
    f { $0.a + $0.b }
-
-
    f {
-        $0
-      +  g { $0 }
-
-

Triggering Examples

-
    f {
-        $0
-      + $1
-      + $2
-
-      + ↓$0
-    }
-
-
    f {
-        $0
-      + $1
-      + $2
-      +  5
-      + $0
-      + ↓$1
-    }
-
-
    f { ↓$0 + ↓$1 }
-
-
    f {
-        ↓$0.a
-      + ↓$0.b
-      + $1
-      + ↓$2.c
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_operator.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_operator.html deleted file mode 100644 index 295e20cf8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_operator.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - shorthand_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Operator

- -

Prefer shorthand operators (+=, -=, *=, /=) over doing the operation and assigning

- -
    -
  • Identifier: shorthand_operator
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
foo -= 1
-
-
foo += variable
-
-
foo *= bar.method()
-
-
self.foo = foo / 1
-
-
foo = self.foo + 1
-
-
page = ceilf(currentOffset * pageWidth)
-
-
foo = aMethod(foo / bar)
-
-
foo = aMethod(bar + foo)
-
-
public func -= (lhs: inout Foo, rhs: Int) {
-    lhs = lhs - rhs
-}
-
-
var helloWorld = "world!"
- helloWorld = "Hello, " + helloWorld
-
-
angle = someCheck ? angle : -angle
-
-
seconds = seconds * 60 + value
-
-

Triggering Examples

-
↓foo = foo * 1
-
-
↓foo = foo / aVariable
-
-
↓foo = foo - bar.method()
-
-
↓foo.aProperty = foo.aProperty - 1
-
-
↓self.aProperty = self.aProperty * 1
-
-
↓n = n + i / outputLength
-
-
↓n = n - i / outputLength
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_optional_binding.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_optional_binding.html deleted file mode 100644 index 2578283ed..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/shorthand_optional_binding.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - shorthand_optional_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Optional Binding

- -

Use shorthand syntax for optional binding

- -
    -
  • Identifier: shorthand_optional_binding
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.7.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    if let i {}
-    if let i = a {}
-    guard let i = f() else {}
-    if var i = i() {}
-    if let i = i as? Foo {}
-    guard let `self` = self else {}
-    while var i { i = nil }
-
-

Triggering Examples

-
    if ↓let i = i {}
-    if ↓let self = self {}
-    if ↓var `self` = `self` {}
-    if i > 0, ↓let j = j {}
-    if ↓let i = i, ↓var j = j {}
-
-
    guard ↓let i = i else {}
-    guard ↓let self = self else {}
-    guard ↓var `self` = `self` else {}
-    guard i > 0, ↓let j = j else {}
-    guard ↓let i = i, ↓var j = j else {}
-
-
    while ↓var i = i { i = nil }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/single_test_class.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/single_test_class.html deleted file mode 100644 index 7f29d1ebc..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/single_test_class.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - single_test_class Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Single Test Class

- -

Test files should contain a single QuickSpec or XCTestCase class.

- -
    -
  • Identifier: single_test_class
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
class FooTests {  }
-
-
class FooTests: QuickSpec {  }
-
-
class FooTests: XCTestCase {  }
-
-

Triggering Examples

-
↓class FooTests: QuickSpec {  }
-↓class BarTests: QuickSpec {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: QuickSpec {  }
-↓class TotoTests: QuickSpec {  }
-
-
↓class FooTests: XCTestCase {  }
-↓class BarTests: XCTestCase {  }
-
-
↓class FooTests: XCTestCase {  }
-↓class BarTests: XCTestCase {  }
-↓class TotoTests: XCTestCase {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-class TotoTests {  }
-
-
final ↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-class TotoTests {  }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_enum_cases.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_enum_cases.html deleted file mode 100644 index 59be4daff..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_enum_cases.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - sorted_enum_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Sorted Enum Cases

- -

Enum cases should be sorted

- -
    -
  • Identifier: sorted_enum_cases
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum foo {
-    case a
-    case b
-    case c
-}
-
-
enum foo {
-    case example
-    case exBoyfriend
-}
-
-
enum foo {
-    case a
-    case B
-    case c
-}
-
-
enum foo {
-    case a, b, c
-}
-
-
enum foo {
-    case a
-    case b, c
-}
-
-
enum foo {
-    case a(foo: Foo)
-    case b(String), c
-}
-
-
enum foo {
-    case a
-    case b, C, d
-}
-
-
@frozen
-enum foo {
-    case b
-    case a
-    case c, f, d
-}
-
-

Triggering Examples

-
enum foo {
-    ↓case b
-    ↓case a
-    case c
-}
-
-
enum foo {
-    ↓case B
-    ↓case a
-    case c
-}
-
-
enum foo {
-    case ↓b, ↓a, c
-}
-
-
enum foo {
-    case ↓B, ↓a, c
-}
-
-
enum foo {
-    ↓case b, c
-    ↓case a
-}
-
-
enum foo {
-    case a
-    case b, ↓d, ↓c
-}
-
-
enum foo {
-    case a(foo: Foo)
-    case ↓c, ↓b(String)
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_first_last.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_first_last.html deleted file mode 100644 index 204e989b8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_first_last.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - sorted_first_last Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Min or Max over Sorted First or Last

- -

Prefer using min() or max() over sorted().first or sorted().last

- -
    -
  • Identifier: sorted_first_last
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let min = myList.min()
-
-
let min = myList.min(by: { $0 < $1 })
-
-
let min = myList.min(by: >)
-
-
let max = myList.max()
-
-
let max = myList.max(by: { $0 < $1 })
-
-
let message = messages.sorted(byKeyPath: #keyPath(Message.timestamp)).last
-
-
let message = messages.sorted(byKeyPath: "timestamp", ascending: false).first
-
-
myList.sorted().firstIndex(of: key)
-
-
myList.sorted().lastIndex(of: key)
-
-
myList.sorted().firstIndex(where: someFunction)
-
-
myList.sorted().lastIndex(where: someFunction)
-
-
myList.sorted().firstIndex { $0 == key }
-
-
myList.sorted().lastIndex { $0 == key }
-
-
myList.sorted().first(where: someFunction)
-
-
myList.sorted().last(where: someFunction)
-
-
myList.sorted().first { $0 == key }
-
-
myList.sorted().last { $0 == key }
-
-

Triggering Examples

-
↓myList.sorted().first
-
-
↓myList.sorted(by: { $0.description < $1.description }).first
-
-
↓myList.sorted(by: >).first
-
-
↓myList.map { $0 + 1 }.sorted().first
-
-
↓myList.sorted(by: someFunction).first
-
-
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.first
-
-
↓myList.sorted().last
-
-
↓myList.sorted().last?.something()
-
-
↓myList.sorted(by: { $0.description < $1.description }).last
-
-
↓myList.map { $0 + 1 }.sorted().last
-
-
↓myList.sorted(by: someFunction).last
-
-
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.last
-
-
↓myList.map { $0 + 1 }.sorted { $0.first < $1.first }.last
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_imports.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_imports.html deleted file mode 100644 index a4f50500d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/sorted_imports.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - sorted_imports Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Sorted Imports

- -

Imports should be sorted

- -
    -
  • Identifier: sorted_imports
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -grouping - -names -
  • -
-

Non Triggering Examples

-
import AAA
-import BBB
-import CCC
-import DDD
-
-
import Alamofire
-import API
-
-
import labc
-import Ldef
-
-
import BBB
-// comment
-import AAA
-import CCC
-
-
@testable import AAA
-import   CCC
-
-
import AAA
-@testable import   CCC
-
-
import EEE.A
-import FFF.B
-#if os(Linux)
-import DDD.A
-import EEE.B
-#else
-import CCC
-import DDD.B
-#endif
-import AAA
-import BBB
-
-

Triggering Examples

-
import AAA
-import ZZZ
-import ↓BBB
-import CCC
-
-
import DDD
-// comment
-import CCC
-import ↓AAA
-
-
@testable import CCC
-import   ↓AAA
-
-
import CCC
-@testable import   ↓AAA
-
-
import FFF.B
-import ↓EEE.A
-#if os(Linux)
-import DDD.A
-import EEE.B
-#else
-import DDD.B
-import ↓CCC
-#endif
-import AAA
-import BBB
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/statement_position.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/statement_position.html deleted file mode 100644 index 64cffef48..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/statement_position.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - statement_position Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Statement Position

- -

Else and catch should be on the same line, one space after the previous declaration

- -
    -
  • Identifier: statement_position
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -statement_mode - -default -
  • -
-

Non Triggering Examples

-
} else if {
-
-
} else {
-
-
} catch {
-
-
"}else{"
-
-
struct A { let catchphrase: Int }
-let a = A(
- catchphrase: 0
-)
-
-
struct A { let `catch`: Int }
-let a = A(
- `catch`: 0
-)
-
-

Triggering Examples

-
↓}else if {
-
-
↓}  else {
-
-
↓}
-catch {
-
-
↓}
-      catch {
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_operator.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_operator.html deleted file mode 100644 index ce0e9cd96..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_operator.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - static_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Static Operator

- -

Operators should be declared as static functions, not free functions

- -
    -
  • Identifier: static_operator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class A: Equatable {
-  static func == (lhs: A, rhs: A) -> Bool {
-    return false
-  }
-
-
class A<T>: Equatable {
-    static func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
-        return false
-    }
-
-
public extension Array where Element == Rule {
-  static func == (lhs: Array, rhs: Array) -> Bool {
-    if lhs.count != rhs.count { return false }
-    return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
-  }
-}
-
-
private extension Optional where Wrapped: Comparable {
-  static func < (lhs: Optional, rhs: Optional) -> Bool {
-    switch (lhs, rhs) {
-    case let (lhs?, rhs?):
-      return lhs < rhs
-    case (nil, _?):
-      return true
-    default:
-      return false
-    }
-  }
-}
-
-

Triggering Examples

-
↓func == (lhs: A, rhs: A) -> Bool {
-  return false
-}
-
-
↓func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
-  return false
-}
-
-
↓func == (lhs: [Rule], rhs: [Rule]) -> Bool {
-  if lhs.count != rhs.count { return false }
-  return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
-}
-
-
private ↓func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool {
-  switch (lhs, rhs) {
-  case let (lhs?, rhs?):
-    return lhs < rhs
-  case (nil, _?):
-    return true
-  default:
-    return false
-  }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_over_final_class.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_over_final_class.html deleted file mode 100644 index e8693065b..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/static_over_final_class.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - static_over_final_class Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Static Over Final Class

- -

Prefer static over final class for non-overridable declarations

- -
    -
  • Identifier: static_over_final_class
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    static func f() {}
-}
-
-
class C {
-    static var i: Int { 0 }
-}
-
-
class C {
-    static subscript(_: Int) -> Int { 0 }
-}
-
-
class C {
-    class func f() {}
-}
-
-
final class C {}
-
-
final class C {
-    class D {
-      class func f() {}
-    }
-}
-
-

Triggering Examples

-
class C {
-    ↓final class func f() {}
-}
-
-
class C {
-    ↓final class var i: Int { 0 }
-}
-
-
class C {
-    ↓final class subscript(_: Int) -> Int { 0 }
-}
-
-
final class C {
-    ↓class func f() {}
-}
-
-
class C {
-    final class D {
-        ↓class func f() {}
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strict_fileprivate.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strict_fileprivate.html deleted file mode 100644 index 8eb622bcc..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strict_fileprivate.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - strict_fileprivate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Strict Fileprivate

- -

fileprivate should be avoided

- -
    -
  • Identifier: strict_fileprivate
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension String {}
-
-
private extension String {}
-
-
public
-    extension String {
-        var i: Int { 1 }
-    }
-
-
    private enum E {
-        func f() {}
-    }
-
-
    public struct S {
-        internal let i: Int
-    }
-
-
    open class C {
-        private func f() {}
-    }
-
-
    internal actor A {}
-
-

Triggering Examples

-
    ↓fileprivate class C {
-        ↓fileprivate func f() {}
-    }
-
-
    ↓fileprivate extension String {
-        ↓fileprivate var isSomething: Bool { self == "something" }
-    }
-
-
    ↓fileprivate actor A {
-        ↓fileprivate let i = 1
-    }
-
-
    ↓fileprivate struct C {
-        ↓fileprivate(set) var myInt = 4
-    }
-
-
    struct Outter {
-        struct Inter {
-            ↓fileprivate struct Inner {}
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strong_iboutlet.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strong_iboutlet.html deleted file mode 100644 index 30f21eb89..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/strong_iboutlet.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - strong_iboutlet Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Strong IBOutlet

- -

@IBOutlets shouldn’t be declared as weak

- -
    -
  • Identifier: strong_iboutlet
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet var label: UILabel?
-}
-
-
class ViewController: UIViewController {
-    weak var label: UILabel?
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet ↓weak var label: UILabel?
-}
-
-
class ViewController: UIViewController {
-    @IBOutlet ↓unowned var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @IBOutlet ↓weak var textField: UITextField?
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_disable_command.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_disable_command.html deleted file mode 100644 index 97e98fb0d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_disable_command.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - superfluous_disable_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Superfluous Disable Command

- -

SwiftLint ‘disable’ commands are superfluous when the disabled rule would not have triggered a violation in the disabled region. Use “ - ” if you wish to document a command.

- -
    -
  • Identifier: superfluous_disable_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc:Void // swiftlint:disable:this colon
-
-
// swiftlint:disable colon
-let abc:Void
-// swiftlint:enable colon
-
-

Triggering Examples

-
let abc: Void // swiftlint:disable:this colon
-
-
// swiftlint:disable colon
-let abc: Void
-// swiftlint:enable colon
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_else.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_else.html deleted file mode 100644 index 23c57f289..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/superfluous_else.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - superfluous_else Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Superfluous Else

- -

Else branches should be avoided when the previous if-block exits the current scope

- -
    -
  • Identifier: superfluous_else
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    if i > 0 {
-        // comment
-    } else if i < 12 {
-        return 2
-    } else {
-        return 3
-    }
-
-
    if i > 0 {
-        let a = 1
-        if a > 1 {
-            // comment
-        } else {
-            return 1
-        }
-        // comment
-    } else {
-        return 3
-    }
-
-
    if i > 0 {
-        if a > 1 {
-            return 1
-        }
-    } else {
-        return 3
-    }
-
-
    for i in list {
-        if i > 12 {
-            // Do nothing
-        } else {
-            continue
-        }
-        if i > 14 {
-            // Do nothing
-        } else if i > 13 {
-            break
-        }
-    }
-
-

Triggering Examples

-
    if i > 0 {
-        return 1
-        // comment
-    } ↓else {
-        return 2
-    }
-
-
    if i > 0 {
-        return 1
-    } ↓else if i < 12 {
-        return 2
-    } ↓else if i > 18 {
-        return 3
-    }
-
-
    if i > 0 {
-        if i < 12 {
-            return 5
-        } ↓else {
-            if i > 11 {
-                return 6
-            } ↓else {
-                return 7
-            }
-        }
-    } ↓else if i < 12 {
-        return 2
-    } ↓else if i < 24 {
-        return 8
-    } ↓else {
-        return 3
-    }
-
-
    for i in list {
-        if i > 13 {
-            return
-        } ↓else if i > 12 {
-            continue
-        } ↓else if i > 11 {
-            break
-        } ↓else {
-            throw error
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/swift-syntax-dashboard.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/swift-syntax-dashboard.html deleted file mode 100644 index 1a3f4ae18..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/swift-syntax-dashboard.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - Swift Syntax Dashboard Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Swift Syntax Dashboard

- -

Efforts are actively under way to migrate most rules off SourceKit to use SwiftSyntax instead.

- -

Rules written using SwiftSyntax tend to be significantly faster and have fewer false positives -than rules that use SourceKit to get source structure information.

- -

24 out of 233 (10%) -of SwiftLint’s linter rules use SourceKit.

-

Rules Using SourceKit

-

Default Rules (6)

- - -

Opt-in Rules (18)

- - -

Rules not Using SourceKit

-

Default Rules (90)

- - -

Opt-in Rules (119)

- - - -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_alignment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_alignment.html deleted file mode 100644 index 0351fbbf4..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_alignment.html +++ /dev/null @@ -1,521 +0,0 @@ - - - - switch_case_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Switch and Case Statement Alignment

- -

Case statements should vertically align with their closing brace, or indented if configured otherwise.

- -
    -
  • Identifier: switch_case_alignment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -indented_cases - -false -
    -ignore_one_liners - -false -
  • -
-

Non Triggering Examples

-
switch someBool {
-case true: // case 1
-    print('red')
-case false:
-    /*
-    case 2
-    */
-    if case let .someEnum(val) = someFunc() {
-        print('blue')
-    }
-}
-enum SomeEnum {
-    case innocent
-}
-
-
if aBool {
-    switch someBool {
-    case true:
-        print('red')
-    case false:
-        print('blue')
-    }
-}
-
-
switch someInt {
-// comments ignored
-case 0:
-    // zero case
-    print('Zero')
-case 1:
-    print('One')
-default:
-    print('Some other number')
-}
-
-
func f() -> Int {
-    return switch i {
-    case 1: 1
-    default: 2
-    }
-}
-
-
switch i { case .x: 1 default: 0 }
-
-
let a = switch i { case .x: 1 default: 0 }
-
-

Triggering Examples

-
switch someBool {
-    ↓case true:
-        print("red")
-    ↓case false:
-        print("blue")
-}
-
-
if aBool {
-    switch someBool {
-        ↓case true:
-            print('red')
-        ↓case false:
-            print('blue')
-    }
-}
-
-
switch someInt {
-    ↓case 0:
-        print('Zero')
-    ↓case 1:
-        print('One')
-    ↓default:
-        print('Some other number')
-}
-
-
let a = switch i {
-    ↓case 1: 1
-    ↓default: 2
-}
-
-
switch someBool {
-case true:
-    print('red')
-    ↓case false:
-        print('blue')
-}
-
-
if aBool {
-    switch someBool {
-        ↓case true:
-        print('red')
-    case false:
-    print('blue')
-    }
-}
-
-
let a = switch i {
-case 1: 1
-    ↓default: 2
-}
-
-
switch i { ↓case .x: 1 ↓default: 0 }
-
-
switch i {
-↓case .x: 1 ↓default: 0 }
-
-
switch i { ↓case .x: 1 ↓default: 0
-}
-
-
switch i
-{ ↓case .x: 1 ↓default: 0 }
-
-
let a = switch i {
-case .x: 1 ↓default: 0
-}
-
-
let a = switch i {
-↓case .x: 1 ↓default: 0 }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_on_newline.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_on_newline.html deleted file mode 100644 index 5b452b5ef..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/switch_case_on_newline.html +++ /dev/null @@ -1,502 +0,0 @@ - - - - switch_case_on_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Cases on Newline

- -

Cases inside a switch should always be on a newline

- -
    -
  • Identifier: switch_case_on_newline
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/*case 1: */return true
-
-
//case 1:
- return true
-
-
let x = [caseKey: value]
-
-
let x = [key: .default]
-
-
if case let .someEnum(value) = aFunction([key: 2]) { }
-
-
guard case let .someEnum(value) = aFunction([key: 2]) { }
-
-
for case let .someEnum(value) = aFunction([key: 2]) { }
-
-
enum Environment {
- case development
-}
-
-
enum Environment {
- case development(url: URL)
-}
-
-
enum Environment {
- case development(url: URL) // staging
-}
-
-
switch foo {
-    case 1:
- return true
-}
-
-
switch foo {
-    default:
- return true
-}
-
-
switch foo {
-    case let value:
- return true
-}
-
-
switch foo {
-    case .myCase: // error from network
- return true
-}
-
-
switch foo {
-    case let .myCase(value) where value > 10:
- return false
-}
-
-
switch foo {
-    case let .myCase(value)
- where value > 10:
- return false
-}
-
-
switch foo {
-    case let .myCase(code: lhsErrorCode, description: _)
- where lhsErrorCode > 10:
-return false
-}
-
-
switch foo {
-    case #selector(aFunction(_:)):
- return false
-}
-
-
do {
-  let loadedToken = try tokenManager.decodeToken(from: response)
-  return loadedToken
-} catch { throw error }
-
-

Triggering Examples

-
switch foo {
-    ↓case 1: return true
-}
-
-
switch foo {
-    ↓case let value: return true
-}
-
-
switch foo {
-    ↓default: return true
-}
-
-
switch foo {
-    ↓case "a string": return false
-}
-
-
switch foo {
-    ↓case .myCase: return false // error from network
-}
-
-
switch foo {
-    ↓case let .myCase(value) where value > 10: return false
-}
-
-
switch foo {
-    ↓case #selector(aFunction(_:)): return false
-}
-
-
switch foo {
-    ↓case let .myCase(value)
- where value > 10: return false
-}
-
-
switch foo {
-    ↓case .first,
- .second: return false
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/syntactic_sugar.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/syntactic_sugar.html deleted file mode 100644 index e447ccaf8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/syntactic_sugar.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - syntactic_sugar Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Syntactic Sugar

- -

Shorthand syntactic sugar should be used, i.e. [Int] instead of Array.

- -
    -
  • Identifier: syntactic_sugar
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let x: [Int]
-
-
let x: [Int: String]
-
-
let x: Int?
-
-
func x(a: [Int], b: Int) -> [Int: Any]
-
-
let x: Int!
-
-
extension Array {
-  func x() { }
-}
-
-
extension Dictionary {
-  func x() { }
-}
-
-
let x: CustomArray<String>
-
-
var currentIndex: Array<OnboardingPage>.Index?
-
-
func x(a: [Int], b: Int) -> Array<Int>.Index
-
-
unsafeBitCast(nonOptionalT, to: Optional<T>.self)
-
-
unsafeBitCast(someType, to: Swift.Array<T>.self)
-
-
IndexingIterator<Array<Dictionary<String, AnyObject>>>.self
-
-
let y = Optional<String>.Type
-
-
type is Optional<String>.Type
-
-
let x: Foo.Optional<String>
-
-
let x = case Optional<Any>.none = obj
-
-
let a = Swift.Optional<String?>.none
-
-

Triggering Examples

-
let x: ↓Array<String>
-
-
let x: ↓Dictionary<Int, String>
-
-
let x: ↓Optional<Int>
-
-
let x: ↓Swift.Array<String>
-
-
func x(a: ↓Array<Int>, b: Int) -> [Int: Any]
-
-
func x(a: ↓Swift.Array<Int>, b: Int) -> [Int: Any]
-
-
func x(a: [Int], b: Int) -> ↓Dictionary<Int, String>
-
-
let x = y as? ↓Array<[String: Any]>
-
-
let x = Box<Array<T>>()
-
-
func x() -> Box<↓Array<T>>
-
-
func x() -> ↓Dictionary<String, Any>?
-
-
typealias Document = ↓Dictionary<String, T?>
-
-
func x(_ y: inout ↓Array<T>)
-
-
let x:↓Dictionary<String, ↓Dictionary<Int, Int>>
-
-
func x() -> Any { return ↓Dictionary<Int, String>()}
-
-
let x = ↓Array<String>.array(of: object)
-
-
let x = ↓Swift.Array<String>.array(of: object)
-
-
@_specialize(where S == ↓Array<Character>)
-public init<S: Sequence>(_ elements: S)
-
-
let dict: [String: Any] = [:]
-_ = dict["key"] as? ↓Optional<String?> ?? Optional<String?>.none
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/test_case_accessibility.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/test_case_accessibility.html deleted file mode 100644 index 160ba6e97..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/test_case_accessibility.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - test_case_accessibility Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Test Case Accessibility

- -

Test cases should only contain private non-test members

- -
    -
  • Identifier: test_case_accessibility
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allowed_prefixes - -[] -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
let foo: String?
-
-
let foo: String?
-
-class FooTests: XCTestCase {
-    static let allTests: [String] = []
-
-    private let foo: String {
-        let nestedMember = "hi"
-        return nestedMember
-    }
-
-    override static func setUp() {}
-
-    override func setUp() {}
-
-    override func setUpWithError() throws {}
-
-    override static func tearDown() {}
-
-    override func tearDown() {}
-
-    override func tearDownWithError() {}
-
-    override func someFutureXCTestFunction() {
-        super.someFutureXCTestFunction()
-    }
-
-    func testFoo() {
-        XCTAssertTrue(true)
-    }
-
-    func testBar() {
-        func nestedFunc() {}
-    }
-
-    private someFunc(hasParam: Bool) {}
-}
-
-
class FooTests: XCTestCase {
-    private struct MockSomething: Something {}
-}
-
-
class FooTests: XCTestCase {
-    override init() {
-        super.init()
-        let foo = 1
-        var bar = 2
-    }
-}
-
-
class FooTests: XCTestCase {
-    func allowedPrefixTestFoo() {}
-}
-
-
class Foobar {
-    func setUp() {}
-
-    func tearDown() {}
-
-    func testFoo() {}
-}
-
-

Triggering Examples

-
class FooTests: XCTestCase {
-    ↓typealias Bar = Foo.Bar
-
-    ↓var foo: String?
-    ↓let bar: String?
-
-    ↓static func foo() {}
-
-    ↓func setUp(withParam: String) {}
-
-    ↓func foobar() {}
-
-    ↓func not_testBar() {}
-
-    ↓enum Nested {}
-
-    ↓static func testFoo() {}
-
-    ↓static func allTests() {}
-
-    ↓func testFoo(hasParam: Bool) {}
-}
-
-final class BarTests: XCTestCase {
-    ↓class Nested {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/todo.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/todo.html deleted file mode 100644 index 5237277e9..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/todo.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - todo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Todo

- -

TODOs and FIXMEs should be resolved.

- -
    -
  • Identifier: todo
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only - -[TODO, FIXME] -
  • -
-

Non Triggering Examples

-
// notaTODO:
-
-
// notaFIXME:
-
-

Triggering Examples

-
// ↓TODO:
-
-
// ↓FIXME:
-
-
// ↓TODO(note)
-
-
// ↓FIXME(note)
-
-
/* ↓FIXME: */
-
-
/* ↓TODO: */
-
-
/** ↓FIXME: */
-
-
/** ↓TODO: */
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/toggle_bool.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/toggle_bool.html deleted file mode 100644 index b08812fb2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/toggle_bool.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - toggle_bool Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Toggle Bool

- -

Prefer someBool.toggle() over someBool = !someBool

- -
    -
  • Identifier: toggle_bool
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
isHidden.toggle()
-
-
view.clipsToBounds.toggle()
-
-
func foo() { abc.toggle() }
-
-
view.clipsToBounds = !clipsToBounds
-
-
disconnected = !connected
-
-
result = !result.toggle()
-
-

Triggering Examples

-
↓isHidden = !isHidden
-
-
↓view.clipsToBounds = !view.clipsToBounds
-
-
func foo() { ↓abc = !abc }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_closure.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_closure.html deleted file mode 100644 index 30ca698bf..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_closure.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Closure

- -

Trailing closure syntax should be used whenever possible

- -
    -
  • Identifier: trailing_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_single_muted_parameter - -false -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.bar()
-
-
foo.reduce(0) { $0 + 1 }
-
-
if let foo = bar.map({ $0 + 1 }) { }
-
-
foo.something(param1: { $0 }, param2: { $0 + 1 })
-
-
offsets.sorted { $0.offset < $1.offset }
-
-
foo.something({ return 1 }())
-
-
foo.something({ return $0 }(1))
-
-
foo.something(0, { return 1 }())
-
-
for x in list.filter({ $0.isValid }) {}
-
-
if list.allSatisfy({ $0.isValid }) {}
-
-
foo(param1: 1, param2: { _ in true }, param3: 0)
-
-
foo(param1: 1, param2: { _ in true }) { $0 + 1 }
-
-
foo(param1: { _ in false }, param2: { _ in true })
-
-
foo(param1: { _ in false }, param2: { _ in true }, param3: { _ in false })
-
-
if f({ true }), g({ true }) {
-    print("Hello")
-}
-
-
for i in h({ [1,2,3] }) {
-    print(i)
-}
-
-

Triggering Examples

-
foo.map(↓{ $0 + 1 })
-
-
foo.reduce(0, combine: ↓{ $0 + 1 })
-
-
offsets.sorted(by: ↓{ $0.offset < $1.offset })
-
-
foo.something(0, ↓{ $0 + 1 })
-
-
foo.something(param1: { _ in true }, param2: 0, param3: ↓{ _ in false })
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_comma.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_comma.html deleted file mode 100644 index 2d1607c91..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_comma.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - trailing_comma Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Comma

- -

Trailing commas in arrays and dictionaries should be avoided/enforced.

- -
    -
  • Identifier: trailing_comma
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -mandatory_comma - -false -
  • -
-

Non Triggering Examples

-
let foo = [1, 2, 3]
-
-
let foo = []
-
-
let foo = [:]
-
-
let foo = [1: 2, 2: 3]
-
-
let foo = [Void]()
-
-
let example = [ 1,
- 2
- // 3,
-]
-
-
foo([1: "\(error)"])
-
-
let foo = [Int]()
-
-

Triggering Examples

-
let foo = [1, 2, 3↓,]
-
-
let foo = [1, 2, 3↓, ]
-
-
let foo = [1, 2, 3   ↓,]
-
-
let foo = [1: 2, 2: 3↓, ]
-
-
struct Bar {
- let foo = [1: 2, 2: 3↓, ]
-}
-
-
let foo = [1, 2, 3↓,] + [4, 5, 6↓,]
-
-
let example = [ 1,
-2↓,
- // 3,
-]
-
-
let foo = ["אבג", "αβγ", "🇺🇸"↓,]
-
-
class C {
- #if true
- func f() {
- let foo = [1, 2, 3↓,]
- }
- #endif
-}
-
-
foo([1: "\(error)"↓,])
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_newline.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_newline.html deleted file mode 100644 index 8c568ac5f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_newline.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - trailing_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Newline

- -

Files should have a single trailing newline

- -
    -
  • Identifier: trailing_newline
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let a = 0
-
-
-

Triggering Examples

-
let a = 0
-
-
let a = 0
-
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_semicolon.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_semicolon.html deleted file mode 100644 index b97852c88..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_semicolon.html +++ /dev/null @@ -1,403 +0,0 @@ - - - - trailing_semicolon Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Semicolon

- -

Lines should not have trailing semicolons

- -
    -
  • Identifier: trailing_semicolon
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let a = 0
-
-
let a = 0; let b = 0
-
-

Triggering Examples

-
let a = 0↓;
-
-
-
let a = 0↓;
-let b = 1
-
-
let a = 0↓; // a comment
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_whitespace.html deleted file mode 100644 index cdf6f8d57..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/trailing_whitespace.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - trailing_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Whitespace

- -

Lines should not have trailing whitespace

- -
    -
  • Identifier: trailing_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignores_empty_lines - -false -
    -ignores_comments - -true -
  • -
-

Non Triggering Examples

-
let name: String
-
-
-
//
-
-
-
// 
-
-
-
let name: String //
-
-
-
let name: String // 
-
-
-

Triggering Examples

-
let name: String 
-
-
-
/* */ let name: String 
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_body_length.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_body_length.html deleted file mode 100644 index e79a77f3e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_body_length.html +++ /dev/null @@ -1,5494 +0,0 @@ - - - - type_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Body Length

- -

Type bodies should not span too many lines

- -
    -
  • Identifier: type_body_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -250 -
    -error - -350 -
  • -
-

Non Triggering Examples

-
class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
class Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
class Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
struct Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
struct Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
enum Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
enum Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
actor Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
actor Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-

Triggering Examples

-
↓class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_contents_order.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_contents_order.html deleted file mode 100644 index f67320658..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_contents_order.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - type_contents_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Contents Order

- -

Specifies the order of subtypes, properties, methods & more within a type.

- -
    -
  • Identifier: type_contents_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -[[case], [type_alias, associated_type], [subtype], [type_property], [instance_property], [ib_inspectable], [ib_outlet], [initializer], [type_method], [view_life_cycle_method], [ib_action], [other_method], [subscript], [deinitializer]] -
  • -
-

Non Triggering Examples

-
class TestViewController: UIViewController {
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-
-    struct TestStruct {
-        // 3 lines
-    }
-
-    enum TestEnum {
-        // 5 lines
-    }
-
-    // Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-
-    // Instance Properties
-    var shouldLayoutView1: Bool!
-    weak var delegate: TestViewControllerDelegate?
-    private var hasLayoutedView1: Bool = false
-    private var hasLayoutedView2: Bool = false
-
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-
-    // Initializers
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-
-    // View Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-
-    override func willMove(toParent parent: UIViewController?) {
-        super.willMove(toParent: parent)
-        if parent == nil {
-            viewModel.willMoveToParent()
-        }
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-
-        view2.setNeedsLayout()
-        view2.layoutIfNeeded()
-        hasLayoutedView2 = true
-    }
-
-    override func viewIsAppearing(_ animated: Bool) {
-        super.viewIsAppearing(animated)
-    }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    // Other Methods
-    func goToNextVc() { /* TODO */ }
-
-    func goToInfoVc() { /* TODO */ }
-
-    func goToRandomVc() {
-        let viewCtrl = getRandomVc()
-        present(viewCtrl, animated: true)
-    }
-
-    private func getRandomVc() -> UIViewController { return UIViewController() }
-
-    // Subscripts
-    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-
-    deinit {
-        log.debug("deinit")
-    },
-}
-
-

Triggering Examples

-
class TestViewController: UIViewController {
-    // Subtypes
-    ↓class TestClass {
-        // 10 lines
-    }
-
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-}
-
-
class TestViewController: UIViewController {
-    // Stored Type Properties
-    ↓static let cellIdentifier: String = "AmazingCell"
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Stored Instance Properties
-    ↓var shouldLayoutView1: Bool!
-
-    // Stored Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-}
-
-
class TestViewController: UIViewController {
-    // IBOutlets
-    @IBOutlet private ↓var view1: UIView!
-
-    // Computed Instance Properties
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-}
-
-
class TestViewController: UIViewController {
-
-    // deinitializer
-    ↓deinit {
-        log.debug("deinit")
-    }
-
-    // Initializers
-    override ↓init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-}
-
-
class TestViewController: UIViewController {
-    // View Life-Cycle Methods
-    override ↓func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-}
-
-
class TestViewController: UIViewController {
-    // IBActions
-    @IBAction ↓func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    // View Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Other Methods
-    ↓func goToNextVc() { /* TODO */ }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Subscripts
-    ↓subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-
-    // MARK: Other Methods
-    func goToNextVc() { /* TODO */ }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_name.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_name.html deleted file mode 100644 index cf1d701b8..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/type_name.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - type_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Name

- -

Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length. -Private types may start with an underscore.

- -
    -
  • Identifier: type_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -3 -
    -error - -0 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -40 -
    -error - -1000 -
    -
    -excluded - -[] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
    -validate_protocols - -true -
  • -
-

Non Triggering Examples

-
class MyType {}
-
-
private struct _MyType {}
-
-
enum AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
-
-
typealias Foo = Void
-
-
private typealias Foo = Void
-
-
protocol Foo {
-  associatedtype Bar
-}
-
-
protocol Foo {
-  associatedtype Bar: Equatable
-}
-
-
enum MyType {
-case value
-}
-
-
protocol P {}
-
-
struct SomeStruct {
-  enum `Type` {
-    case x, y, z
-  }
-}
-
-

Triggering Examples

-
class ↓myType {}
-
-
enum ↓_MyType {}
-
-
private struct ↓MyType_ {}
-
-
struct ↓My {}
-
-
struct ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
-
-
class ↓MyView_Previews
-
-
private struct ↓_MyView_Previews
-
-
typealias ↓X = Void
-
-
private typealias ↓Foo_Bar = Void
-
-
private typealias ↓foo = Void
-
-
typealias ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = Void
-
-
protocol Foo {
-  associatedtype ↓X
-}
-
-
protocol Foo {
-  associatedtype ↓Foo_Bar: Equatable
-}
-
-
protocol Foo {
-  associatedtype ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-}
-
-
protocol ↓X {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/typesafe_array_init.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/typesafe_array_init.html deleted file mode 100644 index b8cf6d9ca..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/typesafe_array_init.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - typesafe_array_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type-safe Array Init

- -

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array

- -
    -
  • Identifier: typesafe_array_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    enum MyError: Error {}
-    let myResult: Result<String, MyError> = .success("")
-    let result: Result<Any, MyError> = myResult.map { $0 }
-
-
    struct IntArray {
-        let elements = [1, 2, 3]
-        func map<T>(_ transformer: (Int) throws -> T) rethrows -> [T] {
-            try elements.map(transformer)
-        }
-    }
-    let ints = IntArray()
-    let intsCopy = ints.map { $0 }
-
-

Triggering Examples

-
    func f<Seq: Sequence>(s: Seq) -> [Seq.Element] {
-        s.↓map({ $0 })
-    }
-
-
    func f(array: [Int]) -> [Int] {
-        array.↓map { $0 }
-    }
-
-
    let myInts = [1, 2, 3].↓map { return $0 }
-
-
    struct Generator: Sequence, IteratorProtocol {
-        func next() -> Int? { nil }
-    }
-    let array = Generator().↓map { i in i }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_condition.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_condition.html deleted file mode 100644 index d95a25723..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_condition.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - unavailable_condition Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unavailable Condition

- -

Use #unavailable/#available instead of #available/#unavailable with an empty body.

- -
    -
  • Identifier: unavailable_condition
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.6.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if #unavailable(iOS 13) {
-  loadMainWindow()
-}
-
-
if #available(iOS 9.0, *) {
-  doSomething()
-} else {
-  legacyDoSomething()
-}
-
-
if #available(macOS 11.0, *) {
-   // Do nothing
-} else if #available(macOS 10.15, *) {
-   print("do some stuff")
-}
-
-

Triggering Examples

-
if ↓#available(iOS 14.0) {
-
-} else {
-  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
-}
-
-
if ↓#available(iOS 14.0) {
-  // we don't need to do anything here
-} else {
-  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
-}
-
-
if ↓#available(iOS 13, *) {} else {
-  loadMainWindow()
-}
-
-
if ↓#unavailable(iOS 13) {
-  // Do nothing
-} else if i < 2 {
-  loadMainWindow()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_function.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_function.html deleted file mode 100644 index 211627cda..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unavailable_function.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - unavailable_function Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unavailable Function

- -

Unimplemented functions should be marked as unavailable

- -
    -
  • Identifier: unavailable_function
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-  @available(*, unavailable)
-  public required init?(coder aDecoder: NSCoder) {
-    preconditionFailure("init(coder:) has not been implemented")
-  }
-}
-
-
func jsonValue(_ jsonString: String) -> NSObject {
-   let data = jsonString.data(using: .utf8)!
-   let result = try! JSONSerialization.jsonObject(with: data, options: [])
-   if let dict = (result as? [String: Any])?.bridge() {
-    return dict
-   } else if let array = (result as? [Any])?.bridge() {
-    return array
-   }
-   fatalError()
-}
-
-
func resetOnboardingStateAndCrash() -> Never {
-    resetUserDefaults()
-    // Crash the app to re-start the onboarding flow.
-    fatalError("Onboarding re-start crash.")
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    fatalError("init(coder:) has not been implemented")
-  }
-}
-
-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    let reason = "init(coder:) has not been implemented"
-    fatalError(reason)
-  }
-}
-
-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    preconditionFailure("init(coder:) has not been implemented")
-  }
-}
-
-
↓func resetOnboardingStateAndCrash() {
-    resetUserDefaults()
-    // Crash the app to re-start the onboarding flow.
-    fatalError("Onboarding re-start crash.")
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unhandled_throwing_task.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unhandled_throwing_task.html deleted file mode 100644 index 3368765dd..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unhandled_throwing_task.html +++ /dev/null @@ -1,530 +0,0 @@ - - - - unhandled_throwing_task Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unhandled Throwing Task

- -

Errors thrown inside this task are not handled, which may be unexpected. Handle errors inside the task, or use try await to access the Tasks value and handle errors. See this forum thread for more details: https://forums.swift.org/t/task-initializer-with-throwing-closure-swallows-error/56066

- -
    -
  • Identifier: unhandled_throwing_task
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
Task<Void, Never> {
-  try await myThrowingFunction()
-}
-
-
Task {
-  try? await myThrowingFunction()
-}
-
-
Task {
-  try! await myThrowingFunction()
-}
-
-
Task<Void, String> {
-  let text = try myThrowingFunction()
-  return text
-}
-
-
Task {
-  do {
-    try myThrowingFunction()
-  } catch let e {
-    print(e)
-  }
-}
-
-
func someFunction() throws {
-  Task {
-    anotherFunction()
-    do {
-      try myThrowingFunction()
-    } catch {
-      print(error)
-    }
-  }
-
-  try something()
-}
-
-
let task = Task {
-  try await myThrowingFunction()
-}
-
-
var task = Task {
-  try await myThrowingFunction()
-}
-
-
try await Task {
-  try await myThrowingFunction()
-}.value
-
-
executor.task = Task {
-  try await isolatedOpen(.init(executor.asUnownedSerialExecutor()))
-}
-
-
let result = await Task {
-  throw CancellationError()
-}.result
-
-
func makeTask() -> Task<String, Error> {
-  return Task {
-    try await someThrowingFunction()
-  }
-}
-
-
func makeTask() -> Task<String, Error> {
-  // Implicit return
-  Task {
-    try await someThrowingFunction()
-  }
-}
-
-
Task {
-  return Result {
-      try someThrowingFunc()
-  }
-}
-
-

Triggering Examples

-
↓Task {
-  try await myThrowingFunction()
-}
-
-
↓Task {
-  let text = try myThrowingFunction()
-  return text
-}
-
-
↓Task {
-  do {
-    try myThrowingFunction()
-  }
-}
-
-
↓Task {
-  do {
-    try myThrowingFunction()
-  } catch let e as FooError {
-    print(e)
-  }
-}
-
-
↓Task {
-  do {
-    throw FooError.bar
-  }
-}
-
-
↓Task {
-  throw FooError.bar
-}
-
-
↓Task<_, _> {
-  throw FooError.bar
-}
-
-
↓Task<Void,_> {
-  throw FooError.bar
-}
-
-
↓Task {
-  do {
-    try foo()
-  } catch {
-    try bar()
-  }
-}
-
-
↓Task {
-  do {
-    try foo()
-  } catch {
-    throw BarError()
-  }
-}
-
-
func doTask() {
-  ↓Task {
-    try await someThrowingFunction()
-  }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_break_in_switch.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_break_in_switch.html deleted file mode 100644 index 70ac25e97..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_break_in_switch.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - unneeded_break_in_switch Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Break in Switch

- -

Avoid using unneeded break statements

- -
    -
  • Identifier: unneeded_break_in_switch
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar:
-    break
-}
-
-
switch foo {
-default:
-    break
-}
-
-
switch foo {
-case .bar:
-    for i in [0, 1, 2] { break }
-}
-
-
switch foo {
-case .bar:
-    if true { break }
-}
-
-
switch foo {
-case .bar:
-    something()
-}
-
-
let items = [Int]()
-for item in items {
-    if bar() {
-        do {
-            try foo()
-        } catch {
-            bar()
-            break
-        }
-    }
-}
-
-

Triggering Examples

-
switch foo {
-case .bar:
-    something()
-    ↓break
-}
-
-
switch foo {
-case .bar:
-    something()
-    ↓break // comment
-}
-
-
switch foo {
-default:
-    something()
-    ↓break
-}
-
-
switch foo {
-case .foo, .foo2 where condition:
-    something()
-    ↓break
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_override.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_override.html deleted file mode 100644 index eb18caf49..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_override.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - unneeded_override Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Overridden Functions

- -

Remove overridden functions that don’t do anything except call their super

- -
    -
  • Identifier: unneeded_override
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -affect_initializers - -false -
  • -
-

Non Triggering Examples

-
class Foo {
-    override func bar() {
-        super.bar()
-        print("hi")
-    }
-}
-
-
class Foo {
-    @available(*, unavailable)
-    override func bar() {
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() {
-        super.bar()
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() throws {
-        // Doing a different variation of 'try' changes behavior
-        try! super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() throws {
-        // Doing a different variation of 'try' changes behavior
-        try? super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() async throws {
-        // Doing a different variation of 'try' changes behavior
-        await try! super.bar()
-    }
-}
-
-
class Foo {
-    override func bar(arg: Bool) {
-        // Flipping the argument changes behavior
-        super.bar(arg: !arg)
-    }
-}
-
-
class Foo {
-    override func bar(_ arg: Int) {
-        // Changing the argument changes behavior
-        super.bar(arg + 1)
-    }
-}
-
-
class Foo {
-    override func bar(arg: Int) {
-        // Changing the argument changes behavior
-        super.bar(arg: arg.var)
-    }
-}
-
-
class Foo {
-    override func bar(_ arg: Int) {
-        // Not passing arguments because they have default values changes behavior
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar(arg: Int, _ arg3: Bool) {
-        // Calling a super function with different argument labels changes behavior
-        super.bar(arg2: arg, arg3: arg3)
-    }
-}
-
-
class Foo {
-    override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated) {
-            // This likely changes behavior
-        }
-    }
-}
-
-
class Foo {
-    override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated, completion: {
-            // This likely changes behavior
-        })
-    }
-}
-
-
class Baz: Foo {
-    // A default argument might be a change
-    override func bar(value: String = "Hello") {
-        super.bar(value: value)
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    ↓override func bar() {
-        super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() {
-        return super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() {
-        super.bar()
-        // comments don't affect this
-    }
-}
-
-
class Foo {
-    ↓override func bar() async {
-        await super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() throws {
-        try super.bar()
-        // comments don't affect this
-    }
-}
-
-
class Foo {
-    ↓override func bar(arg: Bool) throws {
-        try super.bar(arg: arg)
-    }
-}
-
-
class Foo {
-    ↓override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated, completion: completion)
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html deleted file mode 100644 index ee66ed862..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - unneeded_parentheses_in_closure_argument Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Parentheses in Closure Argument

- -

Parentheses are not needed when declaring closure arguments

- -
    -
  • Identifier: unneeded_parentheses_in_closure_argument
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = { (bar: Int) in }
-
-
let foo = { bar, _  in }
-
-
let foo = { bar in }
-
-
let foo = { bar -> Bool in return true }
-
-
DispatchQueue.main.async { () -> Void in
-    doSomething()
-}
-
-

Triggering Examples

-
call(arg: { ↓(bar) in })
-
-
call(arg: { ↓(bar, _) in })
-
-
let foo = { ↓(bar) -> Bool in return true }
-
-
foo.map { ($0, $0) }.forEach { ↓(x, y) in }
-
-
foo.bar { [weak self] ↓(x, y) in }
-
-
[].first { ↓(temp) in
-    [].first { ↓(temp) in
-        [].first { ↓(temp) in
-            _ = temp
-            return false
-        }
-        return false
-    }
-    return false
-}
-
-
[].first { temp in
-    [].first { ↓(temp) in
-        [].first { ↓(temp) in
-            _ = temp
-            return false
-        }
-        return false
-    }
-    return false
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_synthesized_initializer.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_synthesized_initializer.html deleted file mode 100644 index 5c476e031..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unneeded_synthesized_initializer.html +++ /dev/null @@ -1,683 +0,0 @@ - - - - unneeded_synthesized_initializer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Synthesized Initializer

- -

Default or memberwise initializers that will be automatically synthesized do not need to be manually defined.

- -
    -
  • Identifier: unneeded_synthesized_initializer
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not be private.
-    private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String
-
-    // Synthesized initializer would not be private.
-    private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not be fileprivate.
-    fileprivate init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not prepend "foo".
-    init(bar: String) {
-        self.bar = "foo" + bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Failable initializer
-    init?(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Initializer throws
-    init(bar: String) throws {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Different argument labels
-    init(_ bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    var bar: String = "foo"
-
-    // Different default values
-    init(bar: String = "bar") {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private static var bar: String
-
-    // var is static
-    init(bar: String) {
-        Self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private var bar: String
-
-    // var is private
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    fileprivate var bar: String
-
-    // var is fileprivate
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // init has no body
-    init(foo: String, bar: String) {
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // foo is not initialized
-    init(foo: String, bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // Ordering of args is different from properties.
-    init(bar: String, foo: String) {
-        self.foo = foo
-        self.bar = bar
-    }
-}
-
-
@frozen
-public struct Field {
-    @usableFromInline
-    let index: Int
-
-    @usableFromInline
-    let parent: Metadata
-
-    @inlinable // inlinable
-    init(index: Int, parent: Metadata) {
-       self.index = index
-       self.parent = parent
-    }
-}
-
-
internal struct Foo {
-    var bar: String = ""
-    var baz: Int = 0
-
-    // These initializers must be declared.
-    init() { }
-
-    init(bar: String = "", baz: Int = 0) {
-        self.bar = bar
-        self.baz = baz
-    }
-
-    // Because manually declared initializers block
-    // synthesization.
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    init() {
-        print("perform side effect")
-    }
-}
-
-
struct Foo {
-    var bar: Int = 0
-
-    init(bar: Int = 0) {
-        self.bar = bar
-        print("perform side effect")
-    }
-}
-
-

Triggering Examples

-
struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
private struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
fileprivate struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    fileprivate var bar: String
-
-   ↓fileprivate init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private var bar: String
-
-   ↓private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-   ↓init(foo: String, bar: String) {
-        self.foo = foo
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    var bar: String
-
-   ↓internal init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String = ""
-
-   ↓init() {
-        // Empty initializer will be generated automatically
-        // when all vars have default values.
-    }
-}
-
-
struct Foo {
-    var bar: String = ""
-
-   ↓init() {
-        // Empty initializer
-    }
-
-   ↓init(bar: String = "") {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar = ""
-
-   ↓init(bar: String = "") {
-        self.bar = bar
-    }
-}
-
-
struct Outer {
-    struct Inner {
-        let prop: Int
-
-       ↓init(prop: Int) {
-            self.prop = prop
-        }
-    }
-}
-
-
class Foo {
-    struct Bar {
-        let baz: Int
-
-       ↓init(baz: Int) {
-            self.baz = baz
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unowned_variable_capture.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unowned_variable_capture.html deleted file mode 100644 index f55ee8a3f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unowned_variable_capture.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - unowned_variable_capture Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unowned Variable Capture

- -

Prefer capturing references as weak to avoid potential crashes

- -
    -
  • Identifier: unowned_variable_capture
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo { [weak self] in _ }
-
-
foo { [weak self] param in _ }
-
-
foo { [weak bar] in _ }
-
-
foo { [weak bar] param in _ }
-
-
foo { bar in _ }
-
-
foo { $0 }
-
-
final class First {}
-final class Second {
-  unowned var value: First
-  init(value: First) {
-    self.value = value
-  }
-}
-
-

Triggering Examples

-
foo { [↓unowned self] in _ }
-
-
foo { [↓unowned bar] in _ }
-
-
foo { [bar, ↓unowned self] in _ }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/untyped_error_in_catch.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/untyped_error_in_catch.html deleted file mode 100644 index 122b21a45..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/untyped_error_in_catch.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - untyped_error_in_catch Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Untyped Error in Catch

- -

Catch statements should not declare error variables without type casting

- -
    -
  • Identifier: untyped_error_in_catch
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
do {
-  try foo()
-} catch {}
-
-
do {
-  try foo()
-} catch Error.invalidOperation {
-} catch {}
-
-
do {
-  try foo()
-} catch let error as MyError {
-} catch {}
-
-
do {
-  try foo()
-} catch var error as MyError {
-} catch {}
-
-
do {
-    try something()
-} catch let e where e.code == .fileError {
-    // can be ignored
-} catch {
-    print(error)
-}
-
-

Triggering Examples

-
do {
-  try foo()
-} ↓catch var error {}
-
-
do {
-  try foo()
-} ↓catch let error {}
-
-
do {
-  try foo()
-} ↓catch let someError {}
-
-
do {
-  try foo()
-} ↓catch var someError {}
-
-
do {
-  try foo()
-} ↓catch let e {}
-
-
do {
-  try foo()
-} ↓catch(let error) {}
-
-
do {
-  try foo()
-} ↓catch (let error) {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_capture_list.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_capture_list.html deleted file mode 100644 index 180c2f4b5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_capture_list.html +++ /dev/null @@ -1,495 +0,0 @@ - - - - unused_capture_list Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Capture List

- -

Unused reference in a capture list should be removed

- -
    -
  • Identifier: unused_capture_list
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map {
-    [ weak
-      delegate,
-      unowned
-      self
-    ] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map { [weak self] num in
-    self?.handle(num)
-}
-
-
let failure: Failure = { [weak self, unowned delegate = self.delegate!] foo in
-    delegate.handle(foo, self)
-}
-
-
numbers.forEach({
-    [weak handler] in
-    handler?.handle($0)
-})
-
-
withEnvironment(apiService: MockService(fetchProjectResponse: project)) {
-    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
-        device.handle()
-    }
-}
-
-
{ [foo] _ in foo.bar() }()
-
-
sizes.max().flatMap { [(offset: offset, size: $0)] } ?? []
-
-
[1, 2].map { [self] num in
-    handle(num)
-}
-
-
[1, 2].map { [unowned self] num in
-    handle(num)
-}
-
-
[1, 2].map { [self, unowned delegate = self.delegate!] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map { [unowned self, unowned delegate = self.delegate!] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map {
-    [ weak
-      delegate,
-      self
-    ] num in
-    delegate.handle(num)
-}
-
-
rx.onViewDidAppear.subscribe(onNext: { [unowned self] in
-      doSomething()
-}).disposed(by: disposeBag)
-
-
let closure = { [weak self] in
-    guard let self else {
-        return
-    }
-    someInstanceFunction()
-}
-
-

Triggering Examples

-
[1, 2].map { [↓weak self] num in
-    print(num)
-}
-
-
let failure: Failure = { [weak self, ↓unowned delegate = self.delegate!] foo in
-    self?.handle(foo)
-}
-
-
let failure: Failure = { [↓weak self, ↓unowned delegate = self.delegate!] foo in
-    print(foo)
-}
-
-
numbers.forEach({
-    [weak handler] in
-    print($0)
-})
-
-
numbers.forEach({
-    [self, ↓weak handler] in
-    print($0)
-})
-
-
withEnvironment(apiService: MockService(fetchProjectResponse: project)) { [↓foo] in
-    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
-        device.handle()
-    }
-}
-
-
{ [↓foo] in _ }()
-
-
let closure = { [↓weak a] in
-    // The new `a` immediately shadows the captured `a` which thus isn't needed.
-    guard let a = getOptionalValue() else {
-        return
-    }
-    someInstanceFunction()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_closure_parameter.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_closure_parameter.html deleted file mode 100644 index e310d51b7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_closure_parameter.html +++ /dev/null @@ -1,503 +0,0 @@ - - - - unused_closure_parameter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Closure Parameter

- -

Unused parameter in a closure should be replaced with _

- -
    -
  • Identifier: unused_closure_parameter
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
[1, 2].map { _ in
- 3 
-}
-
-
[1, 2].something { number, idx in
- return number * idx
-}
-
-
let isEmpty = [1, 2].isEmpty()
-
-
violations.sorted(by: { lhs, rhs in 
- return lhs.location > rhs.location
-})
-
-
rlmConfiguration.migrationBlock.map { rlmMigration in
-    return { migration, schemaVersion in
-        rlmMigration(migration.rlmMigration, schemaVersion)
-    }
-}
-
-
genericsFunc { (a: Type, b) in
-    a + b
-}
-
-
var label: UILabel = { (lbl: UILabel) -> UILabel in
-    lbl.backgroundColor = .red
-    return lbl
-}(UILabel())
-
-
hoge(arg: num) { num in
-    return num
-}
-
-
({ (manager: FileManager) in
-  print(manager)
-})(FileManager.default)
-
-
withPostSideEffect { input in
-    if true { print("\(input)") }
-}
-
-
viewModel?.profileImage.didSet(weak: self) { (self, profileImage) in
-    self.profileImageView.image = profileImage
-}
-
-
let failure: Failure = { task, error in
-    observer.sendFailed(error, task)
-}
-
-
List($names) { $name in
-    Text(name)
-}
-
-
List($names) { $name in
-    TextField($name)
-}
-
-
_ = ["a"].filter { `class` in `class`.hasPrefix("a") }
-
-
let closure: (Int) -> Void = { `foo` in _ = foo }
-
-
let closure: (Int) -> Void = { foo in _ = `foo` }
-
-

Triggering Examples

-
[1, 2].map { ↓number in
- return 3 }
-
-
[1, 2].map { ↓number in
- return numberWithSuffix }
-
-
[1, 2].map { ↓number in
- return 3 // number }
-
-
[1, 2].map { ↓number in
- return 3 "number" }
-
-
[1, 2].something { number, ↓idx in
- return number }
-
-
genericsFunc { (↓number: TypeA, idx: TypeB) in return idx }
-
-
let c: (Int) -> Void = { foo in _ = .foo }
-
-
hoge(arg: num) { ↓num in
-}
-
-
fooFunc { ↓아 in }
-
-
func foo () {
- bar { ↓number in return 3 }
-
-
viewModel?.profileImage.didSet(weak: self) { (↓self, profileImage) in
-    profileImageView.image = profileImage
-}
-
-
let failure: Failure = { ↓task, error in
-    observer.sendFailed(error)
-}
-
-
List($names) { ↓$name in
-    Text("Foo")
-}
-
-
let class1 = "a"
-_ = ["a"].filter { ↓`class` in `class1`.hasPrefix("a") }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_control_flow_label.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_control_flow_label.html deleted file mode 100644 index 067d16a60..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_control_flow_label.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - unused_control_flow_label Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Control Flow Label

- -

Unused control flow label should be removed

- -
    -
  • Identifier: unused_control_flow_label
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
loop: while true { break loop }
-
-
loop: while true { continue loop }
-
-
loop:
-    while true { break loop }
-
-
while true { break }
-
-
loop: for x in array { break loop }
-
-
label: switch number {
-case 1: print("1")
-case 2: print("2")
-default: break label
-}
-
-
loop: repeat {
-    if x == 10 {
-        break loop
-    }
-} while true
-
-

Triggering Examples

-
↓loop: while true { break }
-
-
↓loop: while true { break loop1 }
-
-
↓loop: while true { break outerLoop }
-
-
↓loop: for x in array { break }
-
-
↓label: switch number {
-case 1: print("1")
-case 2: print("2")
-default: break
-}
-
-
↓loop: repeat {
-    if x == 10 {
-        break
-    }
-} while true
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_declaration.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_declaration.html deleted file mode 100644 index a8e82ad3f..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_declaration.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - unused_declaration Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Declaration

- -

Declarations should be referenced at least once within all files linted

- -
    -
  • Identifier: unused_declaration
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -error -
    -include_public_and_open - -false -
    -related_usrs_to_skip - -[“s:7SwiftUI15PreviewProviderP”] -
  • -
-

Non Triggering Examples

-
let kConstant = 0
-_ = kConstant
-
-
enum Change<T> {
-  case insert(T)
-  case delete(T)
-}
-
-extension Sequence {
-  func deletes<T>() -> [T] where Element == Change<T> {
-    return compactMap { operation in
-      if case .delete(let value) = operation {
-        return value
-      } else {
-        return nil
-      }
-    }
-  }
-}
-
-let changes = [Change.insert(0), .delete(0)]
-_ = changes.deletes()
-
-
struct Item: Codable {}
-struct ResponseModel: Codable {
-    let items: [Item]
-
-    enum CodingKeys: String, CodingKey {
-        case items = "ResponseItems"
-    }
-}
-
-_ = ResponseModel(items: [Item()]).items
-
-
class ResponseModel {
-    @objc func foo() {
-    }
-}
-_ = ResponseModel()
-
-
public func foo() {}
-
-
protocol Foo {}
-
-extension Foo {
-    func bar() {}
-}
-
-struct MyStruct: Foo {}
-MyStruct().bar()
-
-
import XCTest
-class MyTests: XCTestCase {
-    func testExample() {}
-}
-
-
import XCTest
-open class BestTestCase: XCTestCase {}
-class MyTests: BestTestCase {
-    func testExample() {}
-}
-
-
    struct S {
-        var i: Int? = nil
-        func f() {
-            if let i { print(i) }
-        }
-    }
-    S().f()
-
-
enum Component {
-  case string(StaticString)
-  indirect case array([Component])
-  indirect case optional(Component?)
-}
-
-@resultBuilder
-struct ComponentBuilder {
-  static func buildBlock(_ components: Component...) -> Component {
-    return .array(components)
-  }
-
-  static func buildExpression(_ string: StaticString) -> Component {
-    return .string(string)
-  }
-
-  static func buildOptional(_ component: Component?) -> Component {
-    return .optional(component)
-  }
-
-  static func buildEither(first component: Component) -> Component {
-    return component
-  }
-
-  static func buildEither(second component: Component) -> Component {
-    return component
-  }
-
-  static func buildArray(_ components: [Component]) -> Component {
-    return .array(components)
-  }
-
-  static func buildLimitedAvailability(_ component: Component) -> Component {
-    return component
-  }
-
-  static func buildFinalResult(_ component: Component) -> Component {
-    return component
-  }
-
-  static func buildPartialBlock(first component: Component) -> Component {
-    return component
-  }
-
-  static func buildPartialBlock(accumulated component: Component, next: Component) -> Component {
-    return component
-  }
-}
-
-func acceptComponentBuilder(@ComponentBuilder _ body: () -> Component) {
-  print(body())
-}
-
-acceptComponentBuilder {
-  "hello"
-}
-
-
import Cocoa
-
-@NSApplicationMain
-final class AppDelegate: NSObject, NSApplicationDelegate {
-    func applicationWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBAction private func foo() {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @objc func foo() {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBInspectable private var innerPaddingWidth: Int {
-        set { self.backgroundView.innerPaddingWidth = newValue }
-        get { return self.backgroundView.innerPaddingWidth }
-    }
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBOutlet private var bar: NSObject! {
-        set { fatalError() }
-        get { fatalError() }
-    }
-
-    @IBOutlet private var baz: NSObject! {
-        willSet { print("willSet") }
-    }
-
-    @IBOutlet private var buzz: NSObject! {
-        didSet { print("didSet") }
-    }
-}
-
-

Triggering Examples

-
let ↓kConstant = 0
-
-
struct Item {}
-struct ↓ResponseModel: Codable {
-    let ↓items: [Item]
-
-    enum ↓CodingKeys: String {
-        case items = "ResponseItems"
-    }
-}
-
-
class ↓ResponseModel {
-    func ↓foo() {
-    }
-}
-
-
public func ↓foo() {}
-
-
protocol Foo {
-    func ↓bar1()
-}
-
-extension Foo {
-    func bar1() {}
-    func ↓bar2() {}
-}
-
-struct MyStruct: Foo {}
-_ = MyStruct()
-
-
import XCTest
-class ↓MyTests: NSObject {
-    func ↓testExample() {}
-}
-
-
enum Component {
-  case string(StaticString)
-  indirect case array([Component])
-  indirect case optional(Component?)
-}
-
-struct ComponentBuilder {
-  func ↓buildExpression(_ string: StaticString) -> Component {
-    return .string(string)
-  }
-
-  func ↓buildBlock(_ components: Component...) -> Component {
-    return .array(components)
-  }
-
-  func ↓buildIf(_ value: Component?) -> Component {
-    return .optional(value)
-  }
-
-  static func ↓buildABear(_ components: Component...) -> Component {
-    return .array(components)
-  }
-}
-
-_ = ComponentBuilder()
-
-
protocol ↓Foo {}
-extension Foo {}
-
-
class ↓C<T> {}
-extension C<Int> {}
-
-
import Cocoa
-
-@NSApplicationMain
-final class AppDelegate: NSObject, NSApplicationDelegate {
-    func ↓appWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Cocoa
-
-final class ↓AppDelegate: NSObject, NSApplicationDelegate {
-    func applicationWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBOutlet var ↓bar: NSObject!
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBInspectable var ↓bar: String!
-}
-
-
import Foundation
-
-final class Foo: NSObject {}
-final class ↓Bar {
-    var ↓foo = Foo()
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_enumerated.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_enumerated.html deleted file mode 100644 index 3a009cec5..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_enumerated.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - unused_enumerated Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Enumerated

- -

When the index or the item is not used, .enumerated() can be removed.

- -
    -
  • Identifier: unused_enumerated
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
for (idx, foo) in bar.enumerated() { }
-
-
for (_, foo) in bar.enumerated().something() { }
-
-
for (_, foo) in bar.something() { }
-
-
for foo in bar.enumerated() { }
-
-
for foo in bar { }
-
-
for (idx, _) in bar.enumerated().something() { }
-
-
for (idx, _) in bar.something() { }
-
-
for idx in bar.indices { }
-
-
for (section, (event, _)) in data.enumerated() {}
-
-
list.enumerated().map { idx, elem in "\(idx): \(elem)" }
-
-
list.enumerated().map { $0 + $1 }
-
-
list.enumerated().something().map { _, elem in elem }
-
-
list.enumerated().map { ($0.offset, $0.element) }
-
-
list.enumerated().map { ($0.0, $0.1) }
-
-
list.enumerated().map {
-    $1.enumerated().forEach { print($0, $1) }
-    return $0
-}
-
-

Triggering Examples

-
for (↓_, foo) in bar.enumerated() { }
-
-
for (↓_, foo) in abc.bar.enumerated() { }
-
-
for (↓_, foo) in abc.something().enumerated() { }
-
-
for (idx, ↓_) in bar.enumerated() { }
-
-
list.enumerated().map { idx, ↓_ in idx }
-
-
list.enumerated().map { ↓_, elem in elem }
-
-
list.↓enumerated().forEach { print($0) }
-
-
list.↓enumerated().map { $1 }
-
-
list.enumerated().map {
-    $1.↓enumerated().forEach { print($1) }
-    return $0
-}
-
-
list.↓enumerated().map {
-    $1.enumerated().forEach { print($0, $1) }
-    return 1
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_import.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_import.html deleted file mode 100644 index ea88a9c22..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_import.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - unused_import Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Import

- -

All imported modules should be required to make the file compile

- -
    -
  • Identifier: unused_import
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -require_explicit_imports - -false -
    -allowed_transitive_imports - -[] -
    -always_keep_imports - -[] -
  • -
-

Non Triggering Examples

-
import Dispatch // This is used
-dispatchMain()
-
-
@testable import Dispatch
-dispatchMain()
-
-
import Foundation
-@objc
-class A {}
-
-
import UnknownModule
-func foo(error: Swift.Error) {}
-
-
@_exported import UnknownModule
-
-
import Foundation
-let 👨‍👩‍👧‍👦 = #selector(NSArray.contains(_:))
-👨‍👩‍👧‍👦 == 👨‍👩‍👧‍👦
-
-

Triggering Examples

-
↓import Dispatch
-struct A {
-  static func dispatchMain() {}
-}
-A.dispatchMain()
-
-
↓import Foundation // This is unused
-struct A {
-  static func dispatchMain() {}
-}
-A.dispatchMain()
-↓import Dispatch
-
-
-
↓import Foundation
-dispatchMain()
-
-
↓import Foundation
-// @objc
-class A {}
-
-
↓import Foundation
-import UnknownModule
-func foo(error: Swift.Error) {}
-
-
↓import Swift
-↓import SwiftShims
-func foo(error: Swift.Error) {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_optional_binding.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_optional_binding.html deleted file mode 100644 index 29fce5968..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_optional_binding.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - unused_optional_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Optional Binding

- -

Prefer != nil over let _ =

- -
    -
  • Identifier: unused_optional_binding
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignore_optional_try - -false -
  • -
-

Non Triggering Examples

-
if let bar = Foo.optionalValue {}
-
-
if let (_, second) = getOptionalTuple() {}
-
-
if let (_, asd, _) = getOptionalTuple(), let bar = Foo.optionalValue {}
-
-
if foo() { let _ = bar() }
-
-
if foo() { _ = bar() }
-
-
if case .some(_) = self {}
-
-
if let point = state.find({ _ in true }) {}
-
-

Triggering Examples

-
if let ↓_ = Foo.optionalValue {}
-
-
if let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {}
-
-
guard let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {}
-
-
if let (first, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let (first, _) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let (_, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let ↓(_, _, _) = getOptionalTuple(), let bar = Foo.optionalValue {}
-
-
func foo() { if let ↓_ = bar {} }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_setter_value.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_setter_value.html deleted file mode 100644 index a1b80df69..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/unused_setter_value.html +++ /dev/null @@ -1,479 +0,0 @@ - - - - unused_setter_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Setter Value

- -

Setter value is not used

- -
    -
  • Identifier: unused_setter_value
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    set {
-        Persister.shared.aValue = newValue
-    }
-}
-
-
var aValue: String {
-    set {
-        Persister.shared.aValue = newValue
-    }
-    get {
-        return Persister.shared.aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    set(value) {
-        Persister.shared.aValue = value
-    }
-}
-
-
override var aValue: String {
- get {
-     return Persister.shared.aValue
- }
- set { }
-}
-
-

Triggering Examples

-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-    get {
-        return Persister.shared.aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        let newValue = Persister.shared.aValue
-        return newValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set(value) {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
override var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/valid_ibinspectable.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/valid_ibinspectable.html deleted file mode 100644 index c7fce5e1e..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/valid_ibinspectable.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - valid_ibinspectable Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Valid IBInspectable

- -

@IBInspectable should be applied to variables only, have its type explicit and be of a supported type

- -
    -
  • Identifier: valid_ibinspectable
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  @IBInspectable private var x: Int
-}
-
-
class Foo {
-  @IBInspectable private var x: String?
-}
-
-
class Foo {
-  @IBInspectable private var x: String!
-}
-
-
class Foo {
-  @IBInspectable private var count: Int = 0
-}
-
-
class Foo {
-  private var notInspectable = 0
-}
-
-
class Foo {
-  private let notInspectable: Int
-}
-
-
class Foo {
-  private let notInspectable: UInt8
-}
-
-
extension Foo {
-    @IBInspectable var color: UIColor {
-        set {
-            self.bar.textColor = newValue
-        }
-
-        get {
-            return self.bar.textColor
-        }
-    }
-}
-
-
class Foo {
-    @IBInspectable var borderColor: UIColor? = nil {
-        didSet {
-            updateAppearance()
-        }
-    }
-}
-
-

Triggering Examples

-
class Foo {
-  @IBInspectable private ↓let count: Int
-}
-
-
class Foo {
-  @IBInspectable private ↓var insets: UIEdgeInsets
-}
-
-
class Foo {
-  @IBInspectable private ↓var count = 0
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Int?
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Int!
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Optional<Int>
-}
-
-
class Foo {
-  @IBInspectable private ↓var x: Optional<String>
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment.html deleted file mode 100644 index ac73069c2..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - vertical_parameter_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Parameter Alignment

- -

Function parameters should be aligned vertically if they’re in multiple lines in a declaration

- -
    -
  • Identifier: vertical_parameter_alignment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary) -> [StyleViolation]
-
-
func foo(bar: Int)
-
-
func foo(bar: Int) -> String
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary)
-                      -> [StyleViolation]
-
-
func validateFunction(
-   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
-   dictionary: SourceKittenDictionary) -> [StyleViolation]
-
-
func validateFunction(
-   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
-   dictionary: SourceKittenDictionary
-) -> [StyleViolation]
-
-
func regex(_ pattern: String,
-           options: NSRegularExpression.Options = [.anchorsMatchLines,
-                                                   .dotMatchesLineSeparators]) -> NSRegularExpression
-
-
func foo(a: Void,
-         b: [String: String] =
-         [:]) {
-}
-
-
func foo(data: (size: CGSize,
-                identifier: String)) {}
-
-
func foo(data: Data,
-         @ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-
-
class A {
-    init(bar: Int)
-}
-
-
class A {
-    init(foo: Int,
-         bar: String)
-}
-
-

Triggering Examples

-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                  ↓dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                       ↓dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile,
-                  ↓kind: SwiftDeclarationKind,
-                  ↓dictionary: SourceKittenDictionary) { }
-
-
func foo(data: Data,
-            ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-
-
class A {
-    init(data: Data,
-                ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html deleted file mode 100644 index 164096b70..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html +++ /dev/null @@ -1,478 +0,0 @@ - - - - vertical_parameter_alignment_on_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Parameter Alignment on Call

- -

Function parameters should be aligned vertically if they’re in multiple lines in a method call

- -
    -
  • Identifier: vertical_parameter_alignment_on_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo(param1: 1, param2: bar
-    param3: false, param4: true)
-
-
foo(param1: 1, param2: bar)
-
-
foo(param1: 1, param2: bar
-    param3: false,
-    param4: true)
-
-
foo(
-   param1: 1
-) { _ in }
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-}, completion: { _ in
-    self.hideLoading()
-})
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-},
-completion: { _ in
-    self.hideLoading()
-})
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-} { _ in
-    self.hideLoading()
-}
-
-
foo(param1: 1, param2: { _ in },
-    param3: false, param4: true)
-
-
foo({ _ in
-       bar()
-   },
-   completion: { _ in
-       baz()
-   }
-)
-
-
foo(param1: 1, param2: [
-   0,
-   1
-], param3: 0)
-
-
myFunc(foo: 0,
-       bar: baz == 0)
-
-
UIViewPropertyAnimator.runningPropertyAnimator(
-    withDuration: 2.0,
-    delay: 0.0,
-    options: [.curveEaseIn]
-) {
-    // animations
-} completion: { _ in
-    // completion
-}
-
-

Triggering Examples

-
foo(param1: 1, param2: bar,
-                ↓param3: false, param4: true)
-
-
foo(param1: 1, param2: bar,
- ↓param3: false, param4: true)
-
-
foo(param1: 1, param2: bar,
-       ↓param3: false,
-       ↓param4: true)
-
-
foo(param1: 1,
-       ↓param2: { _ in })
-
-
foo(param1: 1,
-    param2: { _ in
-}, param3: 2,
- ↓param4: 0)
-
-
foo(param1: 1, param2: { _ in },
-       ↓param3: false, param4: true)
-
-
myFunc(foo: 0,
-        ↓bar: baz == 0)
-
-
myFunc(foo: 0, bar:
-        baz == 0, ↓baz: true)
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace.html deleted file mode 100644 index 31134489a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - vertical_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace

- -

Limit vertical whitespace to a single empty line.

- -
    -
  • Identifier: vertical_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -max_empty_lines - -1 -
  • -
-

Non Triggering Examples

-
let abc = 0
-
-
-
let abc = 0
-
-
-
-
/* bcs 
-
-
-
-*/
-
-
// bca 
-
-
-
-

Triggering Examples

-
let aaaa = 0
-
-
-
-
-
struct AAAA {}
-
-
-
-
-
-
class BBBB {}
-
-
-
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html deleted file mode 100644 index 82e73d19a..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - vertical_whitespace_between_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace between Cases

- -

Include a single empty line between switch cases

- -
    -
  • Identifier: vertical_whitespace_between_cases
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    switch x {
-    case .valid:
-        print("multiple ...")
-        print("... lines")
-
-    case .invalid:
-        print("multiple ...")
-        print("... lines")
-    }
-
-
    switch x {
-    case .valid:
-        print("x is valid")
-
-    case .invalid:
-        print("x is invalid")
-    }
-
-
    switch x {
-    case 0..<5:
-        print("x is valid")
-
-    default:
-        print("x is invalid")
-    }
-
-
switch x {
-
-case 0..<5:
-    print("x is low")
-
-case 5..<10:
-    print("x is high")
-
-default:
-    print("x is invalid")
-
-}
-
-
switch x {
-case 0..<5:
-    print("x is low")
-
-case 5..<10:
-    print("x is high")
-
-default:
-    print("x is invalid")
-}
-
-
switch x {
-case 0..<5: print("x is low")
-case 5..<10: print("x is high")
-default: print("x is invalid")
-}
-
-
switch x {    
-case 1:    
-    print("one")    
-
-default:    
-    print("not one")    
-}    
-
-

Triggering Examples

-
    switch x {
-    case .valid:
-        print("multiple ...")
-        print("... lines")
-↓    case .invalid:
-        print("multiple ...")
-        print("... lines")
-    }
-
-
    switch x {
-    case .valid:
-        print("x is valid")
-↓    case .invalid:
-        print("x is invalid")
-    }
-
-
    switch x {
-    case 0..<5:
-        print("x is valid")
-↓    default:
-        print("x is invalid")
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html deleted file mode 100644 index d49c02405..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html +++ /dev/null @@ -1,508 +0,0 @@ - - - - vertical_whitespace_closing_braces Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace before Closing Braces

- -

Don’t include vertical whitespace (empty line) before closing braces

- -
    -
  • Identifier: vertical_whitespace_closing_braces
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_enforce_before_trivial_lines - -false -
  • -
-

Non Triggering Examples

-
[
-1,
-2,
-3
-]
-
-
do {
-  print("x is 5")
-}
-
-
do {
-  print("x is 5")
-}
-
-
do {
-  print("x is 5")
-}
-
-
foo(
-    x: 5,
-    y:6
-)
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-}
-
-
print([
-  1
-])
-
-
print([foo {
-  var sum = 0
-  for i in 1...5 { sum += i }
-  return sum
-
-}, foo {
-  var mul = 1
-  for i in 1...5 { mul *= i }
-  return mul
-}])
-
-
[1, 2].map { $0 }.filter { true }
-
-
[1, 2].map { $0 }.filter { num in true }
-
-
/*
-    class X {
-
-        let x = 5
-
-    }
-*/
-
-

Triggering Examples

-
[
-1,
-2,
-3
-↓
-]
-
-
do {
-  print("x is 5")
-↓
-
-}
-
-
do {
-  print("x is 5")
-↓
-
-}
-
-
do {
-  print("x is 5")
-↓
-}
-
-
foo(
-    x: 5,
-    y:6
-↓
-)
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-↓
-}
-
-
print([
-  1
-↓
-])
-
-
print([foo {
-  var sum = 0
-  for i in 1...5 { sum += i }
-  return sum
-
-}, foo {
-  var mul = 1
-  for i in 1...5 { mul *= i }
-  return mul
-↓
-}])
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html deleted file mode 100644 index 261c44d5d..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html +++ /dev/null @@ -1,504 +0,0 @@ - - - - vertical_whitespace_opening_braces Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace after Opening Braces

- -

Don’t include vertical whitespace (empty line) after opening braces

- -
    -
  • Identifier: vertical_whitespace_opening_braces
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/*
-    class X {
-
-        let x = 5
-
-    }
-*/
-
-
// [1, 2].map { $0 }.filter { num in true }
-
-
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
-    guard let img = image else { return }
-}
-
-
[
-1,
-2,
-3
-]
-
-
[1, 2].map { $0 }.filter { num in true }
-
-
[1, 2].map { $0 }.foo()
-
-
class X {
-  struct Y {
-    class Z {
-    }
-  }
-}
-
-
foo(
-  x: 5,
-  y:6
-)
-
-
foo({ }) { _ in
-  self.dismiss(animated: false, completion: {
-  })
-}
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-}
-
-
if x == 5 {
-  print("x is 5")
-}
-
-
if x == 5 {
-  print("x is 5")
-}
-
-
struct MyStruct {
-  let x = 5
-}
-
-

Triggering Examples

-
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
-↓
-    guard let img = image else { return }
-}
-
-
[
-↓
-1,
-2,
-3
-]
-
-
class X {
-  struct Y {
-↓
-    class Z {
-    }
-  }
-}
-
-
foo(
-↓
-  x: 5,
-  y:6
-)
-
-
foo({ }) { _ in
-↓
-  self.dismiss(animated: false, completion: {
-  })
-}
-
-
func foo() {
-↓
-  run(5) { x in
-    print(x)
-  }
-}
-
-
if x == 5 {
-↓
-
-  print("x is 5")
-}
-
-
if x == 5 {
-↓
-  print("x is 5")
-}
-
-
struct MyStruct {
-↓
-  let x = 5
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_function_in_ternary.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_function_in_ternary.html deleted file mode 100644 index c3b204713..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_function_in_ternary.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - void_function_in_ternary Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Void Function in Ternary

- -

Using ternary to call Void functions should be avoided

- -
    -
  • Identifier: void_function_in_ternary
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = success ? foo() : bar()
-
-
if success {
-    askQuestion()
-} else {
-    exit()
-}
-
-
var price: Double {
-    return hasDiscount ? calculatePriceWithDiscount() : calculateRegularPrice()
-}
-
-
foo(x == 2 ? a() : b())
-
-
chevronView.image = collapsed ? .icon(.mediumChevronDown) : .icon(.mediumChevronUp)
-
-
array.map { elem in
-    elem.isEmpty() ? .emptyValue() : .number(elem)
-}
-
-
func compute(data: [Int]) -> Int {
-    data.isEmpty ? 0 : expensiveComputation(data)
-}
-
-
var value: Int {
-    mode == .fast ? fastComputation() : expensiveComputation()
-}
-
-
var value: Int {
-    get {
-        mode == .fast ? fastComputation() : expensiveComputation()
-    }
-}
-
-
subscript(index: Int) -> Int {
-    get {
-        index == 0 ? defaultValue() : compute(index)
-    }
-
-
subscript(index: Int) -> Int {
-    index == 0 ? defaultValue() : compute(index)
-
-

Triggering Examples

-
success ↓? askQuestion() : exit()
-
-
perform { elem in
-    elem.isEmpty() ↓? .emptyValue() : .number(elem)
-    return 1
-}
-
-
DispatchQueue.main.async {
-    self.sectionViewModels[section].collapsed.toggle()
-    self.sectionViewModels[section].collapsed
-        ↓? self.tableView.deleteRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
-        : self.tableView.insertRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
-    self.tableView.scrollToRow(at: IndexPath(row: NSNotFound, section: section), at: .top, animated: true)
-}
-
-
subscript(index: Int) -> Int {
-    index == 0 ↓? something() : somethingElse(index)
-    return index
-
-
var value: Int {
-    mode == .fast ↓? something() : somethingElse()
-    return 0
-}
-
-
var value: Int {
-    get {
-        mode == .fast ↓? something() : somethingElse()
-        return 0
-    }
-}
-
-
subscript(index: Int) -> Int {
-    get {
-        index == 0 ↓? something() : somethingElse(index)
-        return index
-    }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_return.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_return.html deleted file mode 100644 index 41f5963ba..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/void_return.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - void_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Void Return

- -

Prefer -> Void over -> ()

- -
    -
  • Identifier: void_return
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc: () -> Void = {}
-
-
let abc: () -> (VoidVoid) = {}
-
-
func foo(completion: () -> Void)
-
-
let foo: (ConfigurationTests) -> () throws -> Void
-
-
let foo: (ConfigurationTests) ->   () throws -> Void
-
-
let foo: (ConfigurationTests) ->() throws -> Void
-
-
let foo: (ConfigurationTests) -> () -> Void
-
-
let foo: () -> () async -> Void
-
-
let foo: () -> () async throws -> Void
-
-
let foo: () -> () async -> Void
-
-
func foo() -> () async throws -> Void {}
-
-
func foo() async throws -> () async -> Void { return {} }
-
-
func foo() -> () async -> Int { 1 }
-
-

Triggering Examples

-
let abc: () -> ↓() = {}
-
-
let abc: () -> ↓(Void) = {}
-
-
let abc: () -> ↓(   Void ) = {}
-
-
func foo(completion: () -> ↓())
-
-
func foo(completion: () -> ↓(   ))
-
-
func foo(completion: () -> ↓(Void))
-
-
let foo: (ConfigurationTests) -> () throws -> ↓()
-
-
func foo() async -> ↓()
-
-
func foo() async throws -> ↓()
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/weak_delegate.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/weak_delegate.html deleted file mode 100644 index beed920d7..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/weak_delegate.html +++ /dev/null @@ -1,471 +0,0 @@ - - - - weak_delegate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Weak Delegate

- -

Delegates should be weak to avoid reference cycles

- -
    -
  • Identifier: weak_delegate
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  weak var delegate: SomeProtocol?
-}
-
-
class Foo {
-  weak var someDelegate: SomeDelegateProtocol?
-}
-
-
class Foo {
-  weak var delegateScroll: ScrollDelegate?
-}
-
-
class Foo {
-  var scrollHandler: ScrollDelegate?
-}
-
-
func foo() {
-  var delegate: SomeDelegate
-}
-
-
class Foo {
-  var delegateNotified: Bool?
-}
-
-
protocol P {
- var delegate: AnyObject? { get set }
-}
-
-
class Foo {
- protocol P {
- var delegate: AnyObject? { get set }
-}
-}
-
-
class Foo {
- var computedDelegate: ComputedDelegate {
- return bar() 
-} 
-}
-
-
class Foo {
-    var computedDelegate: ComputedDelegate {
-        get {
-            return bar()
-        }
-   }
-
-
struct Foo {
- @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
-}
-
-
struct Foo {
- @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
-}
-
-
struct Foo {
- @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var extensionDelegate 
-}
-
-
class Foo {
-    func makeDelegate() -> SomeDelegate {
-        let delegate = SomeDelegate()
-        return delegate
-    }
-}
-
-

Triggering Examples

-
class Foo {
-  ↓var delegate: SomeProtocol?
-}
-
-
class Foo {
-  ↓var scrollDelegate: ScrollDelegate?
-}
-
-
class Foo {
-    ↓var delegate: SomeProtocol? {
-        didSet {
-            print("Updated delegate")
-        }
-   }
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xct_specific_matcher.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xct_specific_matcher.html deleted file mode 100644 index daf18ef25..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xct_specific_matcher.html +++ /dev/null @@ -1,578 +0,0 @@ - - - - xct_specific_matcher Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

XCTest Specific Matcher

- -

Prefer specific XCTest matchers over XCTAssertEqual and XCTAssertNotEqual.

- -
    -
  • Identifier: xct_specific_matcher
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -matchers - -[one-argument-asserts, two-argument-asserts] -
  • -
-

Non Triggering Examples

-
XCTAssert(foo
-
-
XCTAssertFalse(foo)
-
-
XCTAssertTrue(foo)
-
-
XCTAssertNil(foo)
-
-
XCTAssertNotNil(foo)
-
-
XCTAssertEqual(foo, 2)
-
-
XCTAssertNotEqual(foo, "false")
-
-
XCTAssertEqual(foo, [1, 2, 3, true])
-
-
XCTAssertEqual(foo, [1, 2, 3, false])
-
-
XCTAssertEqual(foo, [1, 2, 3, nil])
-
-
XCTAssertEqual(foo, [true, nil, true, nil])
-
-
XCTAssertEqual([1, 2, 3, true], foo)
-
-
XCTAssertEqual([1, 2, 3, false], foo)
-
-
XCTAssertEqual([1, 2, 3, nil], foo)
-
-
XCTAssertEqual([true, nil, true, nil], foo)
-
-
XCTAssertEqual(2, foo)
-
-
XCTAssertNotEqual("false"), foo)
-
-
XCTAssertEqual(false, foo?.bar)
-
-
XCTAssertEqual(true, foo?.bar)
-
-
XCTAssert(    foo  )
-
-
XCTAssertFalse(  foo  )
-
-
XCTAssertTrue(  foo  )
-
-
XCTAssertNil(  foo  )
-
-
XCTAssertNotNil(  foo  )
-
-
XCTAssertEqual(  foo  , 2  )
-
-
XCTAssertNotEqual(  foo, "false")
-
-
XCTAssertEqual(foo?.bar, false)
-
-
XCTAssertEqual(foo?.bar, true)
-
-
XCTAssertNil(foo?.bar)
-
-
XCTAssertNotNil(foo?.bar)
-
-
XCTAssertEqual(foo?.bar, 2)
-
-
XCTAssertNotEqual(foo?.bar, "false")
-
-
XCTAssertEqual(foo?.bar, toto())
-
-
XCTAssertEqual(foo?.bar, .toto(.zoo))
-
-
XCTAssertEqual(toto(), foo?.bar)
-
-
XCTAssertEqual(.toto(.zoo), foo?.bar)
-
-
XCTAssert(foo.self == bar)
-
-
XCTAssertTrue(type(of: foo) != Int.self)
-
-
XCTAssertTrue(a == (1, 3, 5)
-
-

Triggering Examples

-
↓XCTAssertEqual(foo, true)
-
-
↓XCTAssertEqual(foo, false)
-
-
↓XCTAssertEqual(foo, nil)
-
-
↓XCTAssertNotEqual(foo, true)
-
-
↓XCTAssertNotEqual(foo, false)
-
-
↓XCTAssertNotEqual(foo, nil)
-
-
↓XCTAssertEqual(true, foo)
-
-
↓XCTAssertEqual(false, foo)
-
-
↓XCTAssertEqual(nil, foo)
-
-
↓XCTAssertNotEqual(true, foo)
-
-
↓XCTAssertNotEqual(false, foo)
-
-
↓XCTAssertNotEqual(nil, foo)
-
-
↓XCTAssertEqual(foo, true, "toto")
-
-
↓XCTAssertEqual(foo, false, "toto")
-
-
↓XCTAssertEqual(foo, nil, "toto")
-
-
↓XCTAssertNotEqual(foo, true, "toto")
-
-
↓XCTAssertNotEqual(foo, false, "toto")
-
-
↓XCTAssertNotEqual(foo, nil, "toto")
-
-
↓XCTAssertEqual(true, foo, "toto")
-
-
↓XCTAssertEqual(false, foo, "toto")
-
-
↓XCTAssertEqual(nil, foo, "toto")
-
-
↓XCTAssertNotEqual(true, foo, "toto")
-
-
↓XCTAssertNotEqual(false, foo, "toto")
-
-
↓XCTAssertNotEqual(nil, foo, "toto")
-
-
↓XCTAssertEqual(foo,true)
-
-
↓XCTAssertEqual( foo , false )
-
-
↓XCTAssertEqual(  foo  ,  nil  )
-
-
↓XCTAssertEqual(true, [1, 2, 3, true].hasNumbers())
-
-
↓XCTAssertEqual([1, 2, 3, true].hasNumbers(), true)
-
-
↓XCTAssertEqual(foo?.bar, nil)
-
-
↓XCTAssertNotEqual(foo?.bar, nil)
-
-
↓XCTAssertEqual(nil, true)
-
-
↓XCTAssertEqual(nil, false)
-
-
↓XCTAssertEqual(true, nil)
-
-
↓XCTAssertEqual(false, nil)
-
-
↓XCTAssertEqual(nil, nil)
-
-
↓XCTAssertEqual(true, true)
-
-
↓XCTAssertEqual(false, false)
-
-
↓XCTAssert(foo == bar)
-
-
↓XCTAssertTrue(   foo  ==   bar  )
-
-
↓XCTAssertFalse(1 == foo)
-
-
↓XCTAssert(foo == bar, "toto")
-
-
↓XCTAssert(foo != bar)
-
-
↓XCTAssertTrue(   foo  !=   bar  )
-
-
↓XCTAssertFalse(1 != foo)
-
-
↓XCTAssert(foo != bar, "toto")
-
-
↓XCTAssert(  foo   ==  nil)
-
-
↓XCTAssert(nil == foo
-
-
↓XCTAssertTrue(  foo   !=  nil)
-
-
↓XCTAssertFalse(nil != foo
-
-
↓XCTAssert(foo == nil, "toto")
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xctfail_message.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xctfail_message.html deleted file mode 100644 index 735f6f746..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/xctfail_message.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - xctfail_message Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

XCTFail Message

- -

An XCTFail call should include a description of the assertion

- -
    -
  • Identifier: xctfail_message
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func testFoo() {
-  XCTFail("bar")
-}
-
-
func testFoo() {
-  XCTFail(bar)
-}
-
-

Triggering Examples

-
func testFoo() {
-  ↓XCTFail()
-}
-
-
func testFoo() {
-  ↓XCTFail("")
-}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/yoda_condition.html b/docsets/SwiftLintCore.docset/Contents/Resources/Documents/yoda_condition.html deleted file mode 100644 index df6eec425..000000000 --- a/docsets/SwiftLintCore.docset/Contents/Resources/Documents/yoda_condition.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - yoda_condition Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Yoda Condition

- -

The constant literal should be placed on the right-hand side of the comparison operator

- -
    -
  • Identifier: yoda_condition
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if foo == 42 {}
-
-
if foo <= 42.42 {}
-
-
guard foo >= 42 else { return }
-
-
guard foo != "str str" else { return }
-
-
while foo < 10 { }
-
-
while foo > 1 { }
-
-
while foo + 1 == 2 {}
-
-
if optionalValue?.property ?? 0 == 2 {}
-
-
if foo == nil {}
-
-
if flags & 1 == 1 {}
-
-

Triggering Examples

-
if ↓42 == foo {}
-
-
if ↓42.42 >= foo {}
-
-
guard ↓42 <= foo else { return }
-
-
guard ↓"str str" != foo else { return }
-
-
while ↓10 > foo { }
-
-
while ↓1 < foo { }
-
-
if ↓nil == foo {}
-
-
while ↓1 > i + 5 {}
-
-
if ↓200 <= i && i <= 299 || ↓600 <= i {}
-
- -
-
- - -
-
- - - diff --git a/docsets/SwiftLintCore.docset/Contents/Resources/docSet.dsidx b/docsets/SwiftLintCore.docset/Contents/Resources/docSet.dsidx deleted file mode 100644 index ca6e6ac45..000000000 Binary files a/docsets/SwiftLintCore.docset/Contents/Resources/docSet.dsidx and /dev/null differ diff --git a/docsets/SwiftLintCore.tgz b/docsets/SwiftLintCore.tgz deleted file mode 100644 index 9fdcf5554..000000000 Binary files a/docsets/SwiftLintCore.tgz and /dev/null differ diff --git a/docsets/SwiftLintCore.xml b/docsets/SwiftLintCore.xml deleted file mode 100644 index 963711715..000000000 --- a/docsets/SwiftLintCore.xml +++ /dev/null @@ -1 +0,0 @@ -0.54.0https://realm.github.io/SwiftLint/docsets/SwiftLintCore.tgz diff --git a/duplicate_conditions.html b/duplicate_conditions.html deleted file mode 100644 index 4f615ad7d..000000000 --- a/duplicate_conditions.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - duplicate_conditions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Conditions

- -

Duplicate sets of conditions in the same branch instruction should be avoided

- -
    -
  • Identifier: duplicate_conditions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
    if x < 5 {
-      foo()
-    } else if y == "s" {
-      bar()
-    }
-
-
    if x < 5 {
-      foo()
-    }
-    if x < 5 {
-      bar()
-    }
-
-
    if x < 5, y == "s" {
-      foo()
-    } else if x < 5 {
-      bar()
-    }
-
-
    switch x {
-    case "a":
-      foo()
-      bar()
-    }
-
-
    switch x {
-    case "a" where y == "s":
-      foo()
-    case "a" where y == "t":
-      bar()
-    }
-
-
    if let x = maybeAbc {
-      foo()
-    } else if let x = maybePqr {
-      bar()
-    }
-
-
    if let x = maybeAbc, let z = x.maybeY {
-      foo()
-    } else if let x = maybePqr, let z = x.maybeY {
-      bar()
-    }
-
-
    if case .p = x {
-      foo()
-    } else if case .q = x {
-      bar()
-    }
-
-
    if true {
-      if true { foo() }
-    }
-
-

Triggering Examples

-
    if ↓x < 5 {
-      foo()
-    } else if y == "s" {
-      bar()
-    } else if ↓x < 5 {
-      baz()
-    }
-
-
    if z {
-      if ↓x < 5 {
-        foo()
-      } else if y == "s" {
-        bar()
-      } else if ↓x < 5 {
-        baz()
-      }
-    }
-
-
    if ↓x < 5, y == "s" {
-      foo()
-    } else if x < 10 {
-      bar()
-    } else if ↓y == "s", x < 5 {
-      baz()
-    }
-
-
    switch x {
-    case ↓"a", "b":
-      foo()
-    case "c", ↓"a":
-      bar()
-    }
-
-
    switch x {
-    case ↓"a" where y == "s":
-      foo()
-    case ↓"a" where y == "s":
-      bar()
-    }
-
-
    if ↓let xyz = maybeXyz {
-      foo()
-    } else if ↓let xyz = maybeXyz {
-      bar()
-    }
-
-
    if ↓let x = maybeAbc, let z = x.maybeY {
-      foo()
-    } else if ↓let x = maybeAbc, let z = x.maybeY {
-      bar()
-    }
-
-
    if ↓#available(macOS 10.15, *) {
-      foo()
-    } else if ↓#available(macOS 10.15, *) {
-      bar()
-    }
-
-
    if ↓case .p = x {
-      foo()
-    } else if ↓case .p = x {
-      bar()
-    }
-
-
    if ↓x < 5 {}
-    else if ↓x < 5 {}
-    else if ↓x < 5 {}
-
- -
-
- - -
-
- - - diff --git a/duplicate_enum_cases.html b/duplicate_enum_cases.html deleted file mode 100644 index bc0d1bfbf..000000000 --- a/duplicate_enum_cases.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - duplicate_enum_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Enum Cases

- -

Enum shouldn’t contain multiple cases with the same name

- -
    -
  • Identifier: duplicate_enum_cases
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
enum PictureImport {
-    case addImage(image: UIImage)
-    case addData(data: Data)
-}
-
-
enum A {
-    case add(image: UIImage)
-}
-enum B {
-    case add(image: UIImage)
-}
-
-
enum Tag: String {
-#if CONFIG_A
-    case value = "CONFIG_A"
-#elseif CONFIG_B
-    case value = "CONFIG_B"
-#else
-    case value = "CONFIG_DEFAULT"
-#endif
-}
-
-
enum Target {
-#if os(iOS)
-  case file
-#else
-  case file(URL)
-#endif
-}
-
-

Triggering Examples

-
enum PictureImport {
-    case ↓add(image: UIImage)
-    case addURL(url: URL)
-    case ↓add(data: Data)
-}
-
- -
-
- - -
-
- - - diff --git a/duplicate_imports.html b/duplicate_imports.html deleted file mode 100644 index 2134fa494..000000000 --- a/duplicate_imports.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - duplicate_imports Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicate Imports

- -

Imports should be unique

- -
    -
  • Identifier: duplicate_imports
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
import A
-import B
-import C
-
-
import A.B
-import A.C
-
-
@_implementationOnly import A
-@_implementationOnly import B
-
-
@testable import A
-@testable import B
-
-
#if DEBUG
-    @testable import KsApi
-#else
-    import KsApi
-#endif
-
-
import A // module
-import B // module
-
-
#if TEST
-func test() {
-}
-
-

Triggering Examples

-
@_implementationOnly import A
-↓@_implementationOnly import A
-
-
-
@testable import A
-↓@testable import A
-
-
-
import A
-#if DEBUG
-    @testable import KsApi
-#else
-    import KsApi
-#endif
-↓import A
-
-
-
import A
-↓import class A.Foo
-
-
-
import A
-↓import enum A.Foo
-
-
-
import A
-↓import func A.Foo
-
-
-
import A
-↓import let A.Foo
-
-
-
import A
-↓import protocol A.Foo
-
-
-
import A
-↓import struct A.Foo
-
-
-
import A
-↓import typealias A.Foo
-
-
-
import A
-↓import var A.Foo
-
-
-
import A.B
-↓import A.B.C
-
-
-
import Foundation
-import Dispatch
-↓import Foundation
-
-
-
import Foundation
-↓import Foundation
-↓import Foundation
-
-
-
import Foundation
-↓import Foundation.NSString
-
-
-
↓import A.B.C
-import A.B
-
-
-
↓import Foundation.NSString
-import Foundation
-
-
- -
-
- - -
-
- - - diff --git a/duplicated_key_in_dictionary_literal.html b/duplicated_key_in_dictionary_literal.html deleted file mode 100644 index 5ea1fc56b..000000000 --- a/duplicated_key_in_dictionary_literal.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - duplicated_key_in_dictionary_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Duplicated Key in Dictionary Literal

- -

Dictionary literals with duplicated keys will crash at runtime

- -
    -
  • Identifier: duplicated_key_in_dictionary_literal
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    [
-        1: "1",
-        2: "2"
-    ]
-
-
    [
-        "1": 1,
-        "2": 2
-    ]
-
-
    [
-        foo: "1",
-        bar: "2"
-    ]
-
-
    [
-        UUID(): "1",
-        UUID(): "2"
-    ]
-
-
    [
-        #line: "1",
-        #line: "2"
-    ]
-
-

Triggering Examples

-
    [
-        1: "1",
-        2: "2",
-        ↓1: "one"
-    ]
-
-
    [
-        "1": 1,
-        "2": 2,
-        ↓"2": 2
-    ]
-
-
    [
-        foo: "1",
-        bar: "2",
-        baz: "3",
-        ↓foo: "4",
-        zaz: "5"
-    ]
-
-
    [
-        .one: "1",
-        .two: "2",
-        .three: "3",
-        ↓.one: "1",
-        .four: "4",
-        .five: "5"
-    ]
-
- -
-
- - -
-
- - - diff --git a/dynamic_inline.html b/dynamic_inline.html deleted file mode 100644 index 92b3066bb..000000000 --- a/dynamic_inline.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - dynamic_inline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Dynamic Inline

- -

Avoid using ‘dynamic’ and ‘@inline(__always)’ together

- -
    -
  • Identifier: dynamic_inline
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
class C {
-dynamic func f() {}}
-
-
class C {
-@inline(__always) func f() {}}
-
-
class C {
-@inline(never) dynamic func f() {}}
-
-

Triggering Examples

-
class C {
-@inline(__always) dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always) public dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always) dynamic internal ↓func f() {}
-}
-
-
class C {
-@inline(__always)
-dynamic ↓func f() {}
-}
-
-
class C {
-@inline(__always)
-dynamic
-↓func f() {}
-}
-
- -
-
- - -
-
- - - diff --git a/empty_collection_literal.html b/empty_collection_literal.html deleted file mode 100644 index 1d3d3fa83..000000000 --- a/empty_collection_literal.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - empty_collection_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Collection Literal

- -

Prefer checking isEmpty over comparing collection to an empty array or dictionary literal

- -
    -
  • Identifier: empty_collection_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
myArray = []
-
-
myArray.isEmpty
-
-
!myArray.isEmpty
-
-
myDict = [:]
-
-

Triggering Examples

-
myArray↓ == []
-
-
myArray↓ != []
-
-
myArray↓ == [ ]
-
-
myDict↓ == [:]
-
-
myDict↓ != [:]
-
-
myDict↓ == [: ]
-
-
myDict↓ == [ :]
-
-
myDict↓ == [ : ]
-
- -
-
- - -
-
- - - diff --git a/empty_count.html b/empty_count.html deleted file mode 100644 index 9cae39360..000000000 --- a/empty_count.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - empty_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Count

- -

Prefer checking isEmpty over comparing count to zero

- -
    -
  • Identifier: empty_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -error -
    -only_after_dot - -false -
  • -
-

Non Triggering Examples

-
var count = 0
-
-
[Int]().isEmpty
-
-
[Int]().count > 1
-
-
[Int]().count == 1
-
-
[Int]().count == 0xff
-
-
[Int]().count == 0b01
-
-
[Int]().count == 0o07
-
-
discount == 0
-
-
order.discount == 0
-
-

Triggering Examples

-
[Int]().↓count == 0
-
-
0 == [Int]().↓count
-
-
[Int]().↓count==0
-
-
[Int]().↓count > 0
-
-
[Int]().↓count != 0
-
-
[Int]().↓count == 0x0
-
-
[Int]().↓count == 0x00_00
-
-
[Int]().↓count == 0b00
-
-
[Int]().↓count == 0o00
-
-
↓count == 0
-
- -
-
- - -
-
- - - diff --git a/empty_enum_arguments.html b/empty_enum_arguments.html deleted file mode 100644 index 438480839..000000000 --- a/empty_enum_arguments.html +++ /dev/null @@ -1,505 +0,0 @@ - - - - empty_enum_arguments Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Enum Arguments

- -

Arguments can be omitted when matching enums with associated values if they are not used

- -
    -
  • Identifier: empty_enum_arguments
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar: break
-}
-
-
switch foo {
-case .bar(let x): break
-}
-
-
switch foo {
-case let .bar(x): break
-}
-
-
switch (foo, bar) {
-case (_, _): break
-}
-
-
switch foo {
-case "bar".uppercased(): break
-}
-
-
switch (foo, bar) {
-case (_, _) where !something: break
-}
-
-
switch foo {
-case (let f as () -> String)?: break
-}
-
-
switch foo {
-case .bar(Baz()): break
-}
-
-
switch foo {
-case .bar(.init()): break
-}
-
-
switch foo {
-default: break
-}
-
-
if case .bar = foo {
-}
-
-
guard case .bar = foo else {
-}
-
-
if foo == .bar() {}
-
-
guard foo == .bar() else { return }
-
-
if case .appStore = self.appInstaller, !UIDevice.isSimulator() {
-  viewController.present(self, animated: false)
-} else {
-  UIApplication.shared.open(self.appInstaller.url)
-}
-
-
let updatedUserNotificationSettings = deepLink.filter { nav in
-  guard case .settings(.notifications(_, nil)) = nav else { return false }
-  return true
-}
-
-

Triggering Examples

-
switch foo {
-case .bar↓(_): break
-}
-
-
switch foo {
-case .bar↓(): break
-}
-
-
switch foo {
-case .bar↓(_), .bar2↓(_): break
-}
-
-
switch foo {
-case .bar↓() where method() > 2: break
-}
-
-
switch foo {
-case .bar(.baz↓()): break
-}
-
-
switch foo {
-case .bar(.baz↓(_)): break
-}
-
-
func example(foo: Foo) {
-    switch foo {
-    case case .bar↓(_):
-        break
-    }
-}
-
-
if case .bar↓(_) = foo {
-}
-
-
guard case .bar↓(_) = foo else {
-}
-
-
if case .bar↓() = foo {
-}
-
-
guard case .bar↓() = foo else {
-}
-
-
if case .appStore↓(_) = self.appInstaller, !UIDevice.isSimulator() {
-  viewController.present(self, animated: false)
-} else {
-  UIApplication.shared.open(self.appInstaller.url)
-}
-
-
let updatedUserNotificationSettings = deepLink.filter { nav in
-  guard case .settings(.notifications↓(_, _)) = nav else { return false }
-  return true
-}
-
- -
-
- - -
-
- - - diff --git a/empty_parameters.html b/empty_parameters.html deleted file mode 100644 index 079edc765..000000000 --- a/empty_parameters.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - empty_parameters Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Parameters

- -

Prefer () -> over Void ->

- -
    -
  • Identifier: empty_parameters
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc: () -> Void = {}
-
-
func foo(completion: () -> Void)
-
-
func foo(completion: () throws -> Void)
-
-
let foo: (ConfigurationTests) -> Void throws -> Void)
-
-
let foo: (ConfigurationTests) ->   Void throws -> Void)
-
-
let foo: (ConfigurationTests) ->Void throws -> Void)
-
-

Triggering Examples

-
let abc: ↓(Void) -> Void = {}
-
-
func foo(completion: ↓(Void) -> Void)
-
-
func foo(completion: ↓(Void) throws -> Void)
-
-
let foo: ↓(Void) -> () throws -> Void)
-
- -
-
- - -
-
- - - diff --git a/empty_parentheses_with_trailing_closure.html b/empty_parentheses_with_trailing_closure.html deleted file mode 100644 index cda4d4790..000000000 --- a/empty_parentheses_with_trailing_closure.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - empty_parentheses_with_trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty Parentheses with Trailing Closure

- -

When using trailing closures, empty parentheses should be avoided after the method call

- -
    -
  • Identifier: empty_parentheses_with_trailing_closure
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].reduce(0) { $0 + $1 }
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
let isEmpty = [1, 2].isEmpty()
-
-
UIView.animateWithDuration(0.3, animations: {
-   self.disableInteractionRightView.alpha = 0
-}, completion: { _ in
-   ()
-})
-
-

Triggering Examples

-
[1, 2].map↓() { $0 + 1 }
-
-
[1, 2].map↓( ) { $0 + 1 }
-
-
[1, 2].map↓() { number in
- number + 1 
-}
-
-
[1, 2].map↓(  ) { number in
- number + 1 
-}
-
-
func foo() -> [Int] {
-    return [1, 2].map↓() { $0 + 1 }
-}
-
- -
-
- - -
-
- - - diff --git a/empty_string.html b/empty_string.html deleted file mode 100644 index 36ca6cd98..000000000 --- a/empty_string.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - empty_string Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty String

- -

Prefer checking isEmpty over comparing string to an empty string literal

- -
    -
  • Identifier: empty_string
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
myString.isEmpty
-
-
!myString.isEmpty
-
-
"""
-foo==
-"""
-
-

Triggering Examples

-
myString↓ == ""
-
-
myString↓ != ""
-
-
myString↓==""
-
-
myString↓ == #""#
-
-
myString↓ == ##""##
-
- -
-
- - -
-
- - - diff --git a/empty_xctest_method.html b/empty_xctest_method.html deleted file mode 100644 index 0ae767c9e..000000000 --- a/empty_xctest_method.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - empty_xctest_method Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Empty XCTest Method

- -

Empty XCTest method should be avoided

- -
    -
  • Identifier: empty_xctest_method
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
class TotoTests: XCTestCase {
-    var foobar: Foobar?
-
-    override func setUp() {
-        super.setUp()
-        foobar = Foobar()
-    }
-
-    override func setUpWithError() throws {
-        foobar = nil
-    }
-
-    override func tearDown() {
-        foobar = nil
-        super.tearDown()
-    }
-
-    func testFoo() {
-        XCTAssertTrue(foobar?.foo)
-    }
-
-    func testBar() {
-        // comment...
-
-        XCTAssertFalse(foobar?.bar)
-
-        // comment...
-    }
-
-    func testBaz() {
-        _ = 4 + 4
-    }
-}
-
-
class Foobar {
-    func setUp() {}
-
-    func tearDown() {}
-
-    func testFoo() {}
-}
-
-
class TotoTests: XCTestCase {
-    func setUp(with object: Foobar) {}
-
-    func tearDown(object: Foobar) {}
-
-    func testFoo(_ foo: Foobar) {}
-
-    func testBar(bar: (String) -> Int) {}
-}
-
-
class TotoTests: XCTestCase {
-    func testFoo() { XCTAssertTrue(foobar?.foo) }
-
-    func testBar() { XCTAssertFalse(foobar?.bar) }
-}
-
-
class TotoTests: XCTestCase {
-    override class var runsForEachTargetApplicationUIConfiguration: Bool { true }
-
-    static var allTests = [("testFoo", testFoo)]
-
-    func testFoo() { XCTAssert(true) }
-}
-
-

Triggering Examples

-
class TotoTests: XCTestCase {
-    override ↓func setUp() {
-    }
-
-    override ↓func tearDown() {
-
-    }
-
-    ↓func testFoo() {
-
-
-    }
-
-    ↓func testBar() {
-
-
-
-    }
-
-    func helperFunction() {
-    }
-}
-
-
class TotoTests: XCTestCase {
-    override ↓func setUp() {}
-
-    override ↓func tearDown() {}
-
-    ↓func testFoo() {}
-
-    func helperFunction() {}
-}
-
-
class TotoTests: XCTestCase {
-    override ↓func setUp() {
-        // comment...
-    }
-
-    override ↓func tearDown() {
-        // comment...
-        // comment...
-    }
-
-    ↓func testFoo() {
-        // comment...
-
-        // comment...
-
-        // comment...
-    }
-
-    ↓func testBar() {
-        /*
-         * comment...
-         *
-         * comment...
-         *
-         * comment...
-         */
-    }
-
-    func helperFunction() {
-    }
-}
-
-
class FooTests: XCTestCase {
-    override ↓func setUp() {}
-}
-
-class BarTests: XCTestCase {
-    ↓func testFoo() {}
-}
-
- -
-
- - -
-
- - - diff --git a/enum_case_associated_values_count.html b/enum_case_associated_values_count.html deleted file mode 100644 index c3b17f7cf..000000000 --- a/enum_case_associated_values_count.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - enum_case_associated_values_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Enum Case Associated Values Count

- -

The number of associated values in an enum case should be low.

- -
    -
  • Identifier: enum_case_associated_values_count
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -5 -
    -error - -6 -
  • -
-

Non Triggering Examples

-
enum Employee {
-    case fullTime(name: String, retirement: Date, designation: String, contactNumber: Int)
-    case partTime(name: String, age: Int, contractEndDate: Date)
-}
-
-
enum Barcode {
-    case upc(Int, Int, Int, Int)
-}
-
-

Triggering Examples

-
enum Employee {
-    case ↓fullTime(name: String, retirement: Date, age: Int, designation: String, contactNumber: Int)
-    case ↓partTime(name: String, contractEndDate: Date, age: Int, designation: String, contactNumber: Int)
-}
-
-
enum Barcode {
-    case ↓upc(Int, Int, Int, Int, Int, Int)
-}
-
- -
-
- - -
-
- - - diff --git a/expiring_todo.html b/expiring_todo.html deleted file mode 100644 index 7e9a76b32..000000000 --- a/expiring_todo.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - expiring_todo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Expiring Todo

- -

TODOs and FIXMEs should be resolved prior to their expiry date.

- -
    -
  • Identifier: expiring_todo
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -approaching_expiry_severity - -warning -
    -expired_severity - -error -
    -bad_formatting_severity - -error -
    -approaching_expiry_threshold - -15 -
    -date_delimiters - - - - - - - - - - - - - - - -
    KeyValue
    -opening - -“[” -
    -closing - -“]” -
    -
    -date_format - -“MM/dd/yyyy” -
    -date_separator - -“/” -
  • -
-

Non Triggering Examples

-
// notaTODO:
-
-
// notaFIXME:
-
-
// TODO: [12/31/9999]
-
-
// TODO(note)
-
-
// FIXME(note)
-
-
/* FIXME: */
-
-
/* TODO: */
-
-
/** FIXME: */
-
-
/** TODO: */
-
-

Triggering Examples

-
// TODO: [↓10/14/2019]
-
-
// FIXME: [↓10/14/2019]
-
-
// FIXME: [↓1/14/2019]
-
-
// FIXME: [↓10/14/2019]
-
-
// TODO: [↓9999/14/10]
-
- -
-
- - -
-
- - - diff --git a/explicit_acl.html b/explicit_acl.html deleted file mode 100644 index 706d4c8f8..000000000 --- a/explicit_acl.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - explicit_acl Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit ACL

- -

All declarations should specify Access Control Level keywords explicitly

- -
    -
  • Identifier: explicit_acl
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
internal enum A {}
-
-
public final class B {}
-
-
private struct C {}
-
-
internal enum A { internal enum B {} }
-
-
internal final class Foo {}
-
-
internal
-class Foo {
-  private let bar = 5
-}
-
-
internal func a() { let a =  }
-
-
private func a() { func innerFunction() { } }
-
-
private enum Foo { enum Bar { } }
-
-
private struct C { let d = 5 }
-
-
internal protocol A {
-  func b()
-}
-
-
internal protocol A {
-  var b: Int
-}
-
-
internal class A { deinit {} }
-
-
extension A: Equatable {}
-
-
extension A {}
-
-
extension Foo {
-    internal func bar() {}
-}
-
-
internal enum Foo {
-    case bar
-}
-
-
extension Foo {
-    public var isValid: Bool {
-        let result = true
-        return result
-    }
-}
-
-
extension Foo {
-    private var isValid: Bool {
-        get {
-            return true
-        }
-        set(newValue) {
-            print(newValue)
-        }
-    }
-}
-
-
private extension Foo {
-    var isValid: Bool { true }
-    struct S {
-        let b = 2
-    }
-}
-
-

Triggering Examples

-
↓enum A {}
-
-
final ↓class B {}
-
-
internal struct C { ↓let d = 5 }
-
-
public struct C { private(set) ↓var d = 5 }
-
-
internal struct C { static ↓let d = 5 }
-
-
public struct C { ↓let d = 5 }
-
-
public struct C { ↓init() }
-
-
static ↓func a() {}
-
-
internal let a = 0
-↓func b() {}
-
-
extension Foo {
-    ↓func bar() {}
-    static ↓func baz() {}
-}
-
-
public extension E {
-    let a = 1
-    struct S {
-        ↓let b = 2
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/explicit_enum_raw_value.html b/explicit_enum_raw_value.html deleted file mode 100644 index 1d1c50df2..000000000 --- a/explicit_enum_raw_value.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - explicit_enum_raw_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Enum Raw Value

- -

Enums should be explicitly assigned their raw values

- -
    -
  • Identifier: explicit_enum_raw_value
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers {
-  case int(Int)
-  case short(Int16)
-}
-
-
enum Numbers: Int {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: Double {
-  case one = 1.1
-  case two = 2.2
-}
-
-
enum Numbers: String {
-  case one = "one"
-  case two = "two"
-}
-
-
protocol Algebra {}
-enum Numbers: Algebra {
-  case one
-}
-
-

Triggering Examples

-
enum Numbers: Int {
-  case one = 10, ↓two, three = 30
-}
-
-
enum Numbers: NSInteger {
-  case ↓one
-}
-
-
enum Numbers: String {
-  case ↓one
-  case ↓two
-}
-
-
enum Numbers: String {
-   case ↓one, two = "two"
-}
-
-
enum Numbers: Decimal {
-  case ↓one, ↓two
-}
-
-
enum Outer {
-    enum Numbers: Decimal {
-      case ↓one, ↓two
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/explicit_init.html b/explicit_init.html deleted file mode 100644 index 209ae880c..000000000 --- a/explicit_init.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - explicit_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Init

- -

Explicitly calling .init() should be avoided

- -
    -
  • Identifier: explicit_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -include_bare_init - -false -
  • -
-

Non Triggering Examples

-
import Foundation
-class C: NSObject {
-    override init() {
-        super.init()
-    }
-}
-
-
struct S {
-    let n: Int
-}
-extension S {
-    init() {
-        self.init(n: 1)
-    }
-}
-
-
[1].flatMap(String.init)
-
-
[String.self].map { $0.init(1) }
-
-
[String.self].map { type in type.init(1) }
-
-
Observable.zip(obs1, obs2, resultSelector: MyType.init).asMaybe()
-
-
_ = GleanMetrics.Tabs.someType.init()
-
-
Observable.zip(
-  obs1,
-  obs2,
-  resultSelector: MyType.init
-).asMaybe()
-
-

Triggering Examples

-
[1].flatMap{String↓.init($0)}
-
-
[String.self].map { Type in Type↓.init(1) }
-
-
func foo() -> [String] {
-    return [1].flatMap { String↓.init($0) }
-}
-
-
_ = GleanMetrics.Tabs.GroupedTabExtra↓.init()
-
-
_ = Set<KsApi.Category>↓.init()
-
-
Observable.zip(
-  obs1,
-  obs2,
-  resultSelector: { MyType↓.init($0, $1) }
-).asMaybe()
-
- -
-
- - -
-
- - - diff --git a/explicit_self.html b/explicit_self.html deleted file mode 100644 index ae7ba6e60..000000000 --- a/explicit_self.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - explicit_self Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Self

- -

Instance variables and functions should be explicitly accessed with ‘self.’

- -
    -
  • Identifier: explicit_self
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct A {
-    func f1() {}
-    func f2() {
-        self.f1()
-    }
-}
-
-
struct A {
-    let p1: Int
-    func f1() {
-        _ = self.p1
-    }
-}
-
-
@propertyWrapper
-struct Wrapper<Value> {
-    let wrappedValue: Value
-    var projectedValue: [Value] {
-        [self.wrappedValue]
-    }
-}
-struct A {
-    @Wrapper var p1: Int
-    func f1() {
-        self.$p1
-        self._p1
-    }
-}
-func f1() {
-    A(p1: 10).$p1
-}
-
-

Triggering Examples

-
struct A {
-    func f1() {}
-    func f2() {
-        ↓f1()
-    }
-}
-
-
struct A {
-    let p1: Int
-    func f1() {
-        _ = ↓p1
-    }
-}
-
-
struct A {
-    func f1(a b: Int) {}
-    func f2() {
-        ↓f1(a: 0)
-    }
-}
-
-
@propertyWrapper
-struct Wrapper<Value> {
-    let wrappedValue: Value
-    var projectedValue: [Value] {
-        [self.wrappedValue]
-    }
-}
-struct A {
-    @Wrapper var p1: Int
-    func f1() {
-        ↓$p1
-        ↓_p1
-    }
-}
-func f1() {
-    A(p1: 10).$p1
-}
-
- -
-
- - -
-
- - - diff --git a/explicit_top_level_acl.html b/explicit_top_level_acl.html deleted file mode 100644 index 24075b336..000000000 --- a/explicit_top_level_acl.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - explicit_top_level_acl Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Top Level ACL

- -

Top-level declarations should specify Access Control Level keywords explicitly

- -
    -
  • Identifier: explicit_top_level_acl
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
internal enum A {}
-
-
public final class B {}
-
-
private struct C {}
-
-
internal enum A { enum B {} }
-
-
internal final class Foo {}
-
-
internal
-class Foo {}
-
-
internal func a() {}
-
-
extension A: Equatable {}
-
-
extension A {}
-
-

Triggering Examples

-
↓enum A {}
-
-
final ↓class B {}
-
-
↓struct C {}
-
-
↓func a() {}
-
-
internal let a = 0
-↓func b() {}
-
- -
-
- - -
-
- - - diff --git a/explicit_type_interface.html b/explicit_type_interface.html deleted file mode 100644 index 0edb5fcbd..000000000 --- a/explicit_type_interface.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - explicit_type_interface Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Explicit Type Interface

- -

Properties should have a type interface

- -
    -
  • Identifier: explicit_type_interface
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -allow_redundancy - -false -
  • -
-

Non Triggering Examples

-
class Foo {
-  var myVar: Int? = 0
-}
-
-
class Foo {
-  let myVar: Int? = 0, s: String = ""
-}
-
-
class Foo {
-  static var myVar: Int? = 0
-}
-
-
class Foo {
-  class var myVar: Int? = 0
-}
-
-

Triggering Examples

-
class Foo {
-  var ↓myVar = 0
-}
-
-
class Foo {
-  let ↓mylet = 0
-}
-
-
class Foo {
-  static var ↓myStaticVar = 0
-}
-
-
class Foo {
-  class var ↓myClassVar = 0
-}
-
-
class Foo {
-  let ↓myVar = Int(0), ↓s = ""
-}
-
-
class Foo {
-  let ↓myVar = Set<Int>(0)
-}
-
- -
-
- - -
-
- - - diff --git a/extension_access_modifier.html b/extension_access_modifier.html deleted file mode 100644 index 94a1bad6e..000000000 --- a/extension_access_modifier.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - extension_access_modifier Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Extension Access Modifier

- -

Prefer to use extension access modifiers

- -
    -
  • Identifier: extension_access_modifier
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension Foo: SomeProtocol {
-  public var bar: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  public var baz: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  public func baz() {}
-}
-
-
extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
extension Foo {
-  var bar: Int { return 1 }
-  internal var baz: Int { return 1 }
-}
-
-
internal extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  var bar: Int { return 1 }
-  internal var baz: Int { return 1 }
-}
-
-
extension Foo {
-  private var bar: Int { return 1 }
-  private var baz: Int { return 1 }
-}
-
-
extension Foo {
-  open var bar: Int { return 1 }
-  open var baz: Int { return 1 }
-}
-
-
extension Foo {
-    func setup() {}
-    public func update() {}
-}
-
-
private extension Foo {
-  private var bar: Int { return 1 }
-  var baz: Int { return 1 }
-}
-
-
extension Foo {
-  internal private(set) var bar: Int {
-    get { Foo.shared.bar }
-    set { Foo.shared.bar = newValue }
-  }
-}
-
-
extension Foo {
-  private(set) internal var bar: Int {
-    get { Foo.shared.bar }
-    set { Foo.shared.bar = newValue }
-  }
-}
-
-

Triggering Examples

-
↓extension Foo {
-   public var bar: Int { return 1 }
-   public var baz: Int { return 1 }
-}
-
-
↓extension Foo {
-   public var bar: Int { return 1 }
-   public func baz() {}
-}
-
-
public extension Foo {
-  ↓public func bar() {}
-  ↓public func baz() {}
-}
-
-
↓extension Foo {
-   public var bar: Int {
-      let value = 1
-      return value
-   }
-
-   public var baz: Int { return 1 }
-}
-
-
↓extension Array where Element: Equatable {
-    public var unique: [Element] {
-        var uniqueValues = [Element]()
-        for item in self where !uniqueValues.contains(item) {
-            uniqueValues.append(item)
-        }
-        return uniqueValues
-    }
-}
-
-
↓extension Foo {
-   #if DEBUG
-   public var bar: Int {
-      let value = 1
-      return value
-   }
-   #endif
-
-   public var baz: Int { return 1 }
-}
-
-
public extension Foo {
-  ↓private func bar() {}
-  ↓private func baz() {}
-}
-
- -
-
- - -
-
- - - diff --git a/fallthrough.html b/fallthrough.html deleted file mode 100644 index a600f842f..000000000 --- a/fallthrough.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - fallthrough Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Fallthrough

- -

Fallthrough should be avoided

- -
    -
  • Identifier: fallthrough
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar, .bar2, .bar3:
-  something()
-}
-
-

Triggering Examples

-
switch foo {
-case .bar:
-  ↓fallthrough
-case .bar2:
-  something()
-}
-
- -
-
- - -
-
- - - diff --git a/fatal_error_message.html b/fatal_error_message.html deleted file mode 100644 index 12500249b..000000000 --- a/fatal_error_message.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - fatal_error_message Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Fatal Error Message

- -

A fatalError call should have a message

- -
    -
  • Identifier: fatal_error_message
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-  fatalError("Foo")
-}
-
-
func foo() {
-  fatalError(x)
-}
-
-

Triggering Examples

-
func foo() {
-  ↓fatalError("")
-}
-
-
func foo() {
-  ↓fatalError()
-}
-
- -
-
- - -
-
- - - diff --git a/file_header.html b/file_header.html deleted file mode 100644 index 5017dc6ef..000000000 --- a/file_header.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - file_header Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Header

- -

Header comments should be consistent with project patterns. The SWIFTLINT_CURRENT_FILENAME placeholder can optionally be used in the required and forbidden patterns. It will be replaced by the real file name.

- -
    -
  • Identifier: file_header
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = "Copyright"
-
-
let foo = 2 // Copyright
-
-
let foo = 2
- // Copyright
-
-

Triggering Examples

-
// ↓Copyright
-
-
//
-// ↓Copyright
-
-
//
-//  FileHeaderRule.swift
-//  SwiftLint
-//
-//  Created by Marcelo Fabri on 27/11/16.
-//  ↓Copyright © 2016 Realm. All rights reserved.
-//
-
- -
-
- - -
-
- - - diff --git a/file_length.html b/file_length.html deleted file mode 100644 index 87bf20e55..000000000 --- a/file_length.html +++ /dev/null @@ -1,2017 +0,0 @@ - - - - file_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Length

- -

Files should not span too many lines.

- -
    -
  • Identifier: file_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -400 -
    -error - -1000 -
    -ignore_comment_only_lines - -false -
  • -
-

Non Triggering Examples

-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-
-
-

Triggering Examples

-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-
-
-
print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-print("swiftlint")
-//
-
-
-
print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-print("swiftlint")
-
-
-
- -
-
- - -
-
- - - diff --git a/file_name.html b/file_name.html deleted file mode 100644 index b5aa3d9e4..000000000 --- a/file_name.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - file_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Name

- -

File name should match a type or extension declared in the file (if any)

- -
    -
  • Identifier: file_name
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[“LinuxMain.swift”, “main.swift”] -
    -prefix_pattern - -“” -
    -suffix_pattern - -“+.*” -
    -nested_type_separator - -“.” -
  • -
- -
-
- - -
-
- - - diff --git a/file_name_no_space.html b/file_name_no_space.html deleted file mode 100644 index a67f662e2..000000000 --- a/file_name_no_space.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - file_name_no_space Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Name no Space

- -

File name should not contain any whitespace

- -
    -
  • Identifier: file_name_no_space
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
  • -
- -
-
- - -
-
- - - diff --git a/file_types_order.html b/file_types_order.html deleted file mode 100644 index 55c8ca5f8..000000000 --- a/file_types_order.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - file_types_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

File Types Order

- -

Specifies how the types within a file should be ordered.

- -
    -
  • Identifier: file_types_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -[[supporting_type], [main_type], [extension], [preview_provider], [library_content_provider]] -
  • -
-

Non Triggering Examples

-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-// Main Type
-class TestViewController: UIViewController {
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-
-    struct TestStruct {
-        // 3 lines
-    }
-
-    enum TestEnum {
-        // 5 lines
-    }
-
-    // Stored Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-
-    // Stored Instance Properties
-    var shouldLayoutView1: Bool!
-    weak var delegate: TestViewControllerDelegate?
-    private var hasLayoutedView1: Bool = false
-    private var hasLayoutedView2: Bool = false
-
-    // Computed Instance Properties
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-
-    // Initializers
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-
-    // Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-    }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    @objc
-    func goToRandomVcButtonPressed() {
-        goToRandomVc()
-    }
-
-    // MARK: Other Methods
-    func goToNextVc() { /* TODO */ }
-
-    func goToInfoVc() { /* TODO */ }
-
-    func goToRandomVc() {
-        let viewCtrl = getRandomVc()
-        present(viewCtrl, animated: true)
-    }
-
-    private func getRandomVc() -> UIViewController { return UIViewController() }
-
-    // Subscripts
-    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-}
-
-// Extensions
-extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-
// Only extensions
-extension Foo {}
-extension Bar {
-}
-
-
// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
-// Preview Provider
-struct ContentView_Previews: PreviewProvider {
-    static var previews: some View { ContentView() }
-}
-
-// Library Content Provider
-struct ContentView_LibraryContent: LibraryContentProvider {
-    var views: [LibraryItem] {
-        LibraryItem(ContentView())
-    }
-}
-
-

Triggering Examples

-
↓class TestViewController: UIViewController {}
-
-// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-
// Extensions
-↓extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-class TestViewController: UIViewController {}
-
-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-↓class TestViewController: UIViewController {}
-
-// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-
// Supporting Types
-protocol TestViewControllerDelegate {
-    func didPressTrackedButton()
-}
-
-// Extensions
-↓extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-class TestViewController: UIViewController {}
-
-// Extensions
-extension TestViewController: UITableViewDataSource {
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-}
-
-
// Preview Provider
-↓struct ContentView_Previews: PreviewProvider {
-    static var previews: some View { ContentView() }
-}
-
-// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
-
// Library Content Provider
-↓struct ContentView_LibraryContent: LibraryContentProvider {
-    var views: [LibraryItem] {
-        LibraryItem(ContentView())
-    }
-}
-
-// Main Type
-struct ContentView: View {
-    var body: some View {
-        Text("Hello, World!")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/final_test_case.html b/final_test_case.html deleted file mode 100644 index f012e4396..000000000 --- a/final_test_case.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - final_test_case Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Final Test Case

- -

Test cases should be final

- -
    -
  • Identifier: final_test_case
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
final class Test: XCTestCase {}
-
-
open class Test: XCTestCase {}
-
-
public final class Test: QuickSpec {}
-
-
class Test: MyTestCase {}
-
-
struct Test: MyTestCase {}
-
-

Triggering Examples

-
class ↓Test: XCTestCase {}
-
-
public class ↓Test: QuickSpec {}
-
-
class ↓Test: MyTestCase {}
-
- -
-
- - -
-
- - - diff --git a/first_where.html b/first_where.html deleted file mode 100644 index 636a2dfc1..000000000 --- a/first_where.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - first_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

First Where

- -

Prefer using .first(where:) over .filter { }.first in collections

- -
    -
  • Identifier: first_where
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
kinds.filter(excludingKinds.contains).isEmpty && kinds.first == .identifier
-
-
myList.first(where: { $0 % 2 == 0 })
-
-
match(pattern: pattern).filter { $0.first == .identifier }
-
-
(myList.filter { $0 == 1 }.suffix(2)).first
-
-
collection.filter("stringCol = '3'").first
-
-
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first
-
-
if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) }
-
-

Triggering Examples

-
↓myList.filter { $0 % 2 == 0 }.first
-
-
↓myList.filter({ $0 % 2 == 0 }).first
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first?.something()
-
-
↓myList.filter(someFunction).first
-
-
↓myList.filter({ $0 % 2 == 0 })
-.first
-
-
(↓myList.filter { $0 == 1 }).first
-
-
↓myListOfDict.filter { dict in dict["1"] }.first
-
-
↓myListOfDict.filter { $0["someString"] }.first
-
- -
-
- - -
-
- - - diff --git a/flatmap_over_map_reduce.html b/flatmap_over_map_reduce.html deleted file mode 100644 index 3ef3ffd48..000000000 --- a/flatmap_over_map_reduce.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - flatmap_over_map_reduce Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Flat Map over Map Reduce

- -

Prefer flatMap over map followed by reduce([], +)

- -
    -
  • Identifier: flatmap_over_map_reduce
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = bar.map { $0.count }.reduce(0, +)
-
-
let foo = bar.flatMap { $0.array }
-
-

Triggering Examples

-
let foo = ↓bar.map { $0.array }.reduce([], +)
-
- -
-
- - -
-
- - - diff --git a/for_where.html b/for_where.html deleted file mode 100644 index 9d476a34f..000000000 --- a/for_where.html +++ /dev/null @@ -1,475 +0,0 @@ - - - - for_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer For-Where

- -

where clauses are preferred over a single if inside a for

- -
    -
  • Identifier: for_where
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_for_as_filter - -false -
  • -
-

Non Triggering Examples

-
for user in users where user.id == 1 { }
-
-
for user in users {
-  if let id = user.id { }
-}
-
-
for user in users {
-  if var id = user.id { }
-}
-
-
for user in users {
-  if user.id == 1 { } else { }
-}
-
-
for user in users {
-  if user.id == 1 {
-  } else if user.id == 2 { }
-}
-
-
for user in users {
-  if user.id == 1 { }
-  print(user)
-}
-
-
for user in users {
-  let id = user.id
-  if id == 1 { }
-}
-
-
for user in users {
-  if user.id == 1 { }
-  return true
-}
-
-
for user in users {
-  if user.id == 1 && user.age > 18 { }
-}
-
-
for user in users {
-  if user.id == 1, user.age > 18 { }
-}
-
-
for (index, value) in array.enumerated() {
-  if case .valueB(_) = value {
-    return index
-  }
-}
-
-
for user in users {
-  if user.id == 1 { return true }
-}
-
-
for user in users {
-  if user.id == 1 {
-    let derivedValue = calculateValue(from: user)
-    return derivedValue != 0
-  }
-}
-
-

Triggering Examples

-
for user in users {
-  ↓if user.id == 1 { return true }
-}
-
-
for subview in subviews {
-    ↓if !(subview is UIStackView) {
-        subview.removeConstraints(subview.constraints)
-        subview.removeFromSuperview()
-    }
-}
-
-
for subview in subviews {
-    ↓if !(subview is UIStackView) {
-        subview.removeConstraints(subview.constraints)
-        subview.removeFromSuperview()
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/force_cast.html b/force_cast.html deleted file mode 100644 index 57e65b943..000000000 --- a/force_cast.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - force_cast Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Cast

- -

Force casts should be avoided

- -
    -
  • Identifier: force_cast
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
NSNumber() as? Int
-
-

Triggering Examples

-
NSNumber() ↓as! Int
-
- -
-
- - -
-
- - - diff --git a/force_try.html b/force_try.html deleted file mode 100644 index 042b3949a..000000000 --- a/force_try.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - force_try Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Try

- -

Force tries should be avoided

- -
    -
  • Identifier: force_try
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
func a() throws {}
-do {
-  try a()
-} catch {}
-
-

Triggering Examples

-
func a() throws {}
-↓try! a()
-
- -
-
- - -
-
- - - diff --git a/force_unwrapping.html b/force_unwrapping.html deleted file mode 100644 index 18b52a46c..000000000 --- a/force_unwrapping.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - force_unwrapping Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Force Unwrapping

- -

Force unwrapping should be avoided

- -
    -
  • Identifier: force_unwrapping
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if let url = NSURL(string: query)
-
-
navigationController?.pushViewController(viewController, animated: true)
-
-
let s as! Test
-
-
try! canThrowErrors()
-
-
let object: Any!
-
-
@IBOutlet var constraints: [NSLayoutConstraint]!
-
-
setEditing(!editing, animated: true)
-
-
navigationController.setNavigationBarHidden(!navigationController.navigationBarHidden, animated: true)
-
-
if addedToPlaylist && (!self.selectedFilters.isEmpty || self.searchBar?.text?.isEmpty == false) {}
-
-
print("\(xVar)!")
-
-
var test = (!bar)
-
-
var a: [Int]!
-
-
private var myProperty: (Void -> Void)!
-
-
func foo(_ options: [AnyHashable: Any]!) {
-
-
func foo() -> [Int]!
-
-
func foo() -> [AnyHashable: Any]!
-
-
func foo() -> [Int]! { return [] }
-
-
return self
-
-

Triggering Examples

-
let url = NSURL(string: query)↓!
-
-
navigationController↓!.pushViewController(viewController, animated: true)
-
-
let unwrapped = optional↓!
-
-
return cell↓!
-
-
let url = NSURL(string: "http://www.google.com")↓!
-
-
let dict = ["Boooo": "👻"]
-func bla() -> String {
-    return dict["Boooo"]↓!
-}
-
-
let dict = ["Boooo": "👻"]
-func bla() -> String {
-    return dict["Boooo"]↓!.contains("B")
-}
-
-
let a = dict["abc"]↓!.contains("B")
-
-
dict["abc"]↓!.bar("B")
-
-
if dict["a"]↓!↓!↓!↓! {}
-
-
var foo: [Bool]! = dict["abc"]↓!
-
-
realm.objects(SwiftUTF8Object.self).filter("%K == %@", "柱нǢкƱаم👍", utf8TestString).first↓!
-
-
context("abc") {
-  var foo: [Bool]! = dict["abc"]↓!
-}
-
-
open var computed: String { return foo.bar↓! }
-
-
return self↓!
-
-
[1, 3, 5, 6].first { $0.isMultiple(of: 2) }↓!
-
-
map["a"]↓!↓!
-
- -
-
- - -
-
- - - diff --git a/function_body_length.html b/function_body_length.html deleted file mode 100644 index 3811b8404..000000000 --- a/function_body_length.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - function_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Body Length

- -

Function bodies should not span too many lines

- -
    -
  • Identifier: function_body_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -50 -
    -error - -100 -
  • -
- -
-
- - -
-
- - - diff --git a/function_default_parameter_at_end.html b/function_default_parameter_at_end.html deleted file mode 100644 index be946c809..000000000 --- a/function_default_parameter_at_end.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - function_default_parameter_at_end Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Default Parameter at End

- -

Prefer to locate parameters with defaults toward the end of the parameter list

- -
    -
  • Identifier: function_default_parameter_at_end
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo(baz: String, bar: Int = 0) {}
-
-
func foo(x: String, y: Int = 0, z: CGFloat = 0) {}
-
-
func foo(bar: String, baz: Int = 0, z: () -> Void) {}
-
-
func foo(bar: String, z: () -> Void, baz: Int = 0) {}
-
-
func foo(bar: Int = 0) {}
-
-
func foo() {}
-
-
class A: B {
-  override func foo(bar: Int = 0, baz: String) {}
-
-
func foo(bar: Int = 0, completion: @escaping CompletionHandler) {}
-
-
func foo(a: Int, b: CGFloat = 0) {
-  let block = { (error: Error?) in }
-}
-
-
func foo(a: String, b: String? = nil,
-         c: String? = nil, d: @escaping AlertActionHandler = { _ in }) {}
-
-
override init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
-
-
func handleNotification(_ userInfo: NSDictionary,
-                        userInteraction: Bool = false,
-                        completionHandler: ((UIBackgroundFetchResult) -> Void)?) {}
-
-
func write(withoutNotifying tokens: [NotificationToken] =  {}, _ block: (() throws -> Int)) {}
-
-

Triggering Examples

-
↓func foo(bar: Int = 0, baz: String) {}
-
-
private ↓func foo(bar: Int = 0, baz: String) {}
-
-
public ↓init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
-
- -
-
- - -
-
- - - diff --git a/function_parameter_count.html b/function_parameter_count.html deleted file mode 100644 index 363ad2c03..000000000 --- a/function_parameter_count.html +++ /dev/null @@ -1,437 +0,0 @@ - - - - function_parameter_count Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Function Parameter Count

- -

Number of function parameters should be low.

- -
    -
  • Identifier: function_parameter_count
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -5 -
    -error - -8 -
    -ignores_default_parameters - -true -
  • -
-

Non Triggering Examples

-
init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init (a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
`init`(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?<T>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
init?<T: String>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
func f2(p1: Int, p2: Int) { }
-
-
func f(a: Int, b: Int, c: Int, d: Int, x: Int = 42) {}
-
-
func f(a: [Int], b: Int, c: Int, d: Int, f: Int) -> [Int] {
-    let s = a.flatMap { $0 as? [String: Int] } ?? []}}
-
-
override func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-

Triggering Examples

-
↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
↓func initialValue(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-
-
private ↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int = 2, g: Int) {}
-
-
struct Foo {
-    init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
-    ↓func bar(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}}
-
- -
-
- - -
-
- - - diff --git a/generic_type_name.html b/generic_type_name.html deleted file mode 100644 index bec7a2756..000000000 --- a/generic_type_name.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - generic_type_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Generic Type Name

- -

Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length.

- -
    -
  • Identifier: generic_type_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -1 -
    -error - -0 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -20 -
    -error - -1000 -
    -
    -excluded - -[] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
  • -
-

Non Triggering Examples

-
func foo<T>() {}
-
-
func foo<T>() -> T {}
-
-
func foo<T, U>(param: U) -> T {}
-
-
func foo<T: Hashable, U: Rule>(param: U) -> T {}
-
-
struct Foo<T> {}
-
-
class Foo<T> {}
-
-
enum Foo<T> {}
-
-
func run(_ options: NoOptions<CommandantError<()>>) {}
-
-
func foo(_ options: Set<type>) {}
-
-
func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool
-
-
func configureWith(data: Either<MessageThread, (project: Project, backing: Backing)>)
-
-
typealias StringDictionary<T> = Dictionary<String, T>
-
-
typealias BackwardTriple<T1, T2, T3> = (T3, T2, T1)
-
-
typealias DictionaryOfStrings<T : Hashable> = Dictionary<T, String>
-
-

Triggering Examples

-
func foo<↓T_Foo>() {}
-
-
func foo<T, ↓U_Foo>(param: U_Foo) -> T {}
-
-
func foo<↓TTTTTTTTTTTTTTTTTTTTT>() {}
-
-
func foo<↓type>() {}
-
-
typealias StringDictionary<↓T_Foo> = Dictionary<String, T_Foo>
-
-
typealias BackwardTriple<T1, ↓T2_Bar, T3> = (T3, T2_Bar, T1)
-
-
typealias DictionaryOfStrings<↓T_Foo: Hashable> = Dictionary<T_Foo, String>
-
-
class Foo<↓T_Foo> {}
-
-
class Foo<T, ↓U_Foo> {}
-
-
class Foo<↓T_Foo, ↓U_Foo> {}
-
-
class Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
class Foo<↓type> {}
-
-
struct Foo<↓T_Foo> {}
-
-
struct Foo<T, ↓U_Foo> {}
-
-
struct Foo<↓T_Foo, ↓U_Foo> {}
-
-
struct Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
struct Foo<↓type> {}
-
-
enum Foo<↓T_Foo> {}
-
-
enum Foo<T, ↓U_Foo> {}
-
-
enum Foo<↓T_Foo, ↓U_Foo> {}
-
-
enum Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
-
-
enum Foo<↓type> {}
-
- -
-
- - -
-
- - - diff --git a/ibinspectable_in_extension.html b/ibinspectable_in_extension.html deleted file mode 100644 index 60322b25c..000000000 --- a/ibinspectable_in_extension.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - ibinspectable_in_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

IBInspectable in Extension

- -

Extensions shouldn’t add @IBInspectable properties

- -
    -
  • Identifier: ibinspectable_in_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  @IBInspectable private var x: Int
-}
-
-

Triggering Examples

-
extension Foo {
-  ↓@IBInspectable private var x: Int
-}
-
- -
-
- - -
-
- - - diff --git a/identical_operands.html b/identical_operands.html deleted file mode 100644 index 593d97b9d..000000000 --- a/identical_operands.html +++ /dev/null @@ -1,876 +0,0 @@ - - - - identical_operands Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Identical Operands

- -

Comparing two identical operands is likely a mistake

- -
    -
  • Identifier: identical_operands
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
1 == 2
-
-
foo == bar
-
-
prefixedFoo == foo
-
-
foo.aProperty == foo.anotherProperty
-
-
self.aProperty == self.anotherProperty
-
-
"1 == 1"
-
-
self.aProperty == aProperty
-
-
lhs.aProperty == rhs.aProperty
-
-
lhs.identifier == rhs.identifier
-
-
i == index
-
-
$0 == 0
-
-
keyValues?.count ?? 0 == 0
-
-
string == string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num == num?.byteSwapped
-
-
num == num!.byteSwapped
-
-
1    + 1 ==   1     +    2
-
-
f(  i :   2) ==   f (i: 3 )
-
-
1 != 2
-
-
foo != bar
-
-
prefixedFoo != foo
-
-
foo.aProperty != foo.anotherProperty
-
-
self.aProperty != self.anotherProperty
-
-
"1 != 1"
-
-
self.aProperty != aProperty
-
-
lhs.aProperty != rhs.aProperty
-
-
lhs.identifier != rhs.identifier
-
-
i != index
-
-
$0 != 0
-
-
keyValues?.count ?? 0 != 0
-
-
string != string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num != num?.byteSwapped
-
-
num != num!.byteSwapped
-
-
1    + 1 !=   1     +    2
-
-
f(  i :   2) !=   f (i: 3 )
-
-
1 === 2
-
-
foo === bar
-
-
prefixedFoo === foo
-
-
foo.aProperty === foo.anotherProperty
-
-
self.aProperty === self.anotherProperty
-
-
"1 === 1"
-
-
self.aProperty === aProperty
-
-
lhs.aProperty === rhs.aProperty
-
-
lhs.identifier === rhs.identifier
-
-
i === index
-
-
$0 === 0
-
-
keyValues?.count ?? 0 === 0
-
-
string === string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num === num?.byteSwapped
-
-
num === num!.byteSwapped
-
-
1    + 1 ===   1     +    2
-
-
f(  i :   2) ===   f (i: 3 )
-
-
1 !== 2
-
-
foo !== bar
-
-
prefixedFoo !== foo
-
-
foo.aProperty !== foo.anotherProperty
-
-
self.aProperty !== self.anotherProperty
-
-
"1 !== 1"
-
-
self.aProperty !== aProperty
-
-
lhs.aProperty !== rhs.aProperty
-
-
lhs.identifier !== rhs.identifier
-
-
i !== index
-
-
$0 !== 0
-
-
keyValues?.count ?? 0 !== 0
-
-
string !== string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num !== num?.byteSwapped
-
-
num !== num!.byteSwapped
-
-
1    + 1 !==   1     +    2
-
-
f(  i :   2) !==   f (i: 3 )
-
-
1 > 2
-
-
foo > bar
-
-
prefixedFoo > foo
-
-
foo.aProperty > foo.anotherProperty
-
-
self.aProperty > self.anotherProperty
-
-
"1 > 1"
-
-
self.aProperty > aProperty
-
-
lhs.aProperty > rhs.aProperty
-
-
lhs.identifier > rhs.identifier
-
-
i > index
-
-
$0 > 0
-
-
keyValues?.count ?? 0 > 0
-
-
string > string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num > num?.byteSwapped
-
-
num > num!.byteSwapped
-
-
1    + 1 >   1     +    2
-
-
f(  i :   2) >   f (i: 3 )
-
-
1 >= 2
-
-
foo >= bar
-
-
prefixedFoo >= foo
-
-
foo.aProperty >= foo.anotherProperty
-
-
self.aProperty >= self.anotherProperty
-
-
"1 >= 1"
-
-
self.aProperty >= aProperty
-
-
lhs.aProperty >= rhs.aProperty
-
-
lhs.identifier >= rhs.identifier
-
-
i >= index
-
-
$0 >= 0
-
-
keyValues?.count ?? 0 >= 0
-
-
string >= string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num >= num?.byteSwapped
-
-
num >= num!.byteSwapped
-
-
1    + 1 >=   1     +    2
-
-
f(  i :   2) >=   f (i: 3 )
-
-
1 < 2
-
-
foo < bar
-
-
prefixedFoo < foo
-
-
foo.aProperty < foo.anotherProperty
-
-
self.aProperty < self.anotherProperty
-
-
"1 < 1"
-
-
self.aProperty < aProperty
-
-
lhs.aProperty < rhs.aProperty
-
-
lhs.identifier < rhs.identifier
-
-
i < index
-
-
$0 < 0
-
-
keyValues?.count ?? 0 < 0
-
-
string < string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num < num?.byteSwapped
-
-
num < num!.byteSwapped
-
-
1    + 1 <   1     +    2
-
-
f(  i :   2) <   f (i: 3 )
-
-
1 <= 2
-
-
foo <= bar
-
-
prefixedFoo <= foo
-
-
foo.aProperty <= foo.anotherProperty
-
-
self.aProperty <= self.anotherProperty
-
-
"1 <= 1"
-
-
self.aProperty <= aProperty
-
-
lhs.aProperty <= rhs.aProperty
-
-
lhs.identifier <= rhs.identifier
-
-
i <= index
-
-
$0 <= 0
-
-
keyValues?.count ?? 0 <= 0
-
-
string <= string.lowercased()
-
-
let num: Int? = 0
-_ = num != nil && num <= num?.byteSwapped
-
-
num <= num!.byteSwapped
-
-
1    + 1 <=   1     +    2
-
-
f(  i :   2) <=   f (i: 3 )
-
-
func evaluate(_ mode: CommandMode) -> Result<Options, CommandantError<CommandantError<()>>>
-
-
let array = Array<Array<Int>>()
-
-
guard Set(identifiers).count != identifiers.count else { return }
-
-
expect("foo") == "foo"
-
-
type(of: model).cachePrefix == cachePrefix
-
-
histogram[156].0 == 0x003B8D96 && histogram[156].1 == 1
-
-
[Wrapper(type: .three), Wrapper(type: .one)].sorted { "\($0.type)" > "\($1.type)"}
-
-
array.sorted { "\($0)" < "\($1)" }
-
-

Triggering Examples

-
↓1 == 1
-
-
↓foo == foo
-
-
↓foo.aProperty == foo.aProperty
-
-
↓self.aProperty == self.aProperty
-
-
↓$0 == $0
-
-
↓a?.b == a?.b
-
-
if (↓elem == elem) {}
-
-
XCTAssertTrue(↓s3 == s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView == tab.webView
-
-
↓1    + 1 ==   1     +    1
-
-
 ↓f(  i :   2) ==   f (i: 
- 2 )
-
-
↓1 != 1
-
-
↓foo != foo
-
-
↓foo.aProperty != foo.aProperty
-
-
↓self.aProperty != self.aProperty
-
-
↓$0 != $0
-
-
↓a?.b != a?.b
-
-
if (↓elem != elem) {}
-
-
XCTAssertTrue(↓s3 != s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView != tab.webView
-
-
↓1    + 1 !=   1     +    1
-
-
 ↓f(  i :   2) !=   f (i: 
- 2 )
-
-
↓1 === 1
-
-
↓foo === foo
-
-
↓foo.aProperty === foo.aProperty
-
-
↓self.aProperty === self.aProperty
-
-
↓$0 === $0
-
-
↓a?.b === a?.b
-
-
if (↓elem === elem) {}
-
-
XCTAssertTrue(↓s3 === s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView === tab.webView
-
-
↓1    + 1 ===   1     +    1
-
-
 ↓f(  i :   2) ===   f (i: 
- 2 )
-
-
↓1 !== 1
-
-
↓foo !== foo
-
-
↓foo.aProperty !== foo.aProperty
-
-
↓self.aProperty !== self.aProperty
-
-
↓$0 !== $0
-
-
↓a?.b !== a?.b
-
-
if (↓elem !== elem) {}
-
-
XCTAssertTrue(↓s3 !== s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView !== tab.webView
-
-
↓1    + 1 !==   1     +    1
-
-
 ↓f(  i :   2) !==   f (i: 
- 2 )
-
-
↓1 > 1
-
-
↓foo > foo
-
-
↓foo.aProperty > foo.aProperty
-
-
↓self.aProperty > self.aProperty
-
-
↓$0 > $0
-
-
↓a?.b > a?.b
-
-
if (↓elem > elem) {}
-
-
XCTAssertTrue(↓s3 > s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView > tab.webView
-
-
↓1    + 1 >   1     +    1
-
-
 ↓f(  i :   2) >   f (i: 
- 2 )
-
-
↓1 >= 1
-
-
↓foo >= foo
-
-
↓foo.aProperty >= foo.aProperty
-
-
↓self.aProperty >= self.aProperty
-
-
↓$0 >= $0
-
-
↓a?.b >= a?.b
-
-
if (↓elem >= elem) {}
-
-
XCTAssertTrue(↓s3 >= s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView >= tab.webView
-
-
↓1    + 1 >=   1     +    1
-
-
 ↓f(  i :   2) >=   f (i: 
- 2 )
-
-
↓1 < 1
-
-
↓foo < foo
-
-
↓foo.aProperty < foo.aProperty
-
-
↓self.aProperty < self.aProperty
-
-
↓$0 < $0
-
-
↓a?.b < a?.b
-
-
if (↓elem < elem) {}
-
-
XCTAssertTrue(↓s3 < s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView < tab.webView
-
-
↓1    + 1 <   1     +    1
-
-
 ↓f(  i :   2) <   f (i: 
- 2 )
-
-
↓1 <= 1
-
-
↓foo <= foo
-
-
↓foo.aProperty <= foo.aProperty
-
-
↓self.aProperty <= self.aProperty
-
-
↓$0 <= $0
-
-
↓a?.b <= a?.b
-
-
if (↓elem <= elem) {}
-
-
XCTAssertTrue(↓s3 <= s3)
-
-
if let tab = tabManager.selectedTab, ↓tab.webView <= tab.webView
-
-
↓1    + 1 <=   1     +    1
-
-
 ↓f(  i :   2) <=   f (i: 
- 2 )
-
-
    return ↓lhs.foo == lhs.foo &&
-           lhs.bar == rhs.bar
-
-
    return lhs.foo == rhs.foo &&
-           ↓lhs.bar == lhs.bar
-
- -
-
- - -
-
- - - diff --git a/identifier_name.html b/identifier_name.html deleted file mode 100644 index fb27054fd..000000000 --- a/identifier_name.html +++ /dev/null @@ -1,595 +0,0 @@ - - - - identifier_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Identifier Name

- -

Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared as static. Variable names should not be too long or too short.

- -
    -
  • Identifier: identifier_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -3 -
    -error - -2 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -40 -
    -error - -60 -
    -
    -excluded - -[“^id$”] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
    -additional_operators - -[“!”, “%”, “&”, “*”, “+”, “-”, “.”, “/”, “<”, “=”, “>”, “?”, “^”, “|”, “~”] -
  • -
-

Non Triggering Examples

-
let myLet = 0
-
-
var myVar = 0
-
-
private let _myLet = 0
-
-
private func _myFunc() {}
-
-
fileprivate let _myLet = 0
-
-
fileprivate func _myFunc() {}
-
-
fileprivate func _myFunc() {}
-
-
class Abc { static let MyLet = 0 }
-
-
let URL: NSURL? = nil
-
-
let XMLString: String? = nil
-
-
override var i = 0
-
-
enum Foo { case myEnum }
-
-
func isOperator(name: String) -> Bool
-
-
func typeForKind(_ kind: SwiftDeclarationKind) -> String
-
-
func == (lhs: SyntaxToken, rhs: SyntaxToken) -> Bool
-
-
override func IsOperator(name: String) -> Bool
-
-
enum Foo { case `private` }
-
-
enum Foo { case value(String) }
-
-
f { $abc in }
-
-
class Foo {
-   static let Bar = 0
-}
-
-
class Foo {
-   static var Bar = 0
-}
-
-
func √ (arg: Double) -> Double { arg }
-
-

Triggering Examples

-
class C { static let ↓_myLet = 0 }
-
-
class C { class let ↓MyLet = 0 }
-
-
class C { static func ↓MyFunc() {} }
-
-
class C { class func ↓MyFunc() {} }
-
-
private let ↓myLet_ = 0
-
-
let ↓myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
-
-
var ↓myExtremelyVeryVeryVeryVeryVeryVeryLongVar = 0
-
-
private let ↓_myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
-
-
let ↓i = 0
-
-
var ↓aa = 0
-
-
private let ↓_i = 0
-
-
if let ↓_x {}
-
-
guard var ↓x = x else {}
-
-
func myFunc(
-    _ ↓s: String,
-    i ↓j: Int,
-    _ goodName: Double,
-    name ↓n: String,
-    ↓x: Int,
-    abc: Double,
-    _: Double,
-    last _: Double
-) {}
-
-
let (↓a, abc) = (1, 1)
-
-
if let ↓i {}
-
-
for ↓i in [] {}
-
-
f { ↓x in }
-
-
f { ↓$x in }
-
-
f { (x abc: Int, _ ↓x: Int) in }
-
-
enum E {
-    case ↓c
-    case case1(Int)
-    case case2(↓a: Int)
-    case case3(_ ↓a: Int)
-}
-
-
class C {
-    var ↓x: Int {
-        get { 1 }
-        set(↓y) { x = y }
-    }
-}
-
-
func ↓√ (arg: Double) -> Double { arg }
-
- -
-
- - -
-
- - - diff --git a/img/carat.png b/img/carat.png deleted file mode 100755 index 29d2f7fd4..000000000 Binary files a/img/carat.png and /dev/null differ diff --git a/img/dash.png b/img/dash.png deleted file mode 100755 index 6f694c7a0..000000000 Binary files a/img/dash.png and /dev/null differ diff --git a/img/gh.png b/img/gh.png deleted file mode 100755 index 628da97c7..000000000 Binary files a/img/gh.png and /dev/null differ diff --git a/img/spinner.gif b/img/spinner.gif deleted file mode 100644 index e3038d0a4..000000000 Binary files a/img/spinner.gif and /dev/null differ diff --git a/implicit_getter.html b/implicit_getter.html deleted file mode 100644 index f46dbc2a9..000000000 --- a/implicit_getter.html +++ /dev/null @@ -1,617 +0,0 @@ - - - - implicit_getter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicit Getter

- -

Computed read-only properties and subscripts should avoid using the get keyword.

- -
    -
  • Identifier: implicit_getter
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        return 20
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        get { _foo }
-        _modify { yield &_foo }
-    }
-}
-
-
class Foo {
-    var _foo: Int
-    var foo: Int {
-        @storageRestrictions(initializes: _foo)
-        init { _foo = newValue }
-        get { _foo }
-    }
-}
-
-
class Foo {
-    var foo: Int
-}
-
-
class Foo {
-    var foo: Int {
-        return getValueFromDisk()
-    }
-}
-
-
class Foo {
-    var foo: String {
-        return "get"
-    }
-}
-
-
protocol Foo {
-    var foo: Int { get }
-}
-
-
protocol Foo {
-    var foo: Int { get set }
-}
-
-
class Foo {
-    var foo: Int {
-        struct Bar {
-            var bar: Int {
-                get { return 1 }
-                set { _ = newValue }
-            }
-        }
-
-        return Bar().bar
-    }
-}
-
-
var _objCTaggedPointerBits: UInt {
-    @inline(__always) get { return 0 }
-}
-
-
var next: Int? {
-    mutating get {
-        defer { self.count += 1 }
-        return self.count
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set { self._bar = newValue }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        get { _bar }
-        set(newValue) { self._bar = newValue }
-    }
-}
-
-
extension Float {
-    var clamped: Float {
-        set {
-            self = min(1, max(0, newValue))
-        }
-        get {
-            min(1, max(0, self))
-        }
-    }
-}
-
-
extension Reactive where Base: UITapGestureRecognizer {
-    var tapped: CocoaAction<Base>? {
-        get {
-            return associatedAction.withValue { $0.flatMap { $0.action } }
-        }
-        nonmutating set {
-            setAction(newValue)
-        }
-    }
-}
-
-
extension Test {
-    var foo: Bool {
-        get {
-            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
-        }
-        set {
-            bar = NSNumber(value: newValue as Bool)
-        }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        return 20
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        get { return 3 }
-        set { _abc = newValue }
-    }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get }
-}
-
-
protocol Foo {
-    subscript(i: Int) -> Int { get set }
-}
-
-
class DatabaseEntity {
-    var isSynced: Bool {
-        get async {
-            await database.isEntitySynced(self)
-        }
-    }
-}
-
-
struct Test {
-    subscript(value: Int) -> Int {
-        get throws {
-            if value == 0 {
-                throw NSError()
-            } else {
-                return value
-            }
-        }
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
class Foo {
-    var foo: Int {
-        ↓get{ return 20 }
-    }
-}
-
-
class Foo {
-    static var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
var foo: Int {
-    ↓get { return 20 }
-}
-
-
class Foo {
-    @objc func bar() {}
-    var foo: Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
-
extension Foo {
-    var bar: Bool {
-        ↓get { _bar }
-    }
-}
-
-
class Foo {
-    subscript(i: Int) -> Int {
-        ↓get {
-            return 20
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/implicit_return.html b/implicit_return.html deleted file mode 100644 index 98e505cf0..000000000 --- a/implicit_return.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - implicit_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicit Return

- -

Prefer implicit returns in closures, functions and getters

- -
    -
  • Identifier: implicit_return
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -included - -[closure, function, getter, initializer, subscript] -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.map({ $0 + 1 })
-
-
foo.map { value in value + 1 }
-
-
[1, 2].first(where: {
-    true
-})
-
-
func foo() -> Int {
-    0
-}
-
-
class Foo {
-    func foo() -> Int { 0 }
-}
-
-
func fetch() -> Data? {
-    do {
-        return try loadData()
-    } catch {
-        return nil
-    }
-}
-
-
func f() -> Int {
-    let i = 4
-    return i
-}
-
-
func f() -> Int {
-    return 3
-    let i = 2
-}
-
-
func f() -> Int {
-    return g()
-    func g() -> Int { 4 }
-}
-
-
var foo: Bool { true }
-
-
class Foo {
-    var bar: Int {
-        get {
-            0
-        }
-    }
-}
-
-
class Foo {
-    static var bar: Int {
-        0
-    }
-}
-
-
class C {
-    let i: Int
-    init(i: Int) {
-        if i < 3 {
-            self.i = 1
-            return
-        }
-        self.i = 2
-    }
-}
-
-
class C {
-    init?() {
-        let i = 1
-        return nil
-    }
-}
-
-
class C {
-    subscript(i: Int) -> Int {
-        let res = i
-        return res
-    }
-}
-
-

Triggering Examples

-
foo.map { value in
-    ↓return value + 1
-}
-
-
foo.map {
-    ↓return $0 + 1
-}
-
-
foo.map({ ↓return $0 + 1})
-
-
[1, 2].first(where: {
-    ↓return true
-})
-
-
func foo() -> Int {
-    ↓return 0
-}
-
-
class Foo {
-    func foo() -> Int { ↓return 0 }
-}
-
-
func f() { ↓return }
-
-
var foo: Bool { ↓return true }
-
-
class Foo {
-    var bar: Int {
-        get {
-            ↓return 0
-        }
-    }
-}
-
-
class Foo {
-    static var bar: Int {
-        ↓return 0
-    }
-}
-
-
class C {
-    init() {
-        ↓return
-    }
-}
-
-
class C {
-    init?() {
-        ↓return nil
-    }
-}
-
-
class C {
-    subscript(i: Int) -> Int {
-        ↓return i
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/implicitly_unwrapped_optional.html b/implicitly_unwrapped_optional.html deleted file mode 100644 index 4064d1c5b..000000000 --- a/implicitly_unwrapped_optional.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - implicitly_unwrapped_optional Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Implicitly Unwrapped Optional

- -

Implicitly unwrapped optionals should be avoided when possible

- -
    -
  • Identifier: implicitly_unwrapped_optional
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -mode - -all_except_iboutlets -
  • -
-

Non Triggering Examples

-
@IBOutlet private var label: UILabel!
-
-
@IBOutlet var label: UILabel!
-
-
@IBOutlet var label: [UILabel!]
-
-
if !boolean {}
-
-
let int: Int? = 42
-
-
let int: Int? = nil
-
-

Triggering Examples

-
let label: ↓UILabel!
-
-
let IBOutlet: ↓UILabel!
-
-
let labels: [↓UILabel!]
-
-
var ints: [↓Int!] = [42, nil, 42]
-
-
let label: ↓IBOutlet!
-
-
let int: ↓Int! = 42
-
-
let int: ↓Int! = nil
-
-
var int: ↓Int! = 42
-
-
let collection: AnyCollection<↓Int!>
-
-
func foo(int: ↓Int!) {}
-
-
class MyClass {
-    weak var bar: ↓SomeObject!
-}
-
- -
-
- - -
-
- - - diff --git a/inclusive_language.html b/inclusive_language.html deleted file mode 100644 index fd84e124e..000000000 --- a/inclusive_language.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - inclusive_language Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Inclusive Language

- -

Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status.

- -
    -
  • Identifier: inclusive_language
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = "abc"
-
-
enum AllowList {
-    case foo, bar
-}
-
-
func updateAllowList(add: String) {}
-
-
enum WalletItemType {
-    case visa
-    case mastercard
-}
-
-
func chargeMasterCard(_ card: Card) {}
-
-

Triggering Examples

-
let ↓slave = "abc"
-
-
enum ↓BlackList {
-    case foo, bar
-}
-
-
func ↓updateWhiteList(add: String) {}
-
-
enum ListType {
-    case ↓whitelist
-    case ↓blacklist
-}
-
-
init(↓master: String, ↓slave: String) {}
-
-
final class FooBar {
-    func register<↓Master, ↓Slave>(one: Master, two: Slave) {}
-}
-
- -
-
- - -
-
- - - diff --git a/indentation_width.html b/indentation_width.html deleted file mode 100644 index 20c8472f3..000000000 --- a/indentation_width.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - indentation_width Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Indentation Width

- -

Indent code using either one tab or the configured amount of spaces, unindent to match previous indentations. Don’t indent the first line.

- -
    -
  • Identifier: indentation_width
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -indentation_width - -4 -
    -include_comments - -true -
    -include_compiler_directives - -true -
    -include_multiline_strings - -true -
  • -
-

Non Triggering Examples

-
firstLine
-secondLine
-
-
firstLine
-    secondLine
-
-
firstLine
-    secondLine
-        thirdLine
-
-        fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-    //test
-        fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-fourthLine
-
-

Triggering Examples

-
↓    firstLine
-
-
firstLine
-        secondLine
-
-
firstLine
-    secondLine
-
-↓         fourthLine
-
-
firstLine
-    secondLine
-        thirdLine
-↓ fourthLine
-
- -
-
- - -
-
- - - diff --git a/index.html b/index.html deleted file mode 100644 index 4d0c1c7b8..000000000 --- a/index.html +++ /dev/null @@ -1,1149 +0,0 @@ - - - - SwiftLintCore Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

SwiftLint

- -

A tool to enforce Swift style and conventions, loosely based on the now archived GitHub Swift Style Guide. SwiftLint enforces the style guide rules that are generally accepted by the Swift community. These rules are well described in popular style guides like Kodeco’s Swift Style Guide.

- -

SwiftLint hooks into Clang and -SourceKit to use the -AST representation -of your source files for more accurate results.

- -

Build Status -codecov.io

- -

- -

This project adheres to the Contributor Covenant Code of Conduct. -By participating, you are expected to uphold this code. Please report -unacceptable behavior to info@realm.io.

- -
-

Language Switch: 中文, 한국어.

-
-

Installation

-

Using Swift Package Manager:

- -
-

Replace <version> with the desired minimum version.

-
-
.package(url: "https://github.com/realm/SwiftLint.git", from: "<version>")
-
- -

SwiftLint can be used as a command plugin or a build tool plugin.

-

Using Homebrew:

-
brew install swiftlint
-
-

Using CocoaPods:

- -

Simply add the following line to your Podfile:

-
pod 'SwiftLint'
-
- -

This will download the SwiftLint binaries and dependencies in Pods/ during your next -pod install execution and will allow you to invoke it via ${PODS_ROOT}/SwiftLint/swiftlint -in your Script Build Phases.

- -

This is the recommended way to install a specific version of SwiftLint since it supports -installing a pinned version rather than simply the latest (which is the case with Homebrew).

- -

Note that this will add the SwiftLint binaries, its dependencies’ binaries, and the Swift binary -library distribution to the Pods/ directory, so checking in this directory to SCM such as -git is discouraged.

-

Using Mint:

-
$ mint install realm/SwiftLint
-
-

Using a pre-built package:

- -

You can also install SwiftLint by downloading SwiftLint.pkg from the -latest GitHub release and -running it.

-

Installing from source:

- -

You can also build and install from source by cloning this project and running -make install (Xcode 15.0 or later).

-

Using Bazel

- -

Put this in your MODULE.bazel:

-
bazel_dep(name = "swiftlint", version = "0.52.4", repo_name = "SwiftLint")
-
- -

Or put this in your WORKSPACE:

- -
- -WORKSPACE - -“`bzl -load(”@bazel_tools//tools/build_defs/repo:http.bzl", “http_archive”) - -http_archive( - name = “build_bazel_rules_apple”, - sha256 = “390841dd5f8a85fc25776684f4793d56e21b098dfd7243cd145b9831e6ef8be6”, - url = “https://github.com/bazelbuild/rules_apple/releases/download/2.4.1/rules_apple.2.4.1.tar.gz”, -) - -load( - “@build_bazel_rules_apple//apple:repositories.bzl”, - “apple_rules_dependencies”, -) - -apple_rules_dependencies() - -load( - “@build_bazel_rules_swift//swift:repositories.bzl”, - “swift_rules_dependencies”, -) - -swift_rules_dependencies() - -load( - “@build_bazel_rules_swift//swift:extras.bzl”, - “swift_rules_extra_dependencies”, -) - -swift_rules_extra_dependencies() - -http_archive( - name = “SwiftLint”, - sha256 = “c6ea58b9c72082cdc1ada4a2d48273ecc355896ed72204cedcc586b6ccb8aca6”, - url = “https://github.com/realm/SwiftLint/releases/download/0.52.4/bazel.tar.gz”, -) - -load(“@SwiftLint//bazel:repos.bzl”, “swiftlint_repos”) - -swiftlint_repos() - -load(“@SwiftLint//bazel:deps.bzl”, “swiftlint_deps”) - -swiftlint_deps() -“` - -
- -

Then you can run SwiftLint in the current directory with this command:

-
bazel run -c opt @SwiftLint//:swiftlint
-
-

Usage

-

Presentation

- -

To get a high-level overview of recommended ways to integrate SwiftLint into your project, -we encourage you to watch this presentation or read the transcript:

- -

Presentation

-

Xcode Run Script Build Phase

- -

Integrate SwiftLint into your Xcode project to get warnings and errors displayed -in the issue navigator.

- -

To do this select the project in the file navigator, then select the primary app -target, and go to Build Phases. Click the + and select "New Run Script Phase”. -Insert the following as the script:

- -

- -

Xcode 15 made a significant change by setting the default value of the ENABLE_USER_SCRIPT_SANDBOXING Build Setting from NO to YES. -As a result, SwiftLint encounters an error related to missing file permissions, -which typically manifests as follows: error: Sandbox: swiftlint(19427) deny(1) file-read-data.

- -

To resolve this issue, it is necessary to manually set the ENABLE_USER_SCRIPT_SANDBOXING setting to NO for the specific target that SwiftLint is being configured for.

- -

If you installed SwiftLint via Homebrew on Apple Silicon, you might experience this warning:

-
-

Warning

-

SwiftLint not installed, download from https://github.com/realm/SwiftLint

- -
- -

That is because Homebrew on Apple Silicon installs the binaries into the /opt/homebrew/bin -folder by default. To instruct Xcode where to find SwiftLint, you can either add -/opt/homebrew/bin to the PATH environment variable in your build phase

-
if [[ "$(uname -m)" == arm64 ]]; then
-    export PATH="/opt/homebrew/bin:$PATH"
-fi
-
-if which swiftlint > /dev/null; then
-  swiftlint
-else
-  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
-fi
-
- -

or you can create a symbolic link in /usr/local/bin pointing to the actual binary:

-
ln -s /opt/homebrew/bin/swiftlint /usr/local/bin/swiftlint
-
- -

You might want to move your SwiftLint phase directly before the ‘Compile Sources’ -step to detect errors quickly before compiling. However, SwiftLint is designed -to run on valid Swift code that cleanly completes the compiler’s parsing stage. -So running SwiftLint before ‘Compile Sources’ might yield some incorrect -results.

- -

If you wish to fix violations as well, your script could run -swiftlint --fix && swiftlint instead of just swiftlint. This will mean -that all correctable violations are fixed while ensuring warnings show up in -your project for remaining violations.

- -

If you’ve installed SwiftLint via CocoaPods the script should look like this:

-
"${PODS_ROOT}/SwiftLint/swiftlint"
-
-

Swift Package Command Plugin

- -

The command plugin enables running SwiftLint from the command line as follows:

-
swift package plugin swiftlint
-
-

Swift Package Build Tool Plugins

- -

SwiftLint can be used as a build tool plugin for both Xcode projects and -Swift Package projects.

- -

The build tool plugin determines the SwiftLint working directory by locating -the topmost config file within the package/project directory. If a config file -is not found therein, the package/project directory is used as the working -directory.

- -

The plugin throws an error when it is unable to resolve the SwiftLint working -directory. For example, this will occur in Xcode projects where the target’s -Swift files are not located within the project directory.

- -

To maximize compatibility with the plugin, avoid project structures that require -the use of the --config option.

-

Unexpected Project Structures

- -

Project structures where SwiftLint’s configuration file is located -outside of the package/project directory are not directly supported -by the build tool plugin. This is because it isn’t possible to pass -arguments to build tool plugins (e.g., passing the config file path).

- -

If your project structure doesn’t work directly with the build tool -plugin, please consider one of the following options:

- -
    -
  • To use a config file located outside the package/project directory, a config -file may be added to that directory specifying a parent config path to the -other config file, e.g., parent_config: path/to/.swiftlint.yml.
  • -
  • You can also consider the use of a Run Script Build Phase in place of the -build tool plugin.
  • -
-

Xcode Projects

- -

You can integrate SwiftLint as an Xcode Build Tool Plugin if you’re working -with a project in Xcode.

- -

Add SwiftLint as a package dependency to your project without linking any of the -products.

- -

Select the target you want to add linting to and open the Build Phases inspector. -Open Run Build Tool Plugins and select the + button. -Select SwiftLintBuildToolPlugin from the list and add it to the project.

- -

- -

For unattended use (e.g. on CI), you can disable the package and macro validation dialog by

- -
    -
  • individually passing -skipPackagePluginValidation and -skipMacroValidation to xcodebuild or
  • -
  • globally setting defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES and defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES -for that user.
  • -
- -

Note: This implicitly trusts all Xcode package plugins and macros in packages and bypasses Xcode’s package validation - dialogs, which has security implications.

-

Swift Package Projects

- -

You can integrate SwiftLint as a Swift Package Manager Plugin if you’re working with -a Swift Package with a Package.swift manifest.

- -

Add SwiftLint as a package dependency to your Package.swift file.
-Add SwiftLint to a target using the plugins parameter.

-
.target(
-    ...
-    plugins: [.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint")]
-),
-
-

Visual Studio Code

- -

To integrate SwiftLint with vscode, install the -vscode-swiftlint extension from the marketplace.

-

fastlane

- -

You can use the official swiftlint fastlane action to run SwiftLint as part of your fastlane process.

-
swiftlint(
-    mode: :lint,                            # SwiftLint mode: :lint (default) or :autocorrect
-    executable: "Pods/SwiftLint/swiftlint", # The SwiftLint binary path (optional). Important if you've installed it via CocoaPods
-    path: "/path/to/lint",                  # Specify path to lint (optional)
-    output_file: "swiftlint.result.json",   # The path of the output file (optional)
-    reporter: "json",                       # The custom reporter to use (optional)
-    config_file: ".swiftlint-ci.yml",       # The path of the configuration file (optional)
-    files: [                                # List of files to process (optional)
-        "AppDelegate.swift",
-        "path/to/project/Model.swift"
-    ],
-    ignore_exit_status: true,               # Allow fastlane to continue even if SwiftLint returns a non-zero exit status (Default: false)
-    quiet: true,                            # Don't print status logs like 'Linting ' & 'Done linting' (Default: false)
-    strict: true                            # Fail on warnings? (Default: false)
-)
-
-

Docker

- -

swiftlint is also available as a Docker image using Ubuntu. -So just the first time you need to pull the docker image using the next command:

-
docker pull ghcr.io/realm/swiftlint:latest
-
- -

Then following times, you just run swiftlint inside of the docker like:

-
docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
-
- -

This will execute swiftlint in the folder where you are right now (pwd), showing an output like:

-
$ docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
-Linting Swift files in current working directory
-Linting 'RuleDocumentation.swift' (1/490)
-...
-Linting 'YamlSwiftLintTests.swift' (490/490)
-Done linting! Found 0 violations, 0 serious in 490 files.
-
- -

Here you have more documentation about the usage of Docker Images.

-

Command Line

-
$ swiftlint help
-OVERVIEW: A tool to enforce Swift style and conventions.
-
-USAGE: swiftlint <subcommand>
-
-OPTIONS:
-  --version               Show the version.
-  -h, --help              Show help information.
-
-SUBCOMMANDS:
-  analyze                 Run analysis rules
-  docs                    Open SwiftLint documentation website in the default web browser
-  generate-docs           Generates markdown documentation for all rules
-  lint (default)          Print lint warnings and errors
-  reporters               Display the list of reporters and their identifiers
-  rules                   Display the list of rules and their identifiers
-  version                 Display the current version of SwiftLint
-
-  See 'swiftlint help <subcommand>' for detailed help.
-
- -

Run swiftlint in the directory containing the Swift files to lint. Directories -will be searched recursively.

- -

To specify a list of files when using lint or analyze -(like the list of files modified by Xcode specified by the -ExtraBuildPhase Xcode -plugin, or modified files in the working tree based on git ls-files -m), you -can do so by passing the option --use-script-input-files and setting the -following instance variables: SCRIPT_INPUT_FILE_COUNT and -SCRIPT_INPUT_FILE_0, SCRIPT_INPUT_FILE_1…SCRIPT_INPUT_FILE_{SCRIPT_INPUT_FILE_COUNT - 1}.

- -

These are same environment variables set for input files to -custom Xcode script phases.

-

Working With Multiple Swift Versions

- -

SwiftLint hooks into SourceKit so it continues working even as Swift evolves!

- -

This also keeps SwiftLint lean, as it doesn’t need to ship with a full Swift -compiler, it just communicates with the official one you already have installed -on your machine.

- -

You should always run SwiftLint with the same toolchain you use to compile your -code.

- -

You may want to override SwiftLint’s default Swift toolchain if you have -multiple toolchains or Xcodes installed.

- -

Here’s the order in which SwiftLint determines which Swift toolchain to use:

- -
    -
  • $XCODE_DEFAULT_TOOLCHAIN_OVERRIDE
  • -
  • $TOOLCHAIN_DIR or $TOOLCHAINS
  • -
  • xcrun -find swift
  • -
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • ~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
  • ~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • -
- -

sourcekitd.framework is expected to be found in the usr/lib/ subdirectory of -the value passed in the paths above.

- -

You may also set the TOOLCHAINS environment variable to the reverse-DNS -notation that identifies a Swift toolchain version:

-
$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 swiftlint --fix
-
- -

On Linux, SourceKit is expected to be located in -/usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH -environment variable.

-

pre-commit

- -

SwiftLint can be run as a pre-commit hook. -Once installed, add this to the -.pre-commit-config.yaml in the root of your repository:

-
repos:
-  - repo: https://github.com/realm/SwiftLint
-    rev: 0.50.3
-    hooks:
-      - id: swiftlint
-
- -

Adjust rev to the SwiftLint version of your choice. pre-commit autoupdate can be used to update to the current version.

- -

SwiftLint can be configured using entry to apply fixes and fail on errors:

-
-   repo: https://github.com/realm/SwiftLint
-    rev: 0.50.3
-    hooks:
-    -   id: swiftlint
-        entry: swiftlint --fix --strict
-
-

Rules

- -

Over 200 rules are included in SwiftLint and the Swift community (that’s you!) -continues to contribute more over time. -Pull requests are encouraged.

- -

You can find an updated list of rules and more information about them -here.

- -

You can also check Source/SwiftLintBuiltInRules/Rules -directory to see their implementation.

-

Opt-In Rules

- -

opt_in_rules are disabled by default (i.e., you have to explicitly enable them -in your configuration file).

- -

Guidelines on when to mark a rule as opt-in:

- -
    -
  • A rule that can have many false positives (e.g. empty_count)
  • -
  • A rule that is too slow
  • -
  • A rule that is not general consensus or is only useful in some cases -(e.g. force_unwrapping)
  • -
-

Disable rules in code

- -

Rules can be disabled with a comment inside a source file with the following -format:

- -

// swiftlint:disable <rule1> [<rule2> <rule3>...]

- -

The rules will be disabled until the end of the file or until the linter sees a -matching enable comment:

- -

// swiftlint:enable <rule1> [<rule2> <rule3>...]

- -

For example:

-
// swiftlint:disable colon
-let noWarning :String = "" // No warning about colons immediately after variable names!
-// swiftlint:enable colon
-let hasWarning :String = "" // Warning generated about colons immediately after variable names
-
- -

Including the all keyword will disable all rules until the linter sees a matching enable comment:

- -

// swiftlint:disable all -// swiftlint:enable all

- -

For example:

-
// swiftlint:disable all
-let noWarning :String = "" // No warning about colons immediately after variable names!
-let i = "" // Also no warning about short identifier names
-// swiftlint:enable all
-let hasWarning :String = "" // Warning generated about colons immediately after variable names
-let y = "" // Warning generated about short identifier names
-
- -

It’s also possible to modify a disable or enable command by appending -:previous, :this or :next for only applying the command to the previous, -this (current) or next line respectively.

- -

For example:

-
// swiftlint:disable:next force_cast
-let noWarning = NSNumber() as! Int
-let hasWarning = NSNumber() as! Int
-let noWarning2 = NSNumber() as! Int // swiftlint:disable:this force_cast
-let noWarning3 = NSNumber() as! Int
-// swiftlint:disable:previous force_cast
-
- -

Run swiftlint rules to print a list of all available rules and their -identifiers.

-

Configuration

- -

Configure SwiftLint by adding a .swiftlint.yml file from the directory you’ll -run SwiftLint from. The following parameters can be configured:

- -

Rule inclusion:

- -
    -
  • disabled_rules: Disable rules from the default enabled set.
  • -
  • opt_in_rules: Enable rules that are not part of the default set. The -special all identifier will enable all opt in linter rules, except the ones -listed in disabled_rules.
  • -
  • only_rules: Only the rules specified in this list will be enabled. -Cannot be specified alongside disabled_rules or opt_in_rules.
  • -
  • analyzer_rules: This is an entirely separate list of rules that are only -run by the analyze command. All analyzer rules are opt-in, so this is the -only configurable rule list, there are no equivalents for disabled_rules -and only_rules. The special all identifier can also be used here to enable -all analyzer rules, except the ones listed in disabled_rules.
  • -
-
# By default, SwiftLint uses a set of sensible default rules you can adjust:
-disabled_rules: # rule identifiers turned on by default to exclude from running
-  - colon
-  - comma
-  - control_statement
-opt_in_rules: # some rules are turned off by default, so you need to opt-in
-  - empty_count # find all the available rules by running: `swiftlint rules`
-
-# Alternatively, specify all rules explicitly by uncommenting this option:
-# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
-#   - empty_parameters
-#   - vertical_whitespace
-
-analyzer_rules: # rules run by `swiftlint analyze`
-  - explicit_self
-
-included: # case-sensitive paths to include during linting. `--path` is ignored if present
-  - Sources
-excluded: # case-sensitive paths to ignore during linting. Takes precedence over `included`
-  - Carthage
-  - Pods
-  - Sources/ExcludedFolder
-  - Sources/ExcludedFile.swift
-  - Sources/*/ExcludedFile.swift # exclude files with a wildcard
-
-# If true, SwiftLint will not fail if no lintable files are found.
-allow_zero_lintable_files: false
-
-# If true, SwiftLint will treat all warnings as errors.
-strict: false
-
-# configurable rules can be customized from this configuration file
-# binary rules can set their severity level
-force_cast: warning # implicitly
-force_try:
-  severity: warning # explicitly
-# rules that have both warning and error levels, can set just the warning level
-# implicitly
-line_length: 110
-# they can set both implicitly with an array
-type_body_length:
-  - 300 # warning
-  - 400 # error
-# or they can set both explicitly
-file_length:
-  warning: 500
-  error: 1200
-# naming rules can set warnings/errors for min_length and max_length
-# additionally they can set excluded names
-type_name:
-  min_length: 4 # only warning
-  max_length: # warning and error
-    warning: 40
-    error: 50
-  excluded: iPhone # excluded via string
-  allowed_symbols: ["_"] # these are allowed in type names
-identifier_name:
-  min_length: # only min_length
-    error: 4 # only error
-  excluded: # excluded via string array
-    - id
-    - URL
-    - GlobalAPIKey
-reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)
-
- -

You can also use environment variables in your configuration file, -by using ${SOME_VARIABLE} in a string.

-

Defining Custom Rules

- -

In addition to the rules that the main SwiftLint project ships with, SwiftLint -can also run two types of custom rules that you can define yourself in your own -projects:

-

1. Swift Custom Rules

- -

These rules are written the same way as the Swift-based rules that ship with -SwiftLint so they’re fast, accurate, can leverage SwiftSyntax, can be unit -tested, and more.

- -

Using these requires building SwiftLint with Bazel as described in -this video or its associated code in -github.com/jpsim/swiftlint-bazel-example.

-

2. Regex Custom Rules

- -

You can define custom regex-based rules in your configuration file using the -following syntax:

-
custom_rules:
-  pirates_beat_ninjas: # rule identifier
-    included: 
-      - ".*\\.swift" # regex that defines paths to include during linting. optional.
-    excluded: 
-      - ".*Test\\.swift" # regex that defines paths to exclude during linting. optional
-    name: "Pirates Beat Ninjas" # rule name. optional.
-    regex: "([nN]inja)" # matching pattern
-    capture_group: 0 # number of regex capture group to highlight the rule violation at. optional.
-    match_kinds: # SyntaxKinds to match. optional.
-      - comment
-      - identifier
-    message: "Pirates are better than ninjas." # violation message. optional.
-    severity: error # violation severity. optional.
-  no_hiding_in_strings:
-    regex: "([nN]inja)"
-    match_kinds: string
-
- -

This is what the output would look like:

- -

- -

It is important to note that the regular expression pattern is used with the flags s -and m enabled, that is . -matches newlines -and ^/$ -match the start and end of lines, -respectively. If you do not want to have . match newlines, for example, the regex can be prepended by (?-s).

- -

You can filter the matches by providing one or more match_kinds, which will -reject matches that include syntax kinds that are not present in this list. Here -are all the possible syntax kinds:

- -
    -
  • argument
  • -
  • attribute.builtin
  • -
  • attribute.id
  • -
  • buildconfig.id
  • -
  • buildconfig.keyword
  • -
  • comment
  • -
  • comment.mark
  • -
  • comment.url
  • -
  • doccomment
  • -
  • doccomment.field
  • -
  • identifier
  • -
  • keyword
  • -
  • number
  • -
  • objectliteral
  • -
  • parameter
  • -
  • placeholder
  • -
  • string
  • -
  • string_interpolation_anchor
  • -
  • typeidentifier
  • -
- -

All syntax kinds used in a snippet of Swift code can be extracted asking -SourceKitten. For example, -sourcekitten syntax --text "struct S {}" delivers

- -
    -
  • source.lang.swift.syntaxtype.keyword for the struct keyword and
  • -
  • source.lang.swift.syntaxtype.identifier for its name S
  • -
- -

which match to keyword and identifier in the above list.

- -

If using custom rules in combination with only_rules, make sure to add -custom_rules as an item under only_rules.

- -

Unlike Swift custom rules, you can use official SwiftLint builds -(e.g. from Homebrew) to run regex custom rules.

-

Auto-correct

- -

SwiftLint can automatically correct certain violations. Files on disk are -overwritten with a corrected version.

- -

Please make sure to have backups of these files before running -swiftlint --fix, otherwise important data may be lost.

- -

Standard linting is disabled while correcting because of the high likelihood of -violations (or their offsets) being incorrect after modifying a file while -applying corrections.

-

Analyze

- -

The swiftlint analyze command can lint Swift files using the -full type-checked AST. The compiler log path containing the clean swiftc build -command invocation (incremental builds will fail) must be passed to analyze -via the --compiler-log-path flag. -e.g. --compiler-log-path /path/to/xcodebuild.log

- -

This can be obtained by

- -
    -
  1. Cleaning DerivedData (incremental builds won’t work with analyze)
  2. -
  3. Running xcodebuild -workspace {WORKSPACE}.xcworkspace -scheme {SCHEME} > xcodebuild.log
  4. -
  5. Running swiftlint analyze --compiler-log-path xcodebuild.log
  6. -
- -

Analyzer rules tend to be considerably slower than lint rules.

-

Using Multiple Configuration Files

- -

SwiftLint offers a variety of ways to include multiple configuration files. -Multiple configuration files get merged into one single configuration that is then applied -just as a single configuration file would get applied.

- -

There are quite a lot of use cases where using multiple configuration files could be helpful:

- -

For instance, one could use a team-wide shared SwiftLint configuration while allowing overrides -in each project via a child configuration file.

- -

Team-Wide Configuration:

-
disabled_rules:
-- force_cast
-
- -

Project-Specific Configuration:

-
opt_in_rules:
-- force_cast
-
-

Child / Parent Configs (Locally)

- -

You can specify a child_config and / or a parent_config reference within a configuration file. -These references should be local paths relative to the folder of the configuration file they are specified in. -This even works recursively, as long as there are no cycles and no ambiguities.

- -

A child config is treated as a refinement and therefore has a higher priority, -while a parent config is considered a base with lower priority in case of conflicts.

- -

Here’s an example, assuming you have the following file structure:

-
ProjectRoot
-    |_ .swiftlint.yml
-    |_ .swiftlint_refinement.yml
-    |_ Base
-        |_ .swiftlint_base.yml
-
- -

To include both the refinement and the base file, your .swiftlint.yml should look like this:

-
child_config: .swiftlint_refinement.yml
-parent_config: Base/.swiftlint_base.yml
-
- -

When merging parent and child configs, included and excluded configurations -are processed carefully to account for differences in the directory location -of the containing configuration files.

-

Child / Parent Configs (Remote)

- -

Just as you can provide local child_config / parent_config references, instead of -referencing local paths, you can just put urls that lead to configuration files. -In order for SwiftLint to detect these remote references, they must start with http:// or https://.

- -

The referenced remote configuration files may even recursively reference other -remote configuration files, but aren’t allowed to include local references.

- -

Using a remote reference, your .swiftlint.yml could look like this:

-
parent_config: https://myteamserver.com/our-base-swiftlint-config.yml
-
- -

Every time you run SwiftLint and have an Internet connection, SwiftLint tries to get a new version of -every remote configuration that is referenced. If this request times out, a cached version is -used if available. If there is no cached version available, SwiftLint fails – but no worries, a cached version -should be there once SwiftLint has run successfully at least once.

- -

If needed, the timeouts for the remote configuration fetching can be specified manually via the -configuration file(s) using the remote_timeout / remote_timeout_if_cached specifiers. -These values default to 2 / 1 second(s).

-

Command Line

- -

Instead of just providing one configuration file when running SwiftLint via the command line, -you can also pass a hierarchy, where the first configuration is treated as a parent, -while the last one is treated as the highest-priority child.

- -

A simple example including just two configuration files looks like this:

- -

swiftlint --config .swiftlint.yml --config .swiftlint_child.yml

-

Nested Configurations

- -

In addition to a main configuration (the .swiftlint.yml file in the root folder), -you can put other configuration files named .swiftlint.yml into the directory structure -that then get merged as a child config, but only with an effect for those files -that are within the same directory as the config or in a deeper directory where -there isn’t another configuration file. In other words: Nested configurations don’t work -recursively – there’s a maximum number of one nested configuration per file -that may be applied in addition to the main configuration.

- -

.swiftlint.yml files are only considered as a nested configuration if they have not been -used to build the main configuration already (e. g. by having been referenced via something -like child_config: Folder/.swiftlint.yml). Also, parent_config / child_config -specifications of nested configurations are getting ignored because there’s no sense to that.

- -

If one (or more) SwiftLint file(s) are explicitly specified via the --config parameter, -that configuration will be treated as an override, no matter whether there exist -other .swiftlint.yml files somewhere within the directory. So if you want to use - nested configurations, you can’t use the --config parameter.

-

License

- -

MIT licensed.

-

About

- -

- -

SwiftLint is maintained and funded by Realm Inc. The names and logos for -Realm are trademarks of Realm Inc.

- -

We :heart: open source software! -See our other open source projects, -read our blog, or say hi on twitter -(@realm).

- -

- -

Our thanks to MacStadium for providing a Mac Mini to run our performance -tests.

- -
-
- - -
-
- - - diff --git a/inert_defer.html b/inert_defer.html deleted file mode 100644 index 39d98dc13..000000000 --- a/inert_defer.html +++ /dev/null @@ -1,419 +0,0 @@ - - - - inert_defer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Inert Defer

- -

If defer is at the end of its parent scope, it will be executed right where it is anyway

- -
    -
  • Identifier: inert_defer
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func example3() {
-    defer { /* deferred code */ }
-
-    print("other code")
-}
-
-
func example4() {
-    if condition {
-        defer { /* deferred code */ }
-        print("other code")
-    }
-}
-
-

Triggering Examples

-
func example0() {
-    ↓defer { /* deferred code */ }
-}
-
-
func example1() {
-    ↓defer { /* deferred code */ }
-    // comment
-}
-
-
func example2() {
-    if condition {
-        ↓defer { /* deferred code */ }
-        // comment
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/invalid_swiftlint_command.html b/invalid_swiftlint_command.html deleted file mode 100644 index 040c3b5fb..000000000 --- a/invalid_swiftlint_command.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - invalid_swiftlint_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Invalid SwiftLint Command

- -

swiftlint command is invalid

- -
    -
  • Identifier: invalid_swiftlint_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// swiftlint:disable unused_import
-
-
// swiftlint:enable unused_import
-
-
// swiftlint:disable:next unused_import
-
-
// swiftlint:disable:previous unused_import
-
-
// swiftlint:disable:this unused_import
-
-
//swiftlint:disable:this unused_import
-
-

Triggering Examples

-
// ↓swiftlint:
-
-
// ↓swiftlint: 
-
-
// ↓swiftlint::
-
-
// ↓swiftlint:: 
-
-
// ↓swiftlint:disable
-
-
// ↓swiftlint:dissable unused_import
-
-
// ↓swiftlint:enaaaable unused_import
-
-
// ↓swiftlint:disable:nxt unused_import
-
-
// ↓swiftlint:enable:prevus unused_import
-
-
// ↓swiftlint:enable:ths unused_import
-
-
// ↓swiftlint:enable
-
-
// ↓swiftlint:enable:
-
-
// ↓swiftlint:enable: 
-
-
// ↓swiftlint:disable: unused_import
-
-
// s↓swiftlint:disable unused_import
-
- -
-
- - -
-
- - - diff --git a/is_disjoint.html b/is_disjoint.html deleted file mode 100644 index 2b0f6c9cf..000000000 --- a/is_disjoint.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - is_disjoint Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Is Disjoint

- -

Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty

- -
    -
  • Identifier: is_disjoint
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
_ = Set(syntaxKinds).isDisjoint(with: commentAndStringKindsSet)
-
-
let isObjc = !objcAttributes.isDisjoint(with: dictionary.enclosedSwiftAttributes)
-
-
_ = Set(syntaxKinds).intersection(commentAndStringKindsSet)
-
-
_ = !objcAttributes.intersection(dictionary.enclosedSwiftAttributes)
-
-

Triggering Examples

-
_ = Set(syntaxKinds).↓intersection(commentAndStringKindsSet).isEmpty
-
-
let isObjc = !objcAttributes.↓intersection(dictionary.enclosedSwiftAttributes).isEmpty
-
- -
-
- - -
-
- - - diff --git a/joined_default_parameter.html b/joined_default_parameter.html deleted file mode 100644 index 221069b7c..000000000 --- a/joined_default_parameter.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - joined_default_parameter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Joined Default Parameter

- -

Discouraged explicit usage of the default separator

- -
    -
  • Identifier: joined_default_parameter
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = bar.joined()
-
-
let foo = bar.joined(separator: ",")
-
-
let foo = bar.joined(separator: toto)
-
-

Triggering Examples

-
let foo = bar.joined(↓separator: "")
-
-
let foo = bar.filter(toto)
-             .joined(↓separator: ""),
-
-
func foo() -> String {
-  return ["1", "2"].joined(↓separator: "")
-}
-
- -
-
- - -
-
- - - diff --git a/js/jazzy.js b/js/jazzy.js deleted file mode 100755 index 198441660..000000000 --- a/js/jazzy.js +++ /dev/null @@ -1,74 +0,0 @@ -// Jazzy - https://github.com/realm/jazzy -// Copyright Realm Inc. -// SPDX-License-Identifier: MIT - -window.jazzy = {'docset': false} -if (typeof window.dash != 'undefined') { - document.documentElement.className += ' dash' - window.jazzy.docset = true -} -if (navigator.userAgent.match(/xcode/i)) { - document.documentElement.className += ' xcode' - window.jazzy.docset = true -} - -function toggleItem($link, $content) { - var animationDuration = 300; - $link.toggleClass('token-open'); - $content.slideToggle(animationDuration); -} - -function itemLinkToContent($link) { - return $link.parent().parent().next(); -} - -// On doc load + hash-change, open any targetted item -function openCurrentItemIfClosed() { - if (window.jazzy.docset) { - return; - } - var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); - $content = itemLinkToContent($link); - if ($content.is(':hidden')) { - toggleItem($link, $content); - } -} - -$(openCurrentItemIfClosed); -$(window).on('hashchange', openCurrentItemIfClosed); - -// On item link ('token') click, toggle its discussion -$('.token').on('click', function(event) { - if (window.jazzy.docset) { - return; - } - var $link = $(this); - toggleItem($link, itemLinkToContent($link)); - - // Keeps the document from jumping to the hash. - var href = $link.attr('href'); - if (history.pushState) { - history.pushState({}, '', href); - } else { - location.hash = href; - } - event.preventDefault(); -}); - -// Clicks on links to the current, closed, item need to open the item -$("a:not('.token')").on('click', function() { - if (location == this.href) { - openCurrentItemIfClosed(); - } -}); - -// KaTeX rendering -if ("katex" in window) { - $($('.math').each( (_, element) => { - katex.render(element.textContent, element, { - displayMode: $(element).hasClass('m-block'), - throwOnError: false, - trust: true - }); - })) -} diff --git a/js/jazzy.search.js b/js/jazzy.search.js deleted file mode 100644 index 359cdbb8b..000000000 --- a/js/jazzy.search.js +++ /dev/null @@ -1,74 +0,0 @@ -// Jazzy - https://github.com/realm/jazzy -// Copyright Realm Inc. -// SPDX-License-Identifier: MIT - -$(function(){ - var $typeahead = $('[data-typeahead]'); - var $form = $typeahead.parents('form'); - var searchURL = $form.attr('action'); - - function displayTemplate(result) { - return result.name; - } - - function suggestionTemplate(result) { - var t = '
'; - t += '' + result.name + ''; - if (result.parent_name) { - t += '' + result.parent_name + ''; - } - t += '
'; - return t; - } - - $typeahead.one('focus', function() { - $form.addClass('loading'); - - $.getJSON(searchURL).then(function(searchData) { - const searchIndex = lunr(function() { - this.ref('url'); - this.field('name'); - this.field('abstract'); - for (const [url, doc] of Object.entries(searchData)) { - this.add({url: url, name: doc.name, abstract: doc.abstract}); - } - }); - - $typeahead.typeahead( - { - highlight: true, - minLength: 3, - autoselect: true - }, - { - limit: 10, - display: displayTemplate, - templates: { suggestion: suggestionTemplate }, - source: function(query, sync) { - const lcSearch = query.toLowerCase(); - const results = searchIndex.query(function(q) { - q.term(lcSearch, { boost: 100 }); - q.term(lcSearch, { - boost: 10, - wildcard: lunr.Query.wildcard.TRAILING - }); - }).map(function(result) { - var doc = searchData[result.ref]; - doc.url = result.ref; - return doc; - }); - sync(results); - } - } - ); - $form.removeClass('loading'); - $typeahead.trigger('focus'); - }); - }); - - var baseURL = searchURL.slice(0, -"search.json".length); - - $typeahead.on('typeahead:select', function(e, result) { - window.location = baseURL + result.url; - }); -}); diff --git a/js/jquery.min.js b/js/jquery.min.js deleted file mode 100644 index 7f37b5d99..000000000 --- a/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/js/typeahead.jquery.js b/js/typeahead.jquery.js deleted file mode 100644 index 3a2d2ab03..000000000 --- a/js/typeahead.jquery.js +++ /dev/null @@ -1,1694 +0,0 @@ -/*! - * typeahead.js 1.3.1 - * https://github.com/corejavascript/typeahead.js - * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT - */ - - -(function(root, factory) { - if (typeof define === "function" && define.amd) { - define([ "jquery" ], function(a0) { - return factory(a0); - }); - } else if (typeof module === "object" && module.exports) { - module.exports = factory(require("jquery")); - } else { - factory(root["jQuery"]); - } -})(this, function($) { - var _ = function() { - "use strict"; - return { - isMsie: function() { - return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; - }, - isBlankString: function(str) { - return !str || /^\s*$/.test(str); - }, - escapeRegExChars: function(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - }, - isString: function(obj) { - return typeof obj === "string"; - }, - isNumber: function(obj) { - return typeof obj === "number"; - }, - isArray: $.isArray, - isFunction: $.isFunction, - isObject: $.isPlainObject, - isUndefined: function(obj) { - return typeof obj === "undefined"; - }, - isElement: function(obj) { - return !!(obj && obj.nodeType === 1); - }, - isJQuery: function(obj) { - return obj instanceof $; - }, - toStr: function toStr(s) { - return _.isUndefined(s) || s === null ? "" : s + ""; - }, - bind: $.proxy, - each: function(collection, cb) { - $.each(collection, reverseArgs); - function reverseArgs(index, value) { - return cb(value, index); - } - }, - map: $.map, - filter: $.grep, - every: function(obj, test) { - var result = true; - if (!obj) { - return result; - } - $.each(obj, function(key, val) { - if (!(result = test.call(null, val, key, obj))) { - return false; - } - }); - return !!result; - }, - some: function(obj, test) { - var result = false; - if (!obj) { - return result; - } - $.each(obj, function(key, val) { - if (result = test.call(null, val, key, obj)) { - return false; - } - }); - return !!result; - }, - mixin: $.extend, - identity: function(x) { - return x; - }, - clone: function(obj) { - return $.extend(true, {}, obj); - }, - getIdGenerator: function() { - var counter = 0; - return function() { - return counter++; - }; - }, - templatify: function templatify(obj) { - return $.isFunction(obj) ? obj : template; - function template() { - return String(obj); - } - }, - defer: function(fn) { - setTimeout(fn, 0); - }, - debounce: function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments, later, callNow; - later = function() { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - } - }; - callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - } - return result; - }; - }, - throttle: function(func, wait) { - var context, args, timeout, result, previous, later; - previous = 0; - later = function() { - previous = new Date(); - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date(), remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }, - stringify: function(val) { - return _.isString(val) ? val : JSON.stringify(val); - }, - guid: function() { - function _p8(s) { - var p = (Math.random().toString(16) + "000000000").substr(2, 8); - return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; - } - return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); - }, - noop: function() {} - }; - }(); - var WWW = function() { - "use strict"; - var defaultClassNames = { - wrapper: "twitter-typeahead", - input: "tt-input", - hint: "tt-hint", - menu: "tt-menu", - dataset: "tt-dataset", - suggestion: "tt-suggestion", - selectable: "tt-selectable", - empty: "tt-empty", - open: "tt-open", - cursor: "tt-cursor", - highlight: "tt-highlight" - }; - return build; - function build(o) { - var www, classes; - classes = _.mixin({}, defaultClassNames, o); - www = { - css: buildCss(), - classes: classes, - html: buildHtml(classes), - selectors: buildSelectors(classes) - }; - return { - css: www.css, - html: www.html, - classes: www.classes, - selectors: www.selectors, - mixin: function(o) { - _.mixin(o, www); - } - }; - } - function buildHtml(c) { - return { - wrapper: '', - menu: '
' - }; - } - function buildSelectors(classes) { - var selectors = {}; - _.each(classes, function(v, k) { - selectors[k] = "." + v; - }); - return selectors; - } - function buildCss() { - var css = { - wrapper: { - position: "relative", - display: "inline-block" - }, - hint: { - position: "absolute", - top: "0", - left: "0", - borderColor: "transparent", - boxShadow: "none", - opacity: "1" - }, - input: { - position: "relative", - verticalAlign: "top", - backgroundColor: "transparent" - }, - inputWithNoHint: { - position: "relative", - verticalAlign: "top" - }, - menu: { - position: "absolute", - top: "100%", - left: "0", - zIndex: "100", - display: "none" - }, - ltr: { - left: "0", - right: "auto" - }, - rtl: { - left: "auto", - right: " 0" - } - }; - if (_.isMsie()) { - _.mixin(css.input, { - backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" - }); - } - return css; - } - }(); - var EventBus = function() { - "use strict"; - var namespace, deprecationMap; - namespace = "typeahead:"; - deprecationMap = { - render: "rendered", - cursorchange: "cursorchanged", - select: "selected", - autocomplete: "autocompleted" - }; - function EventBus(o) { - if (!o || !o.el) { - $.error("EventBus initialized without el"); - } - this.$el = $(o.el); - } - _.mixin(EventBus.prototype, { - _trigger: function(type, args) { - var $e = $.Event(namespace + type); - this.$el.trigger.call(this.$el, $e, args || []); - return $e; - }, - before: function(type) { - var args, $e; - args = [].slice.call(arguments, 1); - $e = this._trigger("before" + type, args); - return $e.isDefaultPrevented(); - }, - trigger: function(type) { - var deprecatedType; - this._trigger(type, [].slice.call(arguments, 1)); - if (deprecatedType = deprecationMap[type]) { - this._trigger(deprecatedType, [].slice.call(arguments, 1)); - } - } - }); - return EventBus; - }(); - var EventEmitter = function() { - "use strict"; - var splitter = /\s+/, nextTick = getNextTick(); - return { - onSync: onSync, - onAsync: onAsync, - off: off, - trigger: trigger - }; - function on(method, types, cb, context) { - var type; - if (!cb) { - return this; - } - types = types.split(splitter); - cb = context ? bindContext(cb, context) : cb; - this._callbacks = this._callbacks || {}; - while (type = types.shift()) { - this._callbacks[type] = this._callbacks[type] || { - sync: [], - async: [] - }; - this._callbacks[type][method].push(cb); - } - return this; - } - function onAsync(types, cb, context) { - return on.call(this, "async", types, cb, context); - } - function onSync(types, cb, context) { - return on.call(this, "sync", types, cb, context); - } - function off(types) { - var type; - if (!this._callbacks) { - return this; - } - types = types.split(splitter); - while (type = types.shift()) { - delete this._callbacks[type]; - } - return this; - } - function trigger(types) { - var type, callbacks, args, syncFlush, asyncFlush; - if (!this._callbacks) { - return this; - } - types = types.split(splitter); - args = [].slice.call(arguments, 1); - while ((type = types.shift()) && (callbacks = this._callbacks[type])) { - syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); - asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); - syncFlush() && nextTick(asyncFlush); - } - return this; - } - function getFlush(callbacks, context, args) { - return flush; - function flush() { - var cancelled; - for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { - cancelled = callbacks[i].apply(context, args) === false; - } - return !cancelled; - } - } - function getNextTick() { - var nextTickFn; - if (window.setImmediate) { - nextTickFn = function nextTickSetImmediate(fn) { - setImmediate(function() { - fn(); - }); - }; - } else { - nextTickFn = function nextTickSetTimeout(fn) { - setTimeout(function() { - fn(); - }, 0); - }; - } - return nextTickFn; - } - function bindContext(fn, context) { - return fn.bind ? fn.bind(context) : function() { - fn.apply(context, [].slice.call(arguments, 0)); - }; - } - }(); - var highlight = function(doc) { - "use strict"; - var defaults = { - node: null, - pattern: null, - tagName: "strong", - className: null, - wordsOnly: false, - caseSensitive: false, - diacriticInsensitive: false - }; - var accented = { - A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", - B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", - C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", - D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", - E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", - F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", - G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", - H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", - I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", - J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", - K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", - L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", - M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", - N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", - O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", - P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", - Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", - R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", - S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", - T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", - U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", - V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", - W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", - X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", - Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", - Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" - }; - return function hightlight(o) { - var regex; - o = _.mixin({}, defaults, o); - if (!o.node || !o.pattern) { - return; - } - o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; - regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); - traverse(o.node, hightlightTextNode); - function hightlightTextNode(textNode) { - var match, patternNode, wrapperNode; - if (match = regex.exec(textNode.data)) { - wrapperNode = doc.createElement(o.tagName); - o.className && (wrapperNode.className = o.className); - patternNode = textNode.splitText(match.index); - patternNode.splitText(match[0].length); - wrapperNode.appendChild(patternNode.cloneNode(true)); - textNode.parentNode.replaceChild(wrapperNode, patternNode); - } - return !!match; - } - function traverse(el, hightlightTextNode) { - var childNode, TEXT_NODE_TYPE = 3; - for (var i = 0; i < el.childNodes.length; i++) { - childNode = el.childNodes[i]; - if (childNode.nodeType === TEXT_NODE_TYPE) { - i += hightlightTextNode(childNode) ? 1 : 0; - } else { - traverse(childNode, hightlightTextNode); - } - } - } - }; - function accent_replacer(chr) { - return accented[chr.toUpperCase()] || chr; - } - function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { - var escapedPatterns = [], regexStr; - for (var i = 0, len = patterns.length; i < len; i++) { - var escapedWord = _.escapeRegExChars(patterns[i]); - if (diacriticInsensitive) { - escapedWord = escapedWord.replace(/\S/g, accent_replacer); - } - escapedPatterns.push(escapedWord); - } - regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; - return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); - } - }(window.document); - var Input = function() { - "use strict"; - var specialKeyCodeMap; - specialKeyCodeMap = { - 9: "tab", - 27: "esc", - 37: "left", - 39: "right", - 13: "enter", - 38: "up", - 40: "down" - }; - function Input(o, www) { - var id; - o = o || {}; - if (!o.input) { - $.error("input is missing"); - } - www.mixin(this); - this.$hint = $(o.hint); - this.$input = $(o.input); - this.$menu = $(o.menu); - id = this.$input.attr("id") || _.guid(); - this.$menu.attr("id", id + "_listbox"); - this.$hint.attr({ - "aria-hidden": true - }); - this.$input.attr({ - "aria-owns": id + "_listbox", - role: "combobox", - "aria-autocomplete": "list", - "aria-expanded": false - }); - this.query = this.$input.val(); - this.queryWhenFocused = this.hasFocus() ? this.query : null; - this.$overflowHelper = buildOverflowHelper(this.$input); - this._checkLanguageDirection(); - if (this.$hint.length === 0) { - this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; - } - this.onSync("cursorchange", this._updateDescendent); - } - Input.normalizeQuery = function(str) { - return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); - }; - _.mixin(Input.prototype, EventEmitter, { - _onBlur: function onBlur() { - this.resetInputValue(); - this.trigger("blurred"); - }, - _onFocus: function onFocus() { - this.queryWhenFocused = this.query; - this.trigger("focused"); - }, - _onKeydown: function onKeydown($e) { - var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; - this._managePreventDefault(keyName, $e); - if (keyName && this._shouldTrigger(keyName, $e)) { - this.trigger(keyName + "Keyed", $e); - } - }, - _onInput: function onInput() { - this._setQuery(this.getInputValue()); - this.clearHintIfInvalid(); - this._checkLanguageDirection(); - }, - _managePreventDefault: function managePreventDefault(keyName, $e) { - var preventDefault; - switch (keyName) { - case "up": - case "down": - preventDefault = !withModifier($e); - break; - - default: - preventDefault = false; - } - preventDefault && $e.preventDefault(); - }, - _shouldTrigger: function shouldTrigger(keyName, $e) { - var trigger; - switch (keyName) { - case "tab": - trigger = !withModifier($e); - break; - - default: - trigger = true; - } - return trigger; - }, - _checkLanguageDirection: function checkLanguageDirection() { - var dir = (this.$input.css("direction") || "ltr").toLowerCase(); - if (this.dir !== dir) { - this.dir = dir; - this.$hint.attr("dir", dir); - this.trigger("langDirChanged", dir); - } - }, - _setQuery: function setQuery(val, silent) { - var areEquivalent, hasDifferentWhitespace; - areEquivalent = areQueriesEquivalent(val, this.query); - hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; - this.query = val; - if (!silent && !areEquivalent) { - this.trigger("queryChanged", this.query); - } else if (!silent && hasDifferentWhitespace) { - this.trigger("whitespaceChanged", this.query); - } - }, - _updateDescendent: function updateDescendent(event, id) { - this.$input.attr("aria-activedescendant", id); - }, - bind: function() { - var that = this, onBlur, onFocus, onKeydown, onInput; - onBlur = _.bind(this._onBlur, this); - onFocus = _.bind(this._onFocus, this); - onKeydown = _.bind(this._onKeydown, this); - onInput = _.bind(this._onInput, this); - this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); - if (!_.isMsie() || _.isMsie() > 9) { - this.$input.on("input.tt", onInput); - } else { - this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { - if (specialKeyCodeMap[$e.which || $e.keyCode]) { - return; - } - _.defer(_.bind(that._onInput, that, $e)); - }); - } - return this; - }, - focus: function focus() { - this.$input.focus(); - }, - blur: function blur() { - this.$input.blur(); - }, - getLangDir: function getLangDir() { - return this.dir; - }, - getQuery: function getQuery() { - return this.query || ""; - }, - setQuery: function setQuery(val, silent) { - this.setInputValue(val); - this._setQuery(val, silent); - }, - hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { - return this.query !== this.queryWhenFocused; - }, - getInputValue: function getInputValue() { - return this.$input.val(); - }, - setInputValue: function setInputValue(value) { - this.$input.val(value); - this.clearHintIfInvalid(); - this._checkLanguageDirection(); - }, - resetInputValue: function resetInputValue() { - this.setInputValue(this.query); - }, - getHint: function getHint() { - return this.$hint.val(); - }, - setHint: function setHint(value) { - this.$hint.val(value); - }, - clearHint: function clearHint() { - this.setHint(""); - }, - clearHintIfInvalid: function clearHintIfInvalid() { - var val, hint, valIsPrefixOfHint, isValid; - val = this.getInputValue(); - hint = this.getHint(); - valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; - isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); - !isValid && this.clearHint(); - }, - hasFocus: function hasFocus() { - return this.$input.is(":focus"); - }, - hasOverflow: function hasOverflow() { - var constraint = this.$input.width() - 2; - this.$overflowHelper.text(this.getInputValue()); - return this.$overflowHelper.width() >= constraint; - }, - isCursorAtEnd: function() { - var valueLength, selectionStart, range; - valueLength = this.$input.val().length; - selectionStart = this.$input[0].selectionStart; - if (_.isNumber(selectionStart)) { - return selectionStart === valueLength; - } else if (document.selection) { - range = document.selection.createRange(); - range.moveStart("character", -valueLength); - return valueLength === range.text.length; - } - return true; - }, - destroy: function destroy() { - this.$hint.off(".tt"); - this.$input.off(".tt"); - this.$overflowHelper.remove(); - this.$hint = this.$input = this.$overflowHelper = $("
"); - }, - setAriaExpanded: function setAriaExpanded(value) { - this.$input.attr("aria-expanded", value); - } - }); - return Input; - function buildOverflowHelper($input) { - return $('').css({ - position: "absolute", - visibility: "hidden", - whiteSpace: "pre", - fontFamily: $input.css("font-family"), - fontSize: $input.css("font-size"), - fontStyle: $input.css("font-style"), - fontVariant: $input.css("font-variant"), - fontWeight: $input.css("font-weight"), - wordSpacing: $input.css("word-spacing"), - letterSpacing: $input.css("letter-spacing"), - textIndent: $input.css("text-indent"), - textRendering: $input.css("text-rendering"), - textTransform: $input.css("text-transform") - }).insertAfter($input); - } - function areQueriesEquivalent(a, b) { - return Input.normalizeQuery(a) === Input.normalizeQuery(b); - } - function withModifier($e) { - return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; - } - }(); - var Dataset = function() { - "use strict"; - var keys, nameGenerator; - keys = { - dataset: "tt-selectable-dataset", - val: "tt-selectable-display", - obj: "tt-selectable-object" - }; - nameGenerator = _.getIdGenerator(); - function Dataset(o, www) { - o = o || {}; - o.templates = o.templates || {}; - o.templates.notFound = o.templates.notFound || o.templates.empty; - if (!o.source) { - $.error("missing source"); - } - if (!o.node) { - $.error("missing node"); - } - if (o.name && !isValidName(o.name)) { - $.error("invalid dataset name: " + o.name); - } - www.mixin(this); - this.highlight = !!o.highlight; - this.name = _.toStr(o.name || nameGenerator()); - this.limit = o.limit || 5; - this.displayFn = getDisplayFn(o.display || o.displayKey); - this.templates = getTemplates(o.templates, this.displayFn); - this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; - this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; - this._resetLastSuggestion(); - this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); - } - Dataset.extractData = function extractData(el) { - var $el = $(el); - if ($el.data(keys.obj)) { - return { - dataset: $el.data(keys.dataset) || "", - val: $el.data(keys.val) || "", - obj: $el.data(keys.obj) || null - }; - } - return null; - }; - _.mixin(Dataset.prototype, EventEmitter, { - _overwrite: function overwrite(query, suggestions) { - suggestions = suggestions || []; - if (suggestions.length) { - this._renderSuggestions(query, suggestions); - } else if (this.async && this.templates.pending) { - this._renderPending(query); - } else if (!this.async && this.templates.notFound) { - this._renderNotFound(query); - } else { - this._empty(); - } - this.trigger("rendered", suggestions, false, this.name); - }, - _append: function append(query, suggestions) { - suggestions = suggestions || []; - if (suggestions.length && this.$lastSuggestion.length) { - this._appendSuggestions(query, suggestions); - } else if (suggestions.length) { - this._renderSuggestions(query, suggestions); - } else if (!this.$lastSuggestion.length && this.templates.notFound) { - this._renderNotFound(query); - } - this.trigger("rendered", suggestions, true, this.name); - }, - _renderSuggestions: function renderSuggestions(query, suggestions) { - var $fragment; - $fragment = this._getSuggestionsFragment(query, suggestions); - this.$lastSuggestion = $fragment.children().last(); - this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); - }, - _appendSuggestions: function appendSuggestions(query, suggestions) { - var $fragment, $lastSuggestion; - $fragment = this._getSuggestionsFragment(query, suggestions); - $lastSuggestion = $fragment.children().last(); - this.$lastSuggestion.after($fragment); - this.$lastSuggestion = $lastSuggestion; - }, - _renderPending: function renderPending(query) { - var template = this.templates.pending; - this._resetLastSuggestion(); - template && this.$el.html(template({ - query: query, - dataset: this.name - })); - }, - _renderNotFound: function renderNotFound(query) { - var template = this.templates.notFound; - this._resetLastSuggestion(); - template && this.$el.html(template({ - query: query, - dataset: this.name - })); - }, - _empty: function empty() { - this.$el.empty(); - this._resetLastSuggestion(); - }, - _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { - var that = this, fragment; - fragment = document.createDocumentFragment(); - _.each(suggestions, function getSuggestionNode(suggestion) { - var $el, context; - context = that._injectQuery(query, suggestion); - $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); - fragment.appendChild($el[0]); - }); - this.highlight && highlight({ - className: this.classes.highlight, - node: fragment, - pattern: query - }); - return $(fragment); - }, - _getFooter: function getFooter(query, suggestions) { - return this.templates.footer ? this.templates.footer({ - query: query, - suggestions: suggestions, - dataset: this.name - }) : null; - }, - _getHeader: function getHeader(query, suggestions) { - return this.templates.header ? this.templates.header({ - query: query, - suggestions: suggestions, - dataset: this.name - }) : null; - }, - _resetLastSuggestion: function resetLastSuggestion() { - this.$lastSuggestion = $(); - }, - _injectQuery: function injectQuery(query, obj) { - return _.isObject(obj) ? _.mixin({ - _query: query - }, obj) : obj; - }, - update: function update(query) { - var that = this, canceled = false, syncCalled = false, rendered = 0; - this.cancel(); - this.cancel = function cancel() { - canceled = true; - that.cancel = $.noop; - that.async && that.trigger("asyncCanceled", query, that.name); - }; - this.source(query, sync, async); - !syncCalled && sync([]); - function sync(suggestions) { - if (syncCalled) { - return; - } - syncCalled = true; - suggestions = (suggestions || []).slice(0, that.limit); - rendered = suggestions.length; - that._overwrite(query, suggestions); - if (rendered < that.limit && that.async) { - that.trigger("asyncRequested", query, that.name); - } - } - function async(suggestions) { - suggestions = suggestions || []; - if (!canceled && rendered < that.limit) { - that.cancel = $.noop; - var idx = Math.abs(rendered - that.limit); - rendered += idx; - that._append(query, suggestions.slice(0, idx)); - that.async && that.trigger("asyncReceived", query, that.name); - } - } - }, - cancel: $.noop, - clear: function clear() { - this._empty(); - this.cancel(); - this.trigger("cleared"); - }, - isEmpty: function isEmpty() { - return this.$el.is(":empty"); - }, - destroy: function destroy() { - this.$el = $("
"); - } - }); - return Dataset; - function getDisplayFn(display) { - display = display || _.stringify; - return _.isFunction(display) ? display : displayFn; - function displayFn(obj) { - return obj[display]; - } - } - function getTemplates(templates, displayFn) { - return { - notFound: templates.notFound && _.templatify(templates.notFound), - pending: templates.pending && _.templatify(templates.pending), - header: templates.header && _.templatify(templates.header), - footer: templates.footer && _.templatify(templates.footer), - suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate - }; - function userSuggestionTemplate(context) { - var template = templates.suggestion; - return $(template(context)).attr("id", _.guid()); - } - function suggestionTemplate(context) { - return $('
').attr("id", _.guid()).text(displayFn(context)); - } - } - function isValidName(str) { - return /^[_a-zA-Z0-9-]+$/.test(str); - } - }(); - var Menu = function() { - "use strict"; - function Menu(o, www) { - var that = this; - o = o || {}; - if (!o.node) { - $.error("node is required"); - } - www.mixin(this); - this.$node = $(o.node); - this.query = null; - this.datasets = _.map(o.datasets, initializeDataset); - function initializeDataset(oDataset) { - var node = that.$node.find(oDataset.node).first(); - oDataset.node = node.length ? node : $("
").appendTo(that.$node); - return new Dataset(oDataset, www); - } - } - _.mixin(Menu.prototype, EventEmitter, { - _onSelectableClick: function onSelectableClick($e) { - this.trigger("selectableClicked", $($e.currentTarget)); - }, - _onRendered: function onRendered(type, dataset, suggestions, async) { - this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); - this.trigger("datasetRendered", dataset, suggestions, async); - }, - _onCleared: function onCleared() { - this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); - this.trigger("datasetCleared"); - }, - _propagate: function propagate() { - this.trigger.apply(this, arguments); - }, - _allDatasetsEmpty: function allDatasetsEmpty() { - return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { - var isEmpty = dataset.isEmpty(); - this.$node.attr("aria-expanded", !isEmpty); - return isEmpty; - }, this)); - }, - _getSelectables: function getSelectables() { - return this.$node.find(this.selectors.selectable); - }, - _removeCursor: function _removeCursor() { - var $selectable = this.getActiveSelectable(); - $selectable && $selectable.removeClass(this.classes.cursor); - }, - _ensureVisible: function ensureVisible($el) { - var elTop, elBottom, nodeScrollTop, nodeHeight; - elTop = $el.position().top; - elBottom = elTop + $el.outerHeight(true); - nodeScrollTop = this.$node.scrollTop(); - nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); - if (elTop < 0) { - this.$node.scrollTop(nodeScrollTop + elTop); - } else if (nodeHeight < elBottom) { - this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); - } - }, - bind: function() { - var that = this, onSelectableClick; - onSelectableClick = _.bind(this._onSelectableClick, this); - this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); - this.$node.on("mouseover", this.selectors.selectable, function() { - that.setCursor($(this)); - }); - this.$node.on("mouseleave", function() { - that._removeCursor(); - }); - _.each(this.datasets, function(dataset) { - dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); - }); - return this; - }, - isOpen: function isOpen() { - return this.$node.hasClass(this.classes.open); - }, - open: function open() { - this.$node.scrollTop(0); - this.$node.addClass(this.classes.open); - }, - close: function close() { - this.$node.attr("aria-expanded", false); - this.$node.removeClass(this.classes.open); - this._removeCursor(); - }, - setLanguageDirection: function setLanguageDirection(dir) { - this.$node.attr("dir", dir); - }, - selectableRelativeToCursor: function selectableRelativeToCursor(delta) { - var $selectables, $oldCursor, oldIndex, newIndex; - $oldCursor = this.getActiveSelectable(); - $selectables = this._getSelectables(); - oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; - newIndex = oldIndex + delta; - newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; - newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; - return newIndex === -1 ? null : $selectables.eq(newIndex); - }, - setCursor: function setCursor($selectable) { - this._removeCursor(); - if ($selectable = $selectable && $selectable.first()) { - $selectable.addClass(this.classes.cursor); - this._ensureVisible($selectable); - } - }, - getSelectableData: function getSelectableData($el) { - return $el && $el.length ? Dataset.extractData($el) : null; - }, - getActiveSelectable: function getActiveSelectable() { - var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); - return $selectable.length ? $selectable : null; - }, - getTopSelectable: function getTopSelectable() { - var $selectable = this._getSelectables().first(); - return $selectable.length ? $selectable : null; - }, - update: function update(query) { - var isValidUpdate = query !== this.query; - if (isValidUpdate) { - this.query = query; - _.each(this.datasets, updateDataset); - } - return isValidUpdate; - function updateDataset(dataset) { - dataset.update(query); - } - }, - empty: function empty() { - _.each(this.datasets, clearDataset); - this.query = null; - this.$node.addClass(this.classes.empty); - function clearDataset(dataset) { - dataset.clear(); - } - }, - destroy: function destroy() { - this.$node.off(".tt"); - this.$node = $("
"); - _.each(this.datasets, destroyDataset); - function destroyDataset(dataset) { - dataset.destroy(); - } - } - }); - return Menu; - }(); - var Status = function() { - "use strict"; - function Status(options) { - this.$el = $("", { - role: "status", - "aria-live": "polite" - }).css({ - position: "absolute", - padding: "0", - border: "0", - height: "1px", - width: "1px", - "margin-bottom": "-1px", - "margin-right": "-1px", - overflow: "hidden", - clip: "rect(0 0 0 0)", - "white-space": "nowrap" - }); - options.$input.after(this.$el); - _.each(options.menu.datasets, _.bind(function(dataset) { - if (dataset.onSync) { - dataset.onSync("rendered", _.bind(this.update, this)); - dataset.onSync("cleared", _.bind(this.cleared, this)); - } - }, this)); - } - _.mixin(Status.prototype, { - update: function update(event, suggestions) { - var length = suggestions.length; - var words; - if (length === 1) { - words = { - result: "result", - is: "is" - }; - } else { - words = { - result: "results", - is: "are" - }; - } - this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); - }, - cleared: function() { - this.$el.text(""); - } - }); - return Status; - }(); - var DefaultMenu = function() { - "use strict"; - var s = Menu.prototype; - function DefaultMenu() { - Menu.apply(this, [].slice.call(arguments, 0)); - } - _.mixin(DefaultMenu.prototype, Menu.prototype, { - open: function open() { - !this._allDatasetsEmpty() && this._show(); - return s.open.apply(this, [].slice.call(arguments, 0)); - }, - close: function close() { - this._hide(); - return s.close.apply(this, [].slice.call(arguments, 0)); - }, - _onRendered: function onRendered() { - if (this._allDatasetsEmpty()) { - this._hide(); - } else { - this.isOpen() && this._show(); - } - return s._onRendered.apply(this, [].slice.call(arguments, 0)); - }, - _onCleared: function onCleared() { - if (this._allDatasetsEmpty()) { - this._hide(); - } else { - this.isOpen() && this._show(); - } - return s._onCleared.apply(this, [].slice.call(arguments, 0)); - }, - setLanguageDirection: function setLanguageDirection(dir) { - this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); - return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); - }, - _hide: function hide() { - this.$node.hide(); - }, - _show: function show() { - this.$node.css("display", "block"); - } - }); - return DefaultMenu; - }(); - var Typeahead = function() { - "use strict"; - function Typeahead(o, www) { - var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; - o = o || {}; - if (!o.input) { - $.error("missing input"); - } - if (!o.menu) { - $.error("missing menu"); - } - if (!o.eventBus) { - $.error("missing event bus"); - } - www.mixin(this); - this.eventBus = o.eventBus; - this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; - this.input = o.input; - this.menu = o.menu; - this.enabled = true; - this.autoselect = !!o.autoselect; - this.active = false; - this.input.hasFocus() && this.activate(); - this.dir = this.input.getLangDir(); - this._hacks(); - this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); - onFocused = c(this, "activate", "open", "_onFocused"); - onBlurred = c(this, "deactivate", "_onBlurred"); - onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); - onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); - onEscKeyed = c(this, "isActive", "_onEscKeyed"); - onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); - onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); - onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); - onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); - onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); - onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); - this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); - } - _.mixin(Typeahead.prototype, { - _hacks: function hacks() { - var $input, $menu; - $input = this.input.$input || $("
"); - $menu = this.menu.$node || $("
"); - $input.on("blur.tt", function($e) { - var active, isActive, hasActive; - active = document.activeElement; - isActive = $menu.is(active); - hasActive = $menu.has(active).length > 0; - if (_.isMsie() && (isActive || hasActive)) { - $e.preventDefault(); - $e.stopImmediatePropagation(); - _.defer(function() { - $input.focus(); - }); - } - }); - $menu.on("mousedown.tt", function($e) { - $e.preventDefault(); - }); - }, - _onSelectableClicked: function onSelectableClicked(type, $el) { - this.select($el); - }, - _onDatasetCleared: function onDatasetCleared() { - this._updateHint(); - }, - _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { - this._updateHint(); - if (this.autoselect) { - var cursorClass = this.selectors.cursor.substr(1); - this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); - } - this.eventBus.trigger("render", suggestions, async, dataset); - }, - _onAsyncRequested: function onAsyncRequested(type, dataset, query) { - this.eventBus.trigger("asyncrequest", query, dataset); - }, - _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { - this.eventBus.trigger("asynccancel", query, dataset); - }, - _onAsyncReceived: function onAsyncReceived(type, dataset, query) { - this.eventBus.trigger("asyncreceive", query, dataset); - }, - _onFocused: function onFocused() { - this._minLengthMet() && this.menu.update(this.input.getQuery()); - }, - _onBlurred: function onBlurred() { - if (this.input.hasQueryChangedSinceLastFocus()) { - this.eventBus.trigger("change", this.input.getQuery()); - } - }, - _onEnterKeyed: function onEnterKeyed(type, $e) { - var $selectable; - if ($selectable = this.menu.getActiveSelectable()) { - if (this.select($selectable)) { - $e.preventDefault(); - $e.stopPropagation(); - } - } else if (this.autoselect) { - if (this.select(this.menu.getTopSelectable())) { - $e.preventDefault(); - $e.stopPropagation(); - } - } - }, - _onTabKeyed: function onTabKeyed(type, $e) { - var $selectable; - if ($selectable = this.menu.getActiveSelectable()) { - this.select($selectable) && $e.preventDefault(); - } else if (this.autoselect) { - if ($selectable = this.menu.getTopSelectable()) { - this.autocomplete($selectable) && $e.preventDefault(); - } - } - }, - _onEscKeyed: function onEscKeyed() { - this.close(); - }, - _onUpKeyed: function onUpKeyed() { - this.moveCursor(-1); - }, - _onDownKeyed: function onDownKeyed() { - this.moveCursor(+1); - }, - _onLeftKeyed: function onLeftKeyed() { - if (this.dir === "rtl" && this.input.isCursorAtEnd()) { - this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); - } - }, - _onRightKeyed: function onRightKeyed() { - if (this.dir === "ltr" && this.input.isCursorAtEnd()) { - this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); - } - }, - _onQueryChanged: function onQueryChanged(e, query) { - this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); - }, - _onWhitespaceChanged: function onWhitespaceChanged() { - this._updateHint(); - }, - _onLangDirChanged: function onLangDirChanged(e, dir) { - if (this.dir !== dir) { - this.dir = dir; - this.menu.setLanguageDirection(dir); - } - }, - _openIfActive: function openIfActive() { - this.isActive() && this.open(); - }, - _minLengthMet: function minLengthMet(query) { - query = _.isString(query) ? query : this.input.getQuery() || ""; - return query.length >= this.minLength; - }, - _updateHint: function updateHint() { - var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; - $selectable = this.menu.getTopSelectable(); - data = this.menu.getSelectableData($selectable); - val = this.input.getInputValue(); - if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { - query = Input.normalizeQuery(val); - escapedQuery = _.escapeRegExChars(query); - frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); - match = frontMatchRegEx.exec(data.val); - match && this.input.setHint(val + match[1]); - } else { - this.input.clearHint(); - } - }, - isEnabled: function isEnabled() { - return this.enabled; - }, - enable: function enable() { - this.enabled = true; - }, - disable: function disable() { - this.enabled = false; - }, - isActive: function isActive() { - return this.active; - }, - activate: function activate() { - if (this.isActive()) { - return true; - } else if (!this.isEnabled() || this.eventBus.before("active")) { - return false; - } else { - this.active = true; - this.eventBus.trigger("active"); - return true; - } - }, - deactivate: function deactivate() { - if (!this.isActive()) { - return true; - } else if (this.eventBus.before("idle")) { - return false; - } else { - this.active = false; - this.close(); - this.eventBus.trigger("idle"); - return true; - } - }, - isOpen: function isOpen() { - return this.menu.isOpen(); - }, - open: function open() { - if (!this.isOpen() && !this.eventBus.before("open")) { - this.input.setAriaExpanded(true); - this.menu.open(); - this._updateHint(); - this.eventBus.trigger("open"); - } - return this.isOpen(); - }, - close: function close() { - if (this.isOpen() && !this.eventBus.before("close")) { - this.input.setAriaExpanded(false); - this.menu.close(); - this.input.clearHint(); - this.input.resetInputValue(); - this.eventBus.trigger("close"); - } - return !this.isOpen(); - }, - setVal: function setVal(val) { - this.input.setQuery(_.toStr(val)); - }, - getVal: function getVal() { - return this.input.getQuery(); - }, - select: function select($selectable) { - var data = this.menu.getSelectableData($selectable); - if (data && !this.eventBus.before("select", data.obj, data.dataset)) { - this.input.setQuery(data.val, true); - this.eventBus.trigger("select", data.obj, data.dataset); - this.close(); - return true; - } - return false; - }, - autocomplete: function autocomplete($selectable) { - var query, data, isValid; - query = this.input.getQuery(); - data = this.menu.getSelectableData($selectable); - isValid = data && query !== data.val; - if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { - this.input.setQuery(data.val); - this.eventBus.trigger("autocomplete", data.obj, data.dataset); - return true; - } - return false; - }, - moveCursor: function moveCursor(delta) { - var query, $candidate, data, suggestion, datasetName, cancelMove, id; - query = this.input.getQuery(); - $candidate = this.menu.selectableRelativeToCursor(delta); - data = this.menu.getSelectableData($candidate); - suggestion = data ? data.obj : null; - datasetName = data ? data.dataset : null; - id = $candidate ? $candidate.attr("id") : null; - this.input.trigger("cursorchange", id); - cancelMove = this._minLengthMet() && this.menu.update(query); - if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { - this.menu.setCursor($candidate); - if (data) { - if (typeof data.val === "string") { - this.input.setInputValue(data.val); - } - } else { - this.input.resetInputValue(); - this._updateHint(); - } - this.eventBus.trigger("cursorchange", suggestion, datasetName); - return true; - } - return false; - }, - destroy: function destroy() { - this.input.destroy(); - this.menu.destroy(); - } - }); - return Typeahead; - function c(ctx) { - var methods = [].slice.call(arguments, 1); - return function() { - var args = [].slice.call(arguments); - _.each(methods, function(method) { - return ctx[method].apply(ctx, args); - }); - }; - } - }(); - (function() { - "use strict"; - var old, keys, methods; - old = $.fn.typeahead; - keys = { - www: "tt-www", - attrs: "tt-attrs", - typeahead: "tt-typeahead" - }; - methods = { - initialize: function initialize(o, datasets) { - var www; - datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); - o = o || {}; - www = WWW(o.classNames); - return this.each(attach); - function attach() { - var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; - _.each(datasets, function(d) { - d.highlight = !!o.highlight; - }); - $input = $(this); - $wrapper = $(www.html.wrapper); - $hint = $elOrNull(o.hint); - $menu = $elOrNull(o.menu); - defaultHint = o.hint !== false && !$hint; - defaultMenu = o.menu !== false && !$menu; - defaultHint && ($hint = buildHintFromInput($input, www)); - defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); - $hint && $hint.val(""); - $input = prepInput($input, www); - if (defaultHint || defaultMenu) { - $wrapper.css(www.css.wrapper); - $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); - $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); - } - MenuConstructor = defaultMenu ? DefaultMenu : Menu; - eventBus = new EventBus({ - el: $input - }); - input = new Input({ - hint: $hint, - input: $input, - menu: $menu - }, www); - menu = new MenuConstructor({ - node: $menu, - datasets: datasets - }, www); - status = new Status({ - $input: $input, - menu: menu - }); - typeahead = new Typeahead({ - input: input, - menu: menu, - eventBus: eventBus, - minLength: o.minLength, - autoselect: o.autoselect - }, www); - $input.data(keys.www, www); - $input.data(keys.typeahead, typeahead); - } - }, - isEnabled: function isEnabled() { - var enabled; - ttEach(this.first(), function(t) { - enabled = t.isEnabled(); - }); - return enabled; - }, - enable: function enable() { - ttEach(this, function(t) { - t.enable(); - }); - return this; - }, - disable: function disable() { - ttEach(this, function(t) { - t.disable(); - }); - return this; - }, - isActive: function isActive() { - var active; - ttEach(this.first(), function(t) { - active = t.isActive(); - }); - return active; - }, - activate: function activate() { - ttEach(this, function(t) { - t.activate(); - }); - return this; - }, - deactivate: function deactivate() { - ttEach(this, function(t) { - t.deactivate(); - }); - return this; - }, - isOpen: function isOpen() { - var open; - ttEach(this.first(), function(t) { - open = t.isOpen(); - }); - return open; - }, - open: function open() { - ttEach(this, function(t) { - t.open(); - }); - return this; - }, - close: function close() { - ttEach(this, function(t) { - t.close(); - }); - return this; - }, - select: function select(el) { - var success = false, $el = $(el); - ttEach(this.first(), function(t) { - success = t.select($el); - }); - return success; - }, - autocomplete: function autocomplete(el) { - var success = false, $el = $(el); - ttEach(this.first(), function(t) { - success = t.autocomplete($el); - }); - return success; - }, - moveCursor: function moveCursoe(delta) { - var success = false; - ttEach(this.first(), function(t) { - success = t.moveCursor(delta); - }); - return success; - }, - val: function val(newVal) { - var query; - if (!arguments.length) { - ttEach(this.first(), function(t) { - query = t.getVal(); - }); - return query; - } else { - ttEach(this, function(t) { - t.setVal(_.toStr(newVal)); - }); - return this; - } - }, - destroy: function destroy() { - ttEach(this, function(typeahead, $input) { - revert($input); - typeahead.destroy(); - }); - return this; - } - }; - $.fn.typeahead = function(method) { - if (methods[method]) { - return methods[method].apply(this, [].slice.call(arguments, 1)); - } else { - return methods.initialize.apply(this, arguments); - } - }; - $.fn.typeahead.noConflict = function noConflict() { - $.fn.typeahead = old; - return this; - }; - function ttEach($els, fn) { - $els.each(function() { - var $input = $(this), typeahead; - (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); - }); - } - function buildHintFromInput($input, www) { - return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ - readonly: true, - required: false - }).removeAttr("id name placeholder").removeClass("required").attr({ - spellcheck: "false", - tabindex: -1 - }); - } - function prepInput($input, www) { - $input.data(keys.attrs, { - dir: $input.attr("dir"), - autocomplete: $input.attr("autocomplete"), - spellcheck: $input.attr("spellcheck"), - style: $input.attr("style") - }); - $input.addClass(www.classes.input).attr({ - spellcheck: false - }); - try { - !$input.attr("dir") && $input.attr("dir", "auto"); - } catch (e) {} - return $input; - } - function getBackgroundStyles($el) { - return { - backgroundAttachment: $el.css("background-attachment"), - backgroundClip: $el.css("background-clip"), - backgroundColor: $el.css("background-color"), - backgroundImage: $el.css("background-image"), - backgroundOrigin: $el.css("background-origin"), - backgroundPosition: $el.css("background-position"), - backgroundRepeat: $el.css("background-repeat"), - backgroundSize: $el.css("background-size") - }; - } - function revert($input) { - var www, $wrapper; - www = $input.data(keys.www); - $wrapper = $input.parent().filter(www.selectors.wrapper); - _.each($input.data(keys.attrs), function(val, key) { - _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); - }); - $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); - if ($wrapper.length) { - $input.detach().insertAfter($wrapper); - $wrapper.remove(); - } - } - function $elOrNull(obj) { - var isValid, $el; - isValid = _.isJQuery(obj) || _.isElement(obj); - $el = isValid ? $(obj).first() : []; - return $el.length ? $el : null; - } - })(); -}); \ No newline at end of file diff --git a/large_tuple.html b/large_tuple.html deleted file mode 100644 index d1197bcaf..000000000 --- a/large_tuple.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - large_tuple Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Large Tuple

- -

Tuples shouldn’t have too many members. Create a custom type instead.

- -
    -
  • Identifier: large_tuple
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -2 -
    -error - -3 -
  • -
-

Non Triggering Examples

-
let foo: (Int, Int)
-
-
let foo: (start: Int, end: Int)
-
-
let foo: (Int, (Int, String))
-
-
func foo() -> (Int, Int)
-
-
func foo() -> (Int, Int) {}
-
-
func foo(bar: String) -> (Int, Int)
-
-
func foo(bar: String) -> (Int, Int) {}
-
-
func foo() throws -> (Int, Int)
-
-
func foo() throws -> (Int, Int) {}
-
-
let foo: (Int, Int, Int) -> Void
-
-
let foo: (Int, Int, Int) throws -> Void
-
-
func foo(bar: (Int, String, Float) -> Void)
-
-
func foo(bar: (Int, String, Float) throws -> Void)
-
-
var completionHandler: ((_ data: Data?, _ resp: URLResponse?, _ e: NSError?) -> Void)!
-
-
func getDictionaryAndInt() -> (Dictionary<Int, String>, Int)?
-
-
func getGenericTypeAndInt() -> (Type<Int, String, Float>, Int)?
-
-
func foo() async -> (Int, Int)
-
-
func foo() async -> (Int, Int) {}
-
-
func foo(bar: String) async -> (Int, Int)
-
-
func foo(bar: String) async -> (Int, Int) {}
-
-
func foo() async throws -> (Int, Int)
-
-
func foo() async throws -> (Int, Int) {}
-
-
let foo: (Int, Int, Int) async -> Void
-
-
let foo: (Int, Int, Int) async throws -> Void
-
-
func foo(bar: (Int, String, Float) async -> Void)
-
-
func foo(bar: (Int, String, Float) async throws -> Void)
-
-
func getDictionaryAndInt() async -> (Dictionary<Int, String>, Int)?
-
-
func getGenericTypeAndInt() async -> (Type<Int, String, Float>, Int)?
-
-

Triggering Examples

-
let foo: ↓(Int, Int, Int)
-
-
let foo: ↓(start: Int, end: Int, value: String)
-
-
let foo: (Int, ↓(Int, Int, Int))
-
-
func foo(bar: ↓(Int, Int, Int))
-
-
func foo() -> ↓(Int, Int, Int)
-
-
func foo() -> ↓(Int, Int, Int) {}
-
-
func foo(bar: String) -> ↓(Int, Int, Int)
-
-
func foo(bar: String) -> ↓(Int, Int, Int) {}
-
-
func foo() throws -> ↓(Int, Int, Int)
-
-
func foo() throws -> ↓(Int, Int, Int) {}
-
-
func foo() throws -> ↓(Int, ↓(String, String, String), Int) {}
-
-
func getDictionaryAndInt() -> (Dictionary<Int, ↓(String, String, String)>, Int)?
-
-
func foo(bar: ↓(Int, Int, Int)) async
-
-
func foo() async -> ↓(Int, Int, Int)
-
-
func foo() async -> ↓(Int, Int, Int) {}
-
-
func foo(bar: String) async -> ↓(Int, Int, Int)
-
-
func foo(bar: String) async -> ↓(Int, Int, Int) {}
-
-
func foo() async throws -> ↓(Int, Int, Int)
-
-
func foo() async throws -> ↓(Int, Int, Int) {}
-
-
func foo() async throws -> ↓(Int, ↓(String, String, String), Int) {}
-
-
func getDictionaryAndInt() async -> (Dictionary<Int, ↓(String, String, String)>, Int)?
-
- -
-
- - -
-
- - - diff --git a/last_where.html b/last_where.html deleted file mode 100644 index 9415a7d1f..000000000 --- a/last_where.html +++ /dev/null @@ -1,415 +0,0 @@ - - - - last_where Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Last Where

- -

Prefer using .last(where:) over .filter { }.last in collections

- -
    -
  • Identifier: last_where
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
kinds.filter(excludingKinds.contains).isEmpty && kinds.last == .identifier
-
-
myList.last(where: { $0 % 2 == 0 })
-
-
match(pattern: pattern).filter { $0.last == .identifier }
-
-
(myList.filter { $0 == 1 }.suffix(2)).last
-
-
collection.filter("stringCol = '3'").last
-
-

Triggering Examples

-
↓myList.filter { $0 % 2 == 0 }.last
-
-
↓myList.filter({ $0 % 2 == 0 }).last
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last
-
-
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last?.something()
-
-
↓myList.filter(someFunction).last
-
-
↓myList.filter({ $0 % 2 == 0 })
-.last
-
-
(↓myList.filter { $0 == 1 }).last
-
- -
-
- - -
-
- - - diff --git a/leading_whitespace.html b/leading_whitespace.html deleted file mode 100644 index a3a9e3655..000000000 --- a/leading_whitespace.html +++ /dev/null @@ -1,397 +0,0 @@ - - - - leading_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Leading Whitespace

- -

Files should not contain leading whitespace

- -
    -
  • Identifier: leading_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
//
-
-

Triggering Examples

-

-//
-
-
 //
-
- -
-
- - -
-
- - - diff --git a/legacy_cggeometry_functions.html b/legacy_cggeometry_functions.html deleted file mode 100644 index 6f1cd95dc..000000000 --- a/legacy_cggeometry_functions.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - legacy_cggeometry_functions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy CGGeometry Functions

- -

Struct extension properties and methods are preferred over legacy functions

- -
    -
  • Identifier: legacy_cggeometry_functions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
rect.width
-
-
rect.height
-
-
rect.minX
-
-
rect.midX
-
-
rect.maxX
-
-
rect.minY
-
-
rect.midY
-
-
rect.maxY
-
-
rect.isNull
-
-
rect.isEmpty
-
-
rect.isInfinite
-
-
rect.standardized
-
-
rect.integral
-
-
rect.insetBy(dx: 5.0, dy: -7.0)
-
-
rect.offsetBy(dx: 5.0, dy: -7.0)
-
-
rect1.union(rect2)
-
-
rect1.intersect(rect2)
-
-
rect1.contains(rect2)
-
-
rect.contains(point)
-
-
rect1.intersects(rect2)
-
-

Triggering Examples

-
↓CGRectGetWidth(rect)
-
-
↓CGRectGetHeight(rect)
-
-
↓CGRectGetMinX(rect)
-
-
↓CGRectGetMidX(rect)
-
-
↓CGRectGetMaxX(rect)
-
-
↓CGRectGetMinY(rect)
-
-
↓CGRectGetMidY(rect)
-
-
↓CGRectGetMaxY(rect)
-
-
↓CGRectIsNull(rect)
-
-
↓CGRectIsEmpty(rect)
-
-
↓CGRectIsInfinite(rect)
-
-
↓CGRectStandardize(rect)
-
-
↓CGRectIntegral(rect)
-
-
↓CGRectInset(rect, 10, 5)
-
-
↓CGRectOffset(rect, -2, 8.3)
-
-
↓CGRectUnion(rect1, rect2)
-
-
↓CGRectIntersection(rect1, rect2)
-
-
↓CGRectContainsRect(rect1, rect2)
-
-
↓CGRectContainsPoint(rect, point)
-
-
↓CGRectIntersectsRect(rect1, rect2)
-
- -
-
- - -
-
- - - diff --git a/legacy_constant.html b/legacy_constant.html deleted file mode 100644 index b37ebeefe..000000000 --- a/legacy_constant.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - legacy_constant Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Constant

- -

Struct-scoped constants are preferred over legacy global constants

- -
    -
  • Identifier: legacy_constant
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGRect.infinite
-
-
CGPoint.zero
-
-
CGRect.zero
-
-
CGSize.zero
-
-
NSPoint.zero
-
-
NSRect.zero
-
-
NSSize.zero
-
-
CGRect.null
-
-
CGFloat.pi
-
-
Float.pi
-
-

Triggering Examples

-
↓CGRectInfinite
-
-
↓CGPointZero
-
-
↓CGRectZero
-
-
↓CGSizeZero
-
-
↓NSZeroPoint
-
-
↓NSZeroRect
-
-
↓NSZeroSize
-
-
↓CGRectNull
-
-
↓CGFloat(M_PI)
-
-
↓Float(M_PI)
-
- -
-
- - -
-
- - - diff --git a/legacy_constructor.html b/legacy_constructor.html deleted file mode 100644 index 7a0343dec..000000000 --- a/legacy_constructor.html +++ /dev/null @@ -1,483 +0,0 @@ - - - - legacy_constructor Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Constructor

- -

Swift constructors are preferred over legacy convenience functions

- -
    -
  • Identifier: legacy_constructor
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGPoint(x: 10, y: 10)
-
-
CGPoint(x: xValue, y: yValue)
-
-
CGSize(width: 10, height: 10)
-
-
CGSize(width: aWidth, height: aHeight)
-
-
CGRect(x: 0, y: 0, width: 10, height: 10)
-
-
CGRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
-
-
CGVector(dx: 10, dy: 10)
-
-
CGVector(dx: deltaX, dy: deltaY)
-
-
NSPoint(x: 10, y: 10)
-
-
NSPoint(x: xValue, y: yValue)
-
-
NSSize(width: 10, height: 10)
-
-
NSSize(width: aWidth, height: aHeight)
-
-
NSRect(x: 0, y: 0, width: 10, height: 10)
-
-
NSRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
-
-
NSRange(location: 10, length: 1)
-
-
NSRange(location: loc, length: len)
-
-
UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
-
-
UIEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
-
-
NSEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
-
-
NSEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
-
-
UIOffset(horizontal: 0, vertical: 10)
-
-
UIOffset(horizontal: horizontal, vertical: vertical)
-
-

Triggering Examples

-
↓CGPointMake(10, 10)
-
-
↓CGPointMake(xVal, yVal)
-
-
↓CGPointMake(calculateX(), 10)
-
-
↓CGSizeMake(10, 10)
-
-
↓CGSizeMake(aWidth, aHeight)
-
-
↓CGRectMake(0, 0, 10, 10)
-
-
↓CGRectMake(xVal, yVal, width, height)
-
-
↓CGVectorMake(10, 10)
-
-
↓CGVectorMake(deltaX, deltaY)
-
-
↓NSMakePoint(10, 10)
-
-
↓NSMakePoint(xVal, yVal)
-
-
↓NSMakeSize(10, 10)
-
-
↓NSMakeSize(aWidth, aHeight)
-
-
↓NSMakeRect(0, 0, 10, 10)
-
-
↓NSMakeRect(xVal, yVal, width, height)
-
-
↓NSMakeRange(10, 1)
-
-
↓NSMakeRange(loc, len)
-
-
↓UIEdgeInsetsMake(0, 0, 10, 10)
-
-
↓UIEdgeInsetsMake(top, left, bottom, right)
-
-
↓NSEdgeInsetsMake(0, 0, 10, 10)
-
-
↓NSEdgeInsetsMake(top, left, bottom, right)
-
-
↓CGVectorMake(10, 10)
-↓NSMakeRange(10, 1)
-
-
↓UIOffsetMake(0, 10)
-
-
↓UIOffsetMake(horizontal, vertical)
-
- -
-
- - -
-
- - - diff --git a/legacy_hashing.html b/legacy_hashing.html deleted file mode 100644 index e9d04f076..000000000 --- a/legacy_hashing.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - legacy_hashing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Hashing

- -

Prefer using the hash(into:) function instead of overriding hashValue

- -
    -
  • Identifier: legacy_hashing
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct Foo: Hashable {
-  let bar: Int = 10
-
-  func hash(into hasher: inout Hasher) {
-    hasher.combine(bar)
-  }
-}
-
-
class Foo: Hashable {
-  let bar: Int = 10
-
-  func hash(into hasher: inout Hasher) {
-    hasher.combine(bar)
-  }
-}
-
-
var hashValue: Int { return 1 }
-class Foo: Hashable { 
- }
-
-
class Foo: Hashable {
-  let bar: String = "Foo"
-
-  public var hashValue: String {
-    return bar
-  }
-}
-
-
class Foo: Hashable {
-  let bar: String = "Foo"
-
-  public var hashValue: String {
-    get { return bar }
-    set { bar = newValue }
-  }
-}
-
-

Triggering Examples

-
struct Foo: Hashable {
-    let bar: Int = 10
-
-    public ↓var hashValue: Int {
-        return bar
-    }
-}
-
-
class Foo: Hashable {
-    let bar: Int = 10
-
-    public ↓var hashValue: Int {
-        return bar
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/legacy_multiple.html b/legacy_multiple.html deleted file mode 100644 index 37fe61119..000000000 --- a/legacy_multiple.html +++ /dev/null @@ -1,421 +0,0 @@ - - - - legacy_multiple Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Multiple

- -

Prefer using the isMultiple(of:) function instead of using the remainder operator (%)

- -
    -
  • Identifier: legacy_multiple
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
cell.contentView.backgroundColor = indexPath.row.isMultiple(of: 2) ? .gray : .white
-
-
guard count.isMultiple(of: 2) else { throw DecodingError.dataCorrupted(...) }
-
-
sanityCheck(bytes > 0 && bytes.isMultiple(of: 4), "capacity must be multiple of 4 bytes")
-
-
guard let i = reversedNumbers.firstIndex(where: { $0.isMultiple(of: 2) }) else { return }
-
-
let constant = 56
-let isMultiple = value.isMultiple(of: constant)
-
-
let constant = 56
-let secret = value % constant == 5
-
-
let secretValue = (value % 3) + 2
-
-

Triggering Examples

-
cell.contentView.backgroundColor = indexPath.row ↓% 2 == 0 ? .gray : .white
-
-
cell.contentView.backgroundColor = 0 == indexPath.row ↓% 2 ? .gray : .white
-
-
cell.contentView.backgroundColor = indexPath.row ↓% 2 != 0 ? .gray : .white
-
-
guard count ↓% 2 == 0 else { throw DecodingError.dataCorrupted(...) }
-
-
sanityCheck(bytes > 0 && bytes ↓% 4 == 0, "capacity must be multiple of 4 bytes")
-
-
guard let i = reversedNumbers.firstIndex(where: { $0 ↓% 2 == 0 }) else { return }
-
-
let constant = 56
-let isMultiple = value ↓% constant == 0
-
- -
-
- - -
-
- - - diff --git a/legacy_nsgeometry_functions.html b/legacy_nsgeometry_functions.html deleted file mode 100644 index 976041f71..000000000 --- a/legacy_nsgeometry_functions.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - legacy_nsgeometry_functions Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy NSGeometry Functions

- -

Struct extension properties and methods are preferred over legacy functions

- -
    -
  • Identifier: legacy_nsgeometry_functions
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
rect.width
-
-
rect.height
-
-
rect.minX
-
-
rect.midX
-
-
rect.maxX
-
-
rect.minY
-
-
rect.midY
-
-
rect.maxY
-
-
rect.isEmpty
-
-
rect.integral
-
-
rect.insetBy(dx: 5.0, dy: -7.0)
-
-
rect.offsetBy(dx: 5.0, dy: -7.0)
-
-
rect1.union(rect2)
-
-
rect1.intersection(rect2)
-
-
rect1.contains(rect2)
-
-
rect.contains(point)
-
-
rect1.intersects(rect2)
-
-

Triggering Examples

-
↓NSWidth(rect)
-
-
↓NSHeight(rect)
-
-
↓NSMinX(rect)
-
-
↓NSMidX(rect)
-
-
↓NSMaxX(rect)
-
-
↓NSMinY(rect)
-
-
↓NSMidY(rect)
-
-
↓NSMaxY(rect)
-
-
↓NSEqualRects(rect1, rect2)
-
-
↓NSEqualSizes(size1, size2)
-
-
↓NSEqualPoints(point1, point2)
-
-
↓NSEdgeInsetsEqual(insets2, insets2)
-
-
↓NSIsEmptyRect(rect)
-
-
↓NSIntegralRect(rect)
-
-
↓NSInsetRect(rect, 10, 5)
-
-
↓NSOffsetRect(rect, -2, 8.3)
-
-
↓NSUnionRect(rect1, rect2)
-
-
↓NSIntersectionRect(rect1, rect2)
-
-
↓NSContainsRect(rect1, rect2)
-
-
↓NSPointInRect(rect, point)
-
-
↓NSIntersectsRect(rect1, rect2)
-
- -
-
- - -
-
- - - diff --git a/legacy_objc_type.html b/legacy_objc_type.html deleted file mode 100644 index ae742c22f..000000000 --- a/legacy_objc_type.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - legacy_objc_type Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Objective-C Reference Type

- -

Prefer Swift value types to bridged Objective-C reference types

- -
    -
  • Identifier: legacy_objc_type
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var array = Array<Int>()
-
-
var calendar: Calendar? = nil
-
-
var formatter: NSDataDetector
-
-
var className: String = NSStringFromClass(MyClass.self)
-
-
_ = URLRequest.CachePolicy.reloadIgnoringLocalCacheData
-
-
_ = Notification.Name("com.apple.Music.playerInfo")
-
-

Triggering Examples

-
var array = ↓NSArray()
-
-
var calendar: ↓NSCalendar? = nil
-
-
_ = ↓NSURLRequest.CachePolicy.reloadIgnoringLocalCacheData
-
-
_ = ↓NSNotification.Name("com.apple.Music.playerInfo")
-
-
let keyValuePair: (Int) -> (↓NSString, ↓NSString) = {
-  let n = "\($0)" as ↓NSString; return (n, n)
-}
-dictionary = [↓NSString: ↓NSString](uniqueKeysWithValues:
-  (1...10_000).lazy.map(keyValuePair))
-
-
extension Foundation.Notification.Name {
-    static var reachabilityChanged: Foundation.↓NSNotification.Name {
-        return Foundation.Notification.Name("org.wordpress.reachability.changed")
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/legacy_random.html b/legacy_random.html deleted file mode 100644 index 932aa6c7e..000000000 --- a/legacy_random.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - legacy_random Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Legacy Random

- -

Prefer using type.random(in:) over legacy functions

- -
    -
  • Identifier: legacy_random
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Int.random(in: 0..<10)
-
-
Double.random(in: 8.6...111.34)
-
-
Float.random(in: 0 ..< 1)
-
-

Triggering Examples

-
↓arc4random()
-
-
↓arc4random_uniform(83)
-
-
↓drand48()
-
- -
-
- - -
-
- - - diff --git a/let_var_whitespace.html b/let_var_whitespace.html deleted file mode 100644 index b9b9891a3..000000000 --- a/let_var_whitespace.html +++ /dev/null @@ -1,565 +0,0 @@ - - - - let_var_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Variable Declaration Whitespace

- -

Variable declarations should be separated from other statements by a blank line

- -
    -
  • Identifier: let_var_whitespace
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    let a = 0
-    var x = 1
-
-    var y = 2
-}
-
-
class C {
-    let a = 5
-
-    var x = 1
-}
-
-
class C {
-    var a = 0
-}
-
-
class C {
-    let a = 1 +
-        2
-    let b = 5
-}
-
-
class C {
-    var x: Int {
-        return 0
-    }
-}
-
-
class C {
-    var x: Int {
-        let a = 0
-
-        return a
-    }
-}
-
-
class C {
-    #if os(macOS)
-    let a = 0
-
-    func f() {}
-    #endif
-}
-
-
class C {
-    #warning("TODO: remove it")
-    let a = 0
-    #warning("TODO: remove it")
-    let b = 0
-}
-
-
class C {
-    #error("TODO: remove it")
-    let a = 0
-}
-
-
class C {
-    @available(swift 4)
-    let a = 0
-}
-
-
class C {
-    @objc
-    var s: String = ""
-}
-
-
class C {
-    @objc
-    func a() {}
-}
-
-
class C {
-    var x = 0
-    lazy
-    var y = 0
-}
-
-
class C {
-    @available(OSX, introduced: 10.6)
-    @available(*, deprecated)
-    var x = 0
-}
-
-
class C {
-    // swiftlint:disable superfluous_disable_command
-    // swiftlint:disable force_cast
-
-    let x = bar as! Bar
-}
-
-
class C {
-    @available(swift 4)
-    @UserDefault("param", defaultValue: true)
-    var isEnabled = true
-
-    @Attribute
-    func f() {}
-}
-
-
class C {
-    var x: Int {
-        let a = 0
-        return a
-    }
-}
-
-
    a = 2
-
-
    a = 2
-
-    var b = 3
-
-
    #warning("message")
-    let a = 2
-
-
    #if os(macOS)
-    let a = 2
-    #endif
-
-
    f {
-        let a = 1
-        return a
-    }
-
-
    func f() {
-        #if os(macOS)
-        let a = 2
-        return a
-        #else
-        return 1
-        #endif
-    }
-
-

Triggering Examples

-
class C {
-    let a
-    ↓func x() {}
-}
-
-
class C {
-    var x = 0
-    ↓@objc func f() {}
-}
-
-
class C {
-    var x = 0
-    ↓@objc
-    func f() {}
-}
-
-
class C {
-    @objc func f() {
-    }
-    ↓var x = 0
-}
-
-
class C {
-    func f() {}
-    ↓@Wapper
-    let isNumber = false
-    @Wapper
-    var isEnabled = true
-    ↓func g() {}
-}
-
-
class C {
-    #if os(macOS)
-    let a = 0
-    ↓func f() {}
-    #endif
-}
-
-
    let a = 2
-    ↓b = 1
-
- -
-
- - -
-
- - - diff --git a/line_length.html b/line_length.html deleted file mode 100644 index f0a056721..000000000 --- a/line_length.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - line_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Line Length

- -

Lines should not span too many characters.

- -
    -
  • Identifier: line_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -120 -
    -error - -200 -
    -ignores_urls - -false -
    -ignores_function_declarations - -false -
    -ignores_comments - -false -
    -ignores_interpolated_strings - -false -
    -excluded_lines_patterns - -[] -
  • -
-

Non Triggering Examples

-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
-
-

Triggering Examples

-
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
-
- -
-
- - -
-
- - - diff --git a/literal_expression_end_indentation.html b/literal_expression_end_indentation.html deleted file mode 100644 index 8803c86a7..000000000 --- a/literal_expression_end_indentation.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - literal_expression_end_indentation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Literal Expression End Indentation

- -

Array and dictionary literal end should have the same indentation as the line that started it

- -
    -
  • Identifier: literal_expression_end_indentation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2, 3]
-
-
[1,
- 2
-]
-
-
[
-   1,
-   2
-]
-
-
[
-   1,
-   2]
-
-
   let x = [
-       1,
-       2
-   ]
-
-
[key: 2, key2: 3]
-
-
[key: 1,
- key2: 2
-]
-
-
[
-   key: 0,
-   key2: 20
-]
-
-

Triggering Examples

-
let x = [
-   1,
-   2
-   ↓]
-
-
   let x = [
-       1,
-       2
-↓]
-
-
let x = [
-   key: value
-   ↓]
-
- -
-
- - -
-
- - - diff --git a/local_doc_comment.html b/local_doc_comment.html deleted file mode 100644 index 344d019ba..000000000 --- a/local_doc_comment.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - local_doc_comment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Local Doc Comment

- -

Prefer regular comments over doc comments in local scopes

- -
    -
  • Identifier: local_doc_comment
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-  // Local scope documentation should use normal comments.
-  print("foo")
-}
-
-
/// My great property
-var myGreatProperty: String!
-
-
/// Look here for more info: https://github.com.
-var myGreatProperty: String!
-
-
/// Look here for more info:
-/// https://github.com.
-var myGreatProperty: String!
-
-

Triggering Examples

-
func foo() {
-  ↓/// Docstring inside a function declaration
-  print("foo")
-}
-
- -
-
- - -
-
- - - diff --git a/lower_acl_than_parent.html b/lower_acl_than_parent.html deleted file mode 100644 index 8c09235ad..000000000 --- a/lower_acl_than_parent.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - lower_acl_than_parent Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Lower ACL than Parent

- -

Ensure declarations have a lower access control level than their enclosing parent

- -
    -
  • Identifier: lower_acl_than_parent
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
public struct Foo { public func bar() {} }
-
-
internal struct Foo { func bar() {} }
-
-
struct Foo { func bar() {} }
-
-
struct Foo { internal func bar() {} }
-
-
open class Foo { public func bar() {} }
-
-
open class Foo { open func bar() {} }
-
-
fileprivate struct Foo { private func bar() {} }
-
-
private struct Foo { private func bar(id: String) }
-
-
extension Foo { public func bar() {} }
-
-
private struct Foo { fileprivate func bar() {} }
-
-
private func foo(id: String) {}
-
-
private class Foo { func bar() {} }
-
-
public extension Foo { struct Bar { public func baz() {} }}
-
-
public extension Foo { struct Bar { internal func baz() {} }}
-
-
internal extension Foo { struct Bar { internal func baz() {} }}
-
-
extension Foo { struct Bar { internal func baz() {} }}
-
-

Triggering Examples

-
struct Foo { ↓public func bar() {} }
-
-
enum Foo { ↓public func bar() {} }
-
-
public class Foo { ↓open func bar() }
-
-
class Foo { ↓public private(set) var bar: String? }
-
-
private struct Foo { ↓public func bar() {} }
-
-
private class Foo { ↓public func bar() {} }
-
-
private actor Foo { ↓public func bar() {} }
-
-
fileprivate struct Foo { ↓public func bar() {} }
-
-
class Foo { ↓public func bar() {} }
-
-
actor Foo { ↓public func bar() {} }
-
-
private struct Foo { ↓internal func bar() {} }
-
-
fileprivate struct Foo { ↓internal func bar() {} }
-
-
extension Foo { struct Bar { ↓public func baz() {} }}
-
-
internal extension Foo { struct Bar { ↓public func baz() {} }}
-
-
private extension Foo { struct Bar { ↓public func baz() {} }}
-
-
fileprivate extension Foo { struct Bar { ↓public func baz() {} }}
-
-
private extension Foo { struct Bar { ↓internal func baz() {} }}
-
-
fileprivate extension Foo { struct Bar { ↓internal func baz() {} }}
-
-
public extension Foo { struct Bar { struct Baz { ↓public func qux() {} }}}
-
-
final class Foo { ↓public func bar() {} }
-
- -
-
- - -
-
- - - diff --git a/mark.html b/mark.html deleted file mode 100644 index f0c60b082..000000000 --- a/mark.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - mark Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Mark

- -

MARK comment should be in valid format. e.g. ‘// MARK: …’ or ‘// MARK: - …’

- -
    -
  • Identifier: mark
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
// MARK: good
-
-
// MARK: - good
-
-
// MARK: -
-
-
// MARK: - 
-
-
// BOOKMARK
-
-
//BOOKMARK
-
-
// BOOKMARKS
-
-
// MARK: This is good.
-
-
// MARK: - This is good.
-
-
// MARK: --- This is good. ---
-
-
// MARK: – This is dash separator
-
-
// Mark text
-
-
//  MarkdownText.swift
-
-
// MARK: good
-func foo() {
-    let bar = 0
-      // MARK: good
-}
-
-
/*
-func test1() {
-}
-//MARK: mark
-func test2() {
-}
-*/
-
-

Triggering Examples

-
↓//MARK: bad
-
-
↓// MARK:bad
-
-
↓//MARK:bad
-
-
↓//  MARK: bad
-
-
↓// MARK:  bad
-
-
↓// MARK: -bad
-
-
↓// MARK:- bad
-
-
↓// MARK:-bad
-
-
↓//MARK: - bad
-
-
↓//MARK:- bad
-
-
↓//MARK: -bad
-
-
↓//MARK:-bad
-
-
↓//Mark: bad
-
-
↓// Mark: bad
-
-
↓// MARK bad
-
-
↓//MARK bad
-
-
↓// MARK - bad
-
-
↓//MARK : bad
-
-
↓// MARKL:
-
-
↓// MARKR 
-
-
↓// MARKK -
-
-
↓/// MARK:
-
-
↓/// MARK bad
-
-
// MARK: good
-func foo() {
-    let bar = 0
-      ↓//MARK: bad
-}
-
-
↓//MARK:- Top-Level bad mark
-↓//MARK:- Another bad mark
-struct MarkTest {}
-↓// MARK:- Bad mark
-extension MarkTest {}
-
- -
-
- - -
-
- - - diff --git a/missing_docs.html b/missing_docs.html deleted file mode 100644 index f74b0addd..000000000 --- a/missing_docs.html +++ /dev/null @@ -1,463 +0,0 @@ - - - - missing_docs Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Missing Docs

- -

Declarations should be documented.

- -
    -
  • Identifier: missing_docs
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -[open, public] -
    -excludes_extensions - -true -
    -excludes_inherited_types - -true -
    -excludes_trivial_init - -false -
  • -
-

Non Triggering Examples

-
/// docs
-public class A {
-/// docs
-public func b() {}
-}
-// no docs
-public class B: A { override public func b() {} }
-
-
import Foundation
-// no docs
-public class B: NSObject {
-// no docs
-override public var description: String { fatalError() } }
-
-
/// docs
-public class A {
-    deinit {}
-}
-
-
public extension A {}
-
-
/// docs
-public class A {
-    public init() {}
-}
-
-

Triggering Examples

-
public func a() {}
-
-
// regular comment
-public func a() {}
-
-
/* regular comment */
-public func a() {}
-
-
/// docs
-public protocol A {
-// no docs
-var b: Int { get } }
-/// docs
-public struct C: A {
-
-public let b: Int
-}
-
-
/// docs
-public class A {
-    public init(argument: String) {}
-}
-
- -
-
- - -
-
- - - diff --git a/modifier_order.html b/modifier_order.html deleted file mode 100644 index 0080e61b7..000000000 --- a/modifier_order.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - modifier_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Modifier Order

- -

Modifier order should be consistent.

- -
    -
  • Identifier: modifier_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -preferred_modifier_order - -[override, acl, setterACL, dynamic, mutators, lazy, final, required, convenience, typeMethods, owned] -
  • -
-

Non Triggering Examples

-
public class Foo {
-   public required convenience init() {}
-}
-
-
public class Foo {
-   public static let bar = 42
-}
-
-
public class Foo {
-   public static var bar: Int {
-       return
-   }
-}
-
-
public class Foo {
-   public class var bar: Int {
-       return 42
-   }
-}
-
-
public class Bar {
-   public class var foo: String {
-       return "foo"
-   }
-}
-public class Foo: Bar {
-   override public final class var foo: String {
-       return "bar"
-   }
-}
-
-
open class Bar {
-   public var foo: Int? {
-       return 42
-   }
-}
-open class Foo: Bar {
-   override public var foo: Int? {
-       return 43
-   }
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   override open class func foo() -> Int {
-       return 43
-   }
-}
-
-
protocol Foo: class {}
-class Bar {
-    public private(set) weak var foo: Foo?
-}
-
-
@objc
-public final class Foo: NSObject {}
-
-
@objcMembers
-public final class Foo: NSObject {}
-
-
@objc
-override public private(set) weak var foo: Bar?
-
-
@objc
-public final class Foo: NSObject {}
-
-
@objc
-open final class Foo: NSObject {
-   open weak var weakBar: NSString? = nil
-}
-
-
public final class Foo {}
-
-
class Bar {
-   func bar() {}
-}
-
-
internal class Foo: Bar {
-   override internal func bar() {}
-}
-
-
public struct Foo {
-   internal weak var weakBar: NSObject? = nil
-}
-
-
class Foo {
-   internal lazy var bar: String = "foo"
-}
-
-

Triggering Examples

-
class Foo {
-   convenience required public init() {}
-}
-
-
public class Foo {
-   static public let bar = 42
-}
-
-
public class Foo {
-   static public var bar: Int {
-       return 42
-   }
-}
-
-
public class Foo {
-   class public var bar: Int {
-       return 42
-   }
-}
-
-
public class RootFoo {
-   class public var foo: String {
-       return "foo"
-   }
-}
-public class Foo: RootFoo {
-   override final class public var foo: String
-       return "bar"
-   }
-}
-
-
open class Bar {
-   public var foo: Int? {
-       return 42
-   }
-}
-open class Foo: Bar {
-    public override var foo: Int? {
-       return 43
-   }
-}
-
-
protocol Foo: class {}
-    class Bar {
-        private(set) public weak var foo: Foo?
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   class open override func foo() -> Int {
-       return 43
-   }
-}
-
-
open class Bar {
-   open class func foo() -> Int {
-       return 42
-   }
-}
-class Foo: Bar {
-   open override class func foo() -> Int {
-       return 43
-   }
-}
-
-
@objc
-final public class Foo: NSObject {}
-
-
@objcMembers
-final public class Foo: NSObject {}
-
-
@objc
-final open class Foo: NSObject {
-   weak open var weakBar: NSString? = nil
-}
-
-
final public class Foo {}
-
-
internal class Foo: Bar {
-   internal override func bar() {}
-}
-
-
public struct Foo {
-   weak internal var weakBar: NSObjetc? = nil
-}
-
-
class Foo {
-   lazy internal var bar: String = "foo"
-}
-
- -
-
- - -
-
- - - diff --git a/multiline_arguments.html b/multiline_arguments.html deleted file mode 100644 index d12438c2e..000000000 --- a/multiline_arguments.html +++ /dev/null @@ -1,491 +0,0 @@ - - - - multiline_arguments Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Arguments

- -

Arguments should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_arguments
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -first_argument_location - -any_line -
    -only_enforce_after_first_closure_on_first_line - -false -
  • -
-

Non Triggering Examples

-
foo()
-
-
foo(
-)
-
-
foo { }
-
-
foo {
-
-}
-
-
foo(0)
-
-
foo(0, 1)
-
-
foo(0, 1) { }
-
-
foo(0, param1: 1)
-
-
foo(0, param1: 1) { }
-
-
foo(param1: 1)
-
-
foo(param1: 1) { }
-
-
foo(param1: 1, param2: true) { }
-
-
foo(param1: 1, param2: true, param3: [3]) { }
-
-
foo(param1: 1, param2: true, param3: [3]) {
-    bar()
-}
-
-
foo(param1: 1,
-    param2: true,
-    param3: [3])
-
-
foo(
-    param1: 1, param2: true, param3: [3]
-)
-
-
foo(
-    param1: 1,
-    param2: true,
-    param3: [3]
-)
-
-
Picker(selection: viewStore.binding(\.$someProperty)) {
-   ForEach(SomeEnum.allCases, id: \.rawValue) { someCase in
-      Text(someCase.rawValue)
-         .tag(someCase)
-   }
-} label: {
-   EmptyView()
-}
-
-
UIView.animate(withDuration: 1,
-               delay: 0) {
-    // sample
-    print("a")
-} completion: { _ in
-    // sample
-    print("b")
-}
-
-
UIView.animate(withDuration: 1, delay: 0) {
-    print("a")
-} completion: { _ in
-    print("b")
-}
-
-

Triggering Examples

-
foo(0,
-    param1: 1, ↓param2: true, ↓param3: [3])
-
-
foo(0, ↓param1: 1,
-    param2: true, ↓param3: [3])
-
-
foo(0, ↓param1: 1, ↓param2: true,
-    param3: [3])
-
-
foo(
-    0, ↓param1: 1,
-    param2: true, ↓param3: [3]
-)
-
- -
-
- - -
-
- - - diff --git a/multiline_arguments_brackets.html b/multiline_arguments_brackets.html deleted file mode 100644 index 38ed5cc9a..000000000 --- a/multiline_arguments_brackets.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - multiline_arguments_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Arguments Brackets

- -

Multiline arguments should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_arguments_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo(param1: "Param1", param2: "Param2", param3: "Param3")
-
-
foo(
-    param1: "Param1", param2: "Param2", param3: "Param3"
-)
-
-
func foo(
-    param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"
-)
-
-
foo { param1, param2 in
-    print("hello world")
-}
-
-
foo(
-    bar(
-        x: 5,
-        y: 7
-    )
-)
-
-
AlertViewModel.AlertAction(title: "some title", style: .default) {
-    AlertManager.shared.presentNextDebugAlert()
-}
-
-
public final class Logger {
-    public static let shared = Logger(outputs: [
-        OSLoggerOutput(),
-        ErrorLoggerOutput()
-    ])
-}
-
-
let errors = try self.download([
-    (description: description, priority: priority),
-])
-
-
return SignalProducer({ observer, _ in
-    observer.sendCompleted()
-}).onMainQueue()
-
-
SomeType(a: [
-    1, 2, 3
-], b: [1, 2])
-
-
SomeType(
-  a: 1
-) { print("completion") }
-
-
SomeType(
-  a: 1
-) {
-  print("completion")
-}
-
-
SomeType(
-  a: .init() { print("completion") }
-)
-
-
SomeType(
-  a: .init() {
-    print("completion")
-  }
-)
-
-
SomeType(
-  a: 1
-) {} onError: {}
-
-

Triggering Examples

-
foo(↓param1: "Param1", param2: "Param2",
-         param3: "Param3"
-)
-
-
foo(
-    param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"↓)
-
-
foo(↓param1: "Param1",
-    param2: "Param2",
-    param3: "Param3"↓)
-
-
foo(↓bar(
-    x: 5,
-    y: 7
-)
-)
-
-
foo(
-    bar(
-        x: 5,
-        y: 7
-)↓)
-
-
SomeOtherType(↓a: [
-        1, 2, 3
-    ],
-    b: "two"↓)
-
-
SomeOtherType(
-  a: 1↓) {}
-
-
SomeOtherType(
-  a: 1↓) {
-  print("completion")
-}
-
- -
-
- - -
-
- - - diff --git a/multiline_function_chains.html b/multiline_function_chains.html deleted file mode 100644 index 1fdd0bdb7..000000000 --- a/multiline_function_chains.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - multiline_function_chains Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Function Chains

- -

Chained function calls should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_function_chains
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let evenSquaresSum = [20, 17, 35, 4].filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)
-
-
let evenSquaresSum = [20, 17, 35, 4]
-    .filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)",
-
-
let chain = a
-    .b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c { blah in print(blah) }
-    .d()
-
-
let chain = a.b(1, 2, 3)
-    .c(.init(
-        a: 1,
-        b, 2,
-        c, 3))
-    .d()
-
-
self.viewModel.outputs.postContextualNotification
-  .observeForUI()
-  .observeValues {
-    NotificationCenter.default.post(
-      Notification(
-        name: .ksr_showNotificationsDialog,
-        userInfo: [UserInfoKeys.context: PushNotificationDialog.Context.pledge,
-                   UserInfoKeys.viewController: self]
-     )
-    )
-  }
-
-
let remainingIDs = Array(Set(self.currentIDs).subtracting(Set(response.ids)))
-
-
self.happeningNewsletterOn = self.updateCurrentUser
-    .map { $0.newsletters.happening }.skipNil().skipRepeats()
-
-

Triggering Examples

-
let evenSquaresSum = [20, 17, 35, 4]
-    .filter { $0 % 2 == 0 }↓.map { $0 * $0 }
-    .reduce(0, +)
-
-
let evenSquaresSum = a.b(1, 2, 3)
-    .c { blah in
-        print(blah)
-    }↓.d()
-
-
let evenSquaresSum = a.b(1, 2, 3)
-    .c(2, 3, 4)↓.d()
-
-
let evenSquaresSum = a.b(1, 2, 3)↓.c { blah in
-        print(blah)
-    }
-    .d()
-
-
a.b {
-//  ““
-}↓.e()
-
- -
-
- - -
-
- - - diff --git a/multiline_literal_brackets.html b/multiline_literal_brackets.html deleted file mode 100644 index e9c9209a4..000000000 --- a/multiline_literal_brackets.html +++ /dev/null @@ -1,472 +0,0 @@ - - - - multiline_literal_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Literal Brackets

- -

Multiline literals should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_literal_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let trio = ["harry", "ronald", "hermione"]
-let houseCup = ["gryffindor": 460, "hufflepuff": 370, "ravenclaw": 410, "slytherin": 450]
-
-
let trio = [
-    "harry",
-    "ronald",
-    "hermione"
-]
-let houseCup = [
-    "gryffindor": 460,
-    "hufflepuff": 370,
-    "ravenclaw": 410,
-    "slytherin": 450
-]
-
-
let trio = [
-    "harry", "ronald", "hermione"
-]
-let houseCup = [
-    "gryffindor": 460, "hufflepuff": 370,
-    "ravenclaw": 410, "slytherin": 450
-]
-
-
    _ = [
-        1,
-        2,
-        3,
-        4,
-        5, 6,
-        7, 8, 9
-    ]
-
-

Triggering Examples

-
let trio = [↓"harry",
-            "ronald",
-            "hermione"
-]
-
-
let houseCup = [↓"gryffindor": 460, "hufflepuff": 370,
-                "ravenclaw": 410, "slytherin": 450
-]
-
-
let houseCup = [↓"gryffindor": 460,
-                "hufflepuff": 370,
-                "ravenclaw": 410,
-                "slytherin": 450↓]
-
-
let trio = [
-    "harry",
-    "ronald",
-    "hermione"↓]
-
-
let houseCup = [
-    "gryffindor": 460, "hufflepuff": 370,
-    "ravenclaw": 410, "slytherin": 450↓]
-
-
class Hogwarts {
-    let houseCup = [
-        "gryffindor": 460, "hufflepuff": 370,
-        "ravenclaw": 410, "slytherin": 450↓]
-}
-
-
    _ = [
-        1,
-        2,
-        3,
-        4,
-        5, 6,
-        7, 8, 9↓]
-
-
    _ = [↓1, 2, 3,
-         4, 5, 6,
-         7, 8, 9
-    ]
-
-
class Hogwarts {
-    let houseCup = [
-        "gryffindor": 460, "hufflepuff": 370,
-        "ravenclaw": 410, "slytherin": slytherinPoints.filter {
-            $0.isValid
-        }.sum()↓]
-}
-
- -
-
- - -
-
- - - diff --git a/multiline_parameters.html b/multiline_parameters.html deleted file mode 100644 index 452bae98b..000000000 --- a/multiline_parameters.html +++ /dev/null @@ -1,756 +0,0 @@ - - - - multiline_parameters Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Parameters

- -

Functions and methods parameters should be either on the same line, or one per line

- -
    -
  • Identifier: multiline_parameters
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allows_single_line - -true -
  • -
-

Non Triggering Examples

-
func foo() { }
-
-
func foo(param1: Int) { }
-
-
func foo(param1: Int, param2: Bool) { }
-
-
func foo(param1: Int, param2: Bool, param3: [String]) { }
-
-
func foo(param1: Int,
-         param2: Bool,
-         param3: [String]) { }
-
-
func foo(_ param1: Int, param2: Int, param3: Int) -> (Int) -> Int {
-   return { x in x + param1 + param2 + param3 }
-}
-
-
static func foo() { }
-
-
static func foo(param1: Int) { }
-
-
static func foo(param1: Int, param2: Bool) { }
-
-
static func foo(param1: Int, param2: Bool, param3: [String]) { }
-
-
static func foo(param1: Int,
-                param2: Bool,
-                param3: [String]) { }
-
-
protocol Foo {
-    func foo() { }
-}
-
-
protocol Foo {
-    func foo(param1: Int) { }
-}
-
-
protocol Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
protocol Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
protocol Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
protocol Foo {
-    class func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: [String]) { }
-}
-
-
enum Foo {
-    func foo() { }
-}
-
-
enum Foo {
-    func foo(param1: Int) { }
-}
-
-
enum Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
enum Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
enum Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
struct Foo {
-    func foo() { }
-}
-
-
struct Foo {
-    func foo(param1: Int) { }
-}
-
-
struct Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
struct Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
struct Foo {
-    static func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   static func foo(param1: Int,
-                   param2: Bool,
-                   param3: [String]) { }
-}
-
-
class Foo {
-    func foo() { }
-}
-
-
class Foo {
-    func foo(param1: Int) { }
-}
-
-
class Foo {
-    func foo(param1: Int, param2: Bool) { }
-}
-
-
class Foo {
-    func foo(param1: Int, param2: Bool, param3: [String]) { }
-    }
-
-
class Foo {
-   func foo(param1: Int,
-            param2: Bool,
-            param3: [String]) { }
-}
-
-
class Foo {
-    class func foo(param1: Int, param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: [String]) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int) -> Void = { _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping ((Int) -> Void)? = nil) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: @escaping ((Int) -> Void)? = { _ in },
-                  param3: Bool) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: @escaping ((Int) -> Void)? = { _ in },
-                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int) -> Void = { (x: Int) in }) { }
-}
-
-
class Foo {
-   class func foo(param1: Int,
-                  param2: Bool,
-                  param3: @escaping (Int, (Int) -> Void) -> Void = { (x: Int, f: (Int) -> Void) in }) { }
-}
-
-
class Foo {
-   init(param1: Int,
-        param2: Bool,
-        param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
func foo() { }
-
-
func foo(param1: Int) { }
-
-
protocol Foo {
-    func foo(param1: Int,
-             param2: Bool,
-             param3: [String]) { }
-}
-
-
protocol Foo {
-    func foo(
-        param1: Int
-    ) { }
-}
-
-
protocol Foo {
-    func foo(
-        param1: Int,
-        param2: Bool,
-        param3: [String]
-    ) { }
-}
-
-

Triggering Examples

-
func ↓foo(_ param1: Int,
-          param2: Int, param3: Int) -> (Int) -> Int {
-   return { x in x + param1 + param2 + param3 }
-}
-
-
protocol Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
protocol Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
protocol Foo {
-   class func ↓foo(param1: Int,
-                   param2: Bool, param3: [String]) { }
-}
-
-
protocol Foo {
-   class func ↓foo(param1: Int, param2: Bool,
-                   param3: [String]) { }
-}
-
-
enum Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
enum Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
enum Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
struct Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
struct Foo {
-   static func ↓foo(param1: Int,
-                    param2: Bool, param3: [String]) { }
-}
-
-
struct Foo {
-   static func ↓foo(param1: Int, param2: Bool,
-                    param3: [String]) { }
-}
-
-
class Foo {
-   func ↓foo(param1: Int,
-             param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   func ↓foo(param1: Int, param2: Bool,
-             param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                   param2: Bool, param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int, param2: Bool,
-                   param3: [String]) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                  param2: Bool, param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
-}
-
-
class Foo {
-   class func ↓foo(param1: Int,
-                  param2: Bool, param3: @escaping (Int) -> Void = { (x: Int) in }) { }
-}
-
-
class Foo {
-  ↓init(param1: Int, param2: Bool,
-        param3: @escaping ((Int) -> Void)? = { _ in }) { }
-}
-
-
func ↓foo(param1: Int, param2: Bool) { }
-
-
func ↓foo(param1: Int, param2: Bool, param3: [String]) { }
-
- -
-
- - -
-
- - - diff --git a/multiline_parameters_brackets.html b/multiline_parameters_brackets.html deleted file mode 100644 index e5b853ad9..000000000 --- a/multiline_parameters_brackets.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - multiline_parameters_brackets Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiline Parameters Brackets

- -

Multiline parameters should have their surrounding brackets in a new line

- -
    -
  • Identifier: multiline_parameters_brackets
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo(param1: String, param2: String, param3: String)
-
-
func foo(
-    param1: String, param2: String, param3: String
-)
-
-
func foo(
-    param1: String,
-    param2: String,
-    param3: String
-)
-
-
class SomeType {
-    func foo(param1: String, param2: String, param3: String)
-}
-
-
class SomeType {
-    func foo(
-        param1: String, param2: String, param3: String
-    )
-}
-
-
class SomeType {
-    func foo(
-        param1: String,
-        param2: String,
-        param3: String
-    )
-}
-
-
func foo<T>(param1: T, param2: String, param3: String) -> T { /* some code */ }
-
-
    func foo(a: [Int] = [
-        1
-    ])
-
-

Triggering Examples

-
func foo(↓param1: String, param2: String,
-         param3: String
-)
-
-
func foo(
-    param1: String,
-    param2: String,
-    param3: String↓)
-
-
class SomeType {
-    func foo(↓param1: String, param2: String,
-             param3: String
-    )
-}
-
-
class SomeType {
-    func foo(
-        param1: String,
-        param2: String,
-        param3: String↓)
-}
-
-
func foo<T>(↓param1: T, param2: String,
-         param3: String
-) -> T
-
- -
-
- - -
-
- - - diff --git a/multiple_closures_with_trailing_closure.html b/multiple_closures_with_trailing_closure.html deleted file mode 100644 index ef9148192..000000000 --- a/multiple_closures_with_trailing_closure.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - multiple_closures_with_trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Multiple Closures with Trailing Closure

- -

Trailing closure syntax should not be used when passing more than one closure argument

- -
    -
  • Identifier: multiple_closures_with_trailing_closure
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.reduce(0) { $0 + $1 }
-
-
if let foo = bar.map({ $0 + 1 }) {
-
-}
-
-
foo.something(param1: { $0 }, param2: { $0 + 1 })
-
-
UIView.animate(withDuration: 1.0) {
-    someView.alpha = 0.0
-}
-
-
foo.method { print(0) } arg2: { print(1) }
-
-
foo.methodWithParenArgs((0, 1), arg2: (0, 1, 2)) { $0 } arg4: { $0 }
-
-

Triggering Examples

-
foo.something(param1: { $0 }) ↓{ $0 + 1 }
-
-
UIView.animate(withDuration: 1.0, animations: {
-    someView.alpha = 0.0
-}) ↓{ _ in
-    someView.removeFromSuperview()
-}
-
-
foo.multipleTrailing(arg1: { $0 }) { $0 } arg3: { $0 }
-
-
foo.methodWithParenArgs(param1: { $0 }, param2: (0, 1), (0, 1)) { $0 }
-
- -
-
- - -
-
- - - diff --git a/nesting.html b/nesting.html deleted file mode 100644 index 1d2ca5ac4..000000000 --- a/nesting.html +++ /dev/null @@ -1,1584 +0,0 @@ - - - - nesting Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Nesting

- -

Types should be nested at most 1 level deep, and functions should be nested at most 2 levels deep.

- -
    -
  • Identifier: nesting
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -type_level - - - - - - - - - - - -
    KeyValue
    -warning - -1 -
    -
    -function_level - - - - - - - - - - - -
    KeyValue
    -warning - -2 -
    -
    -check_nesting_in_closures_and_statements - -true -
    -always_allow_one_type_in_functions - -false -
    -ignore_typealiases_and_associatedtypes - -false -
  • -
-

Non Triggering Examples

-
    actor Example_0 {
-        actor Example_1 {}
-    }
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {}
-    }
-
-
    class Example_0 {
-        class Example_1 {}
-    }
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {}
-    }
-
-
    struct Example_0 {
-        struct Example_1 {}
-    }
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {}
-    }
-
-
    enum Example_0 {
-        enum Example_1 {}
-    }
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {}
-    }
-
-
    func f_0() {
-        func f_1() {
-            func f_2() {}
-        }
-    }
-
-
    var example: Int {
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            func f_0() {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    switch example {
-    case .exampleCase:
-        actor Example_0 {
-            actor Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        class Example_0 {
-            class Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        struct Example_0 {
-            struct Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        enum Example_0 {
-            enum Example_1 {}
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {}
-            }
-        }
-    })
-
-
actor Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        actor Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
class Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        class Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
struct Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        struct Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
enum Example_0 {
-    protocol Example_1 {}
-}
-
-
    var example: Int {
-        enum Example_0 {
-            protocol Example_1 {}
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                protocol Example_1 {}
-            }
-        }
-    }
-
-
    extension Example_0 {
-        protocol Example_1 {}
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            actor Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                actor Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    actor Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            class Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                class Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    class Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            struct Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                struct Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    struct Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            enum Example_1 {
-                func f_1() {
-                    func f_2() {}
-                }
-            }
-            protocol P {}
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                enum Example_1 {
-                    func f_1() {
-                        func f_2() {}
-                    }
-                }
-                protocol P {}
-            default:
-                exampleFunc(closure: {
-                    enum Example_1 {
-                        func f_1() {
-                            func f_2() {}
-                        }
-                    }
-                    protocol P {}
-                })
-            }
-        }
-    }
-
-

Triggering Examples

-
    actor Example_0 {
-        actor Example_1 {
-            ↓actor Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {
-                    ↓actor Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {
-            ↓actor Example_2 {}
-        }
-    }
-
-
    class Example_0 {
-        class Example_1 {
-            ↓class Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {
-                    ↓class Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {
-            ↓class Example_2 {}
-        }
-    }
-
-
    struct Example_0 {
-        struct Example_1 {
-            ↓struct Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {
-                    ↓struct Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {
-            ↓struct Example_2 {}
-        }
-    }
-
-
    enum Example_0 {
-        enum Example_1 {
-            ↓enum Example_2 {}
-        }
-    }
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {
-                    ↓enum Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {
-            ↓enum Example_2 {}
-        }
-    }
-
-
    func f_0() {
-        func f_1() {
-            func f_2() {
-                ↓func f_3() {}
-            }
-        }
-    }
-
-
    var example: Int {
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            func f_0() {
-                func f_1() {
-                    func f_2() {
-                        ↓func f_3() {}
-                    }
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    switch example {
-    case .exampleCase:
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        actor Example_0 {
-            actor Example_1 {
-                ↓actor Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        actor Example_0 {
-            actor Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        class Example_0 {
-            class Example_1 {
-                ↓class Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        class Example_0 {
-            class Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        struct Example_0 {
-            struct Example_1 {
-                ↓struct Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        struct Example_0 {
-            struct Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
    switch example {
-    case .exampleCase:
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-        }
-    default:
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    var exampleClosure: () -> Void = {
-        enum Example_0 {
-            enum Example_1 {
-                ↓enum Example_2 {}
-            }
-            }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    }
-
-
    exampleFunc(closure: {
-        enum Example_0 {
-            enum Example_1 {}
-        }
-        func f_0() {
-            func f_1() {
-                func f_2() {
-                    ↓func f_3() {}
-                }
-            }
-        }
-    })
-
-
actor Example_0 {
-    actor Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        actor Example_0 {
-            actor Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            actor Example_0 {
-                actor Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        actor Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
class Example_0 {
-    class Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        class Example_0 {
-            class Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            class Example_0 {
-                class Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        class Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
struct Example_0 {
-    struct Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        struct Example_0 {
-            struct Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            struct Example_0 {
-                struct Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        struct Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
enum Example_0 {
-    enum Example_1 {
-        ↓protocol Example_2 {}
-    }
-}
-
-
    var example: Int {
-        enum Example_0 {
-            enum Example_1 {
-                ↓protocol Example_2 {}
-            }
-        }
-        return 5
-    }
-
-
    var example: Int = 5 {
-        didSet {
-            enum Example_0 {
-                enum Example_1 {
-                    ↓protocol Example_2 {}
-                }
-            }
-        }
-    }
-
-
    extension Example_0 {
-        enum Example_1 {
-            ↓protocol Example_2 {}
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            actor Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓actor Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    actor Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                actor Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓actor Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    actor Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓actor Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            class Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓class Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    class Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                class Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓class Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    class Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓class Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            struct Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓struct Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    struct Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                struct Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓struct Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    struct Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓struct Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            enum Example_1 {
-                func f_1() {
-                    func f_2() {
-                        ↓enum Example_2 {}
-                        ↓func f_3() {}
-                        ↓protocol P {}
-                    }
-                }
-            }
-        }
-    }
-
-
    enum Example_0 {
-        func f_0() {
-            switch example {
-            case .exampleCase:
-                enum Example_1 {
-                    func f_1() {
-                        func f_2() {
-                            ↓enum Example_2 {}
-                            ↓func f_3() {}
-                            ↓protocol P {}
-                        }
-                    }
-                }
-            default:
-                exampleFunc(closure: {
-                    enum Example_1 {
-                        func f_1() {
-                            func f_2() {
-                                ↓enum Example_2 {}
-                                ↓func f_3() {}
-                                ↓protocol P {}
-                            }
-                        }
-                    }
-                })
-            }
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/nimble_operator.html b/nimble_operator.html deleted file mode 100644 index 0287834d2..000000000 --- a/nimble_operator.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - nimble_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Nimble Operator

- -

Prefer Nimble operator overloads over free matcher functions

- -
    -
  • Identifier: nimble_operator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
expect(seagull.squawk) != "Hi!"
-
-
expect("Hi!") == "Hi!"
-
-
expect(10) > 2
-
-
expect(10) >= 10
-
-
expect(10) < 11
-
-
expect(10) <= 10
-
-
expect(x) === x
-
-
expect(10) == 10
-
-
expect(success) == true
-
-
expect(value) == nil
-
-
expect(value) != nil
-
-
expect(object.asyncFunction()).toEventually(equal(1))
-
-
expect(actual).to(haveCount(expected))
-
-
foo.method {
-    expect(value).to(equal(expectedValue), description: "Failed")
-    return Bar(value: ())
-}
-
-

Triggering Examples

-
↓expect(seagull.squawk).toNot(equal("Hi"))
-
-
↓expect(12).toNot(equal(10))
-
-
↓expect(10).to(equal(10))
-
-
↓expect(10, line: 1).to(equal(10))
-
-
↓expect(10).to(beGreaterThan(8))
-
-
↓expect(10).to(beGreaterThanOrEqualTo(10))
-
-
↓expect(10).to(beLessThan(11))
-
-
↓expect(10).to(beLessThanOrEqualTo(10))
-
-
↓expect(x).to(beIdenticalTo(x))
-
-
↓expect(success).to(beTrue())
-
-
↓expect(success).to(beFalse())
-
-
↓expect(value).to(beNil())
-
-
↓expect(value).toNot(beNil())
-
-
expect(10) > 2
- ↓expect(10).to(beGreaterThan(2))
-
- -
-
- - -
-
- - - diff --git a/no_extension_access_modifier.html b/no_extension_access_modifier.html deleted file mode 100644 index db6012021..000000000 --- a/no_extension_access_modifier.html +++ /dev/null @@ -1,407 +0,0 @@ - - - - no_extension_access_modifier Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Extension Access Modifier

- -

Prefer not to use extension access modifiers

- -
    -
  • Identifier: no_extension_access_modifier
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
extension String {}
-
-

-
- extension String {}
-
-

Triggering Examples

-
↓private extension String {}
-
-
↓public 
- extension String {}
-
-
↓open extension String {}
-
-
↓internal extension String {}
-
-
↓fileprivate extension String {}
-
- -
-
- - -
-
- - - diff --git a/no_fallthrough_only.html b/no_fallthrough_only.html deleted file mode 100644 index 512cc8af3..000000000 --- a/no_fallthrough_only.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - no_fallthrough_only Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Fallthrough only

- -

Fallthroughs can only be used if the case contains at least one other statement

- -
    -
  • Identifier: no_fallthrough_only
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch myvar {
-case 1:
-    var a = 1
-    fallthrough
-case 2:
-    var a = 2
-}
-
-
switch myvar {
-case "a":
-    var one = 1
-    var two = 2
-    fallthrough
-case "b": /* comment */
-    var three = 3
-}
-
-
switch myvar {
-case 1:
-    let one = 1
-case 2:
-    // comment
-    var two = 2
-}
-
-
switch myvar {
-case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
-    var three = 3
-    fallthrough
-default:
-    var three = 4
-}
-
-
switch myvar {
-case .alpha:
-    var one = 1
-case .beta:
-    var three = 3
-    fallthrough
-default:
-    var four = 4
-}
-
-
let aPoint = (1, -1)
-switch aPoint {
-case let (x, y) where x == y:
-    let A = "A"
-case let (x, y) where x == -y:
-    let B = "B"
-    fallthrough
-default:
-    let C = "C"
-}
-
-
switch myvar {
-case MyFun(with: { $1 }):
-    let one = 1
-    fallthrough
-case "abc":
-    let two = 2
-}
-
-
switch enumInstance {
-case .caseA:
-    print("it's a")
-case .caseB:
-    fallthrough
-@unknown default:
-    print("it's not a")
-}
-
-

Triggering Examples

-
switch myvar {
-case 1:
-    ↓fallthrough
-case 2:
-    var a = 1
-}
-
-
switch myvar {
-case 1:
-    var a = 2
-case 2:
-    ↓fallthrough
-case 3:
-    var a = 3
-}
-
-
switch myvar {
-case 1: // comment
-    ↓fallthrough
-}
-
-
switch myvar {
-case 1: /* multi
-    line
-    comment */
-    ↓fallthrough
-case 2:
-    var a = 2
-}
-
-
switch myvar {
-case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
-    ↓fallthrough
-default:
-    var three = 4
-}
-
-
switch myvar {
-case .alpha:
-    var one = 1
-case .beta:
-    ↓fallthrough
-case .gamma:
-    var three = 3
-default:
-    var four = 4
-}
-
-
let aPoint = (1, -1)
-switch aPoint {
-case let (x, y) where x == y:
-    let A = "A"
-case let (x, y) where x == -y:
-    ↓fallthrough
-default:
-    let B = "B"
-}
-
-
switch myvar {
-case MyFun(with: { $1 }):
-    ↓fallthrough
-case "abc":
-    let two = 2
-}
-
- -
-
- - -
-
- - - diff --git a/no_grouping_extension.html b/no_grouping_extension.html deleted file mode 100644 index 9a676c2f0..000000000 --- a/no_grouping_extension.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - no_grouping_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Grouping Extension

- -

Extensions shouldn’t be used to group code within the same source file

- -
    -
  • Identifier: no_grouping_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol Food {}
-extension Food {}
-
-
class Apples {}
-extension Oranges {}
-
-
class Box<T> {}
-extension Box where T: Vegetable {}
-
-

Triggering Examples

-
enum Fruit {}
-↓extension Fruit {}
-
-
↓extension Tea: Error {}
-struct Tea {}
-
-
class Ham { class Spam {}}
-↓extension Ham.Spam {}
-
-
extension External { struct Gotcha {}}
-↓extension External.Gotcha {}
-
- -
-
- - -
-
- - - diff --git a/no_magic_numbers.html b/no_magic_numbers.html deleted file mode 100644 index 01624ac86..000000000 --- a/no_magic_numbers.html +++ /dev/null @@ -1,514 +0,0 @@ - - - - no_magic_numbers Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Magic Numbers

- -

Magic numbers should be replaced by named constants

- -
    -
  • Identifier: no_magic_numbers
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
var foo = 123
-
-
static let bar: Double = 0.123
-
-
let a = b + 1.0
-
-
array[0] + array[1] 
-
-
let foo = 1_000.000_01
-
-
// array[1337]
-
-
baz("9999")
-
-
func foo() {
-    let x: Int = 2
-    let y = 3
-    let vector = [x, y, -1]
-}
-
-
class A {
-    var foo: Double = 132
-    static let bar: Double = 0.98
-}
-
-
@available(iOS 13, *)
-func version() {
-    if #available(iOS 13, OSX 10.10, *) {
-        return
-    }
-}
-
-
enum Example: Int {
-    case positive = 2
-    case negative = -2
-}
-
-
class FooTests: XCTestCase {
-    let array: [Int] = []
-    let bar = array[42]
-}
-
-
class FooTests: XCTestCase {
-    class Bar {
-        let array: [Int] = []
-        let bar = array[42]
-    }
-}
-
-
class MyTest: XCTestCase {}
-extension MyTest {
-    let a = Int(3)
-}
-
-
extension MyTest {
-    let a = Int(3)
-}
-class MyTest: XCTestCase {}
-
-
let foo = 1 << 2
-
-
let foo = 1 >> 2
-
-
let foo = 2 >> 2
-
-
let foo = 2 << 2
-
-
let a = b / 100.0
-
-
let range = 2 ..< 12
-
-
let range = ...12
-
-
let range = 12...
-
-
let (lowerBound, upperBound) = (400, 599)
-
-
let a = (5, 10)
-
-
let notFound = (statusCode: 404, description: "Not Found", isError: true)
-
-

Triggering Examples

-
foo(↓321)
-
-
bar(↓1_000.005_01)
-
-
array[↓42]
-
-
let box = array[↓12 + ↓14]
-
-
let a = b + ↓2.0
-
-
let range = 2 ... ↓12 + 1
-
-
let range = ↓2*↓6...
-
-
let slice = array[↓2...↓4]
-
-
for i in ↓3 ..< ↓8 {}
-
-
let n: Int = Int(r * ↓255) << ↓16 | Int(g * ↓255) << ↓8
-
-
Color.primary.opacity(isAnimate ? ↓0.1 : ↓1.5)
-
-
        class MyTest: XCTestCase {}
-        extension NSObject {
-            let a = Int(↓3)
-        }
-
-
if (fileSize > ↓1000000) {
-    return
-}
-
-
let imageHeight = (width - ↓24)
-
-
return (↓5, ↓10, ↓15)
-
- -
-
- - -
-
- - - diff --git a/no_space_in_method_call.html b/no_space_in_method_call.html deleted file mode 100644 index 43f2b1e78..000000000 --- a/no_space_in_method_call.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - no_space_in_method_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

No Space in Method Call

- -

Don’t add a space between the method name and the parentheses

- -
    -
  • Identifier: no_space_in_method_call
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo()
-
-
object.foo()
-
-
object.foo(1)
-
-
object.foo(value: 1)
-
-
object.foo { print($0 }
-
-
list.sorted { $0.0 < $1.0 }.map { $0.value }
-
-
self.init(rgb: (Int) (colorInt))
-
-
Button {
-    print("Button tapped")
-} label: {
-    Text("Button")
-}
-
-

Triggering Examples

-
foo↓ ()
-
-
object.foo↓ ()
-
-
object.foo↓ (1)
-
-
object.foo↓ (value: 1)
-
-
object.foo↓ () {}
-
-
object.foo↓     ()
-
-
object.foo↓     (value: 1) { x in print(x) }
-
- -
-
- - -
-
- - - diff --git a/non_optional_string_data_conversion.html b/non_optional_string_data_conversion.html deleted file mode 100644 index d8d14bf99..000000000 --- a/non_optional_string_data_conversion.html +++ /dev/null @@ -1,398 +0,0 @@ - - - - non_optional_string_data_conversion Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Non-Optional String <-> Data Conversion

- -

Prefer using UTF-8 encoded strings when converting between String and Data

- -
    -
  • Identifier: non_optional_string_data_conversion
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
Data("foo".utf8)
-
-
String(decoding: data, as: UTF8.self)
-
-

Triggering Examples

-
"foo".data(using: .utf8)
-
-
String(data: data, encoding: .utf8)
-
- -
-
- - -
-
- - - diff --git a/non_overridable_class_declaration.html b/non_overridable_class_declaration.html deleted file mode 100644 index b647babff..000000000 --- a/non_overridable_class_declaration.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - non_overridable_class_declaration Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Class Declaration in Final Class

- -

Class methods and properties in final classes should themselves be final, just as if the declarations -are private. In both cases, they cannot be overridden. Using final class or static makes this explicit.

- -
    -
  • Identifier: non_overridable_class_declaration
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -final_class_modifier - -final class -
  • -
-

Non Triggering Examples

-
final class C {
-    final class var b: Bool { true }
-    final class func f() {}
-}
-
-
class C {
-    final class var b: Bool { true }
-    final class func f() {}
-}
-
-
class C {
-    class var b: Bool { true }
-    class func f() {}
-}
-
-
class C {
-    static var b: Bool { true }
-    static func f() {}
-}
-
-
final class C {
-    static var b: Bool { true }
-    static func f() {}
-}
-
-
final class C {
-    class D {
-        class var b: Bool { true }
-        class func f() {}
-    }
-}
-
-

Triggering Examples

-
final class C {
-    ↓class var b: Bool { true }
-    ↓class func f() {}
-}
-
-
class C {
-    final class D {
-        ↓class var b: Bool { true }
-        ↓class func f() {}
-    }
-}
-
-
class C {
-    private ↓class var b: Bool { true }
-    private ↓class func f() {}
-}
-
- -
-
- - -
-
- - - diff --git a/notification_center_detachment.html b/notification_center_detachment.html deleted file mode 100644 index e82b1f3dd..000000000 --- a/notification_center_detachment.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - notification_center_detachment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Notification Center Detachment

- -

An object should only remove itself as an observer in deinit

- -
    -
  • Identifier: notification_center_detachment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-   deinit {
-       NotificationCenter.default.removeObserver(self)
-   }
-}
-
-
class Foo {
-   func bar() {
-       NotificationCenter.default.removeObserver(otherObject)
-   }
-}
-
-

Triggering Examples

-
class Foo {
-   func bar() {
-       ↓NotificationCenter.default.removeObserver(self)
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/ns_number_init_as_function_reference.html b/ns_number_init_as_function_reference.html deleted file mode 100644 index 8b6e30e04..000000000 --- a/ns_number_init_as_function_reference.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - ns_number_init_as_function_reference Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSNumber Init as Function Reference

- -

Passing NSNumber.init or NSDecimalNumber.init as a function reference is dangerous as it can cause the wrong initializer to be used, causing crashes; use .init(value:) instead

- -
    -
  • Identifier: ns_number_init_as_function_reference
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[0, 0.2].map(NSNumber.init(value:))
-
-
let value = NSNumber.init(value: 0.0)
-
-
[0, 0.2].map { NSNumber(value: $0) }
-
-
[0, 0.2].map(NSDecimalNumber.init(value:))
-
-
[0, 0.2].map { NSDecimalNumber(value: $0) }
-
-

Triggering Examples

-
[0, 0.2].map(↓NSNumber.init)
-
-
[0, 0.2].map(↓NSDecimalNumber.init)
-
- -
-
- - -
-
- - - diff --git a/nslocalizedstring_key.html b/nslocalizedstring_key.html deleted file mode 100644 index f3b36140b..000000000 --- a/nslocalizedstring_key.html +++ /dev/null @@ -1,411 +0,0 @@ - - - - nslocalizedstring_key Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSLocalizedString Key

- -

Static strings should be used as key/comment in NSLocalizedString in order for genstrings to work

- -
    -
  • Identifier: nslocalizedstring_key
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
NSLocalizedString("key", comment: "")
-
-
NSLocalizedString("key" + "2", comment: "")
-
-
NSLocalizedString("key", comment: "comment")
-
-
NSLocalizedString("This is a multi-" +
-    "line string", comment: "")
-
-
let format = NSLocalizedString("%@, %@.", comment: "Accessibility label for a post in the post list." +
-" The parameters are the title, and date respectively." +
-" For example, "Let it Go, 1 hour ago."")
-
-

Triggering Examples

-
NSLocalizedString(↓method(), comment: "")
-
-
NSLocalizedString(↓"key_\(param)", comment: "")
-
-
NSLocalizedString("key", comment: ↓"comment with \(param)")
-
-
NSLocalizedString(↓"key_\(param)", comment: ↓method())
-
- -
-
- - -
-
- - - diff --git a/nslocalizedstring_require_bundle.html b/nslocalizedstring_require_bundle.html deleted file mode 100644 index 884993fa9..000000000 --- a/nslocalizedstring_require_bundle.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - nslocalizedstring_require_bundle Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSLocalizedString Require Bundle

- -

Calls to NSLocalizedString should specify the bundle which contains the strings file

- -
    -
  • Identifier: nslocalizedstring_require_bundle
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
NSLocalizedString("someKey", bundle: .main, comment: "test")
-
-
NSLocalizedString("someKey", tableName: "a",
-                  bundle: Bundle(for: A.self),
-                  comment: "test")
-
-
NSLocalizedString("someKey", tableName: "xyz",
-                  bundle: someBundle, value: "test"
-                  comment: "test")
-
-
arbitraryFunctionCall("something")
-
-

Triggering Examples

-
↓NSLocalizedString("someKey", comment: "test")
-
-
↓NSLocalizedString("someKey", tableName: "a", comment: "test")
-
-
↓NSLocalizedString("someKey", tableName: "xyz",
-                  value: "test", comment: "test")
-
- -
-
- - -
-
- - - diff --git a/nsobject_prefer_isequal.html b/nsobject_prefer_isequal.html deleted file mode 100644 index 66472783d..000000000 --- a/nsobject_prefer_isequal.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - nsobject_prefer_isequal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

NSObject Prefer isEqual

- -

NSObject subclasses should implement isEqual instead of ==

- -
    -
  • Identifier: nsobject_prefer_isequal
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class AClass: NSObject {
-}
-
-
@objc class AClass: SomeNSObjectSubclass {
-}
-
-
class AClass: Equatable {
-    static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return true
-    }
-
-
class AClass: NSObject {
-    override func isEqual(_ object: Any?) -> Bool {
-        return true
-    }
-}
-
-
@objc class AClass: SomeNSObjectSubclass {
-    override func isEqual(_ object: Any?) -> Bool {
-        return false
-    }
-}
-
-
class AClass: NSObject {
-    static func ==(lhs: AClass, rhs: BClass) -> Bool {
-        return true
-    }
-}
-
-
struct AStruct: Equatable {
-    static func ==(lhs: AStruct, rhs: AStruct) -> Bool {
-        return false
-    }
-}
-
-
enum AnEnum: Equatable {
-    static func ==(lhs: AnEnum, rhs: AnEnum) -> Bool {
-        return true
-    }
-}
-
-

Triggering Examples

-
class AClass: NSObject {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
-
@objc class AClass: SomeOtherNSObjectSubclass {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return true
-    }
-}
-
-
class AClass: NSObject, Equatable {
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
-
class AClass: NSObject {
-    override func isEqual(_ object: Any?) -> Bool {
-        guard let other = object as? AClass else {
-            return false
-        }
-        return true
-    }
-
-    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
-        return false
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/number_separator.html b/number_separator.html deleted file mode 100644 index 48de3a7cd..000000000 --- a/number_separator.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - number_separator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Number Separator

- -

Underscores should be used as thousand separator in large numbers with a configurable number of digits. In other words, there should be an underscore after every 3 digits in the integral as well as the fractional part of a number.

- -
    -
  • Identifier: number_separator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -minimum_length - -0 -
    -exclude_ranges - -[] -
  • -
-

Non Triggering Examples

-
let foo = -100
-
-
let foo = -1_000
-
-
let foo = -1_000_000
-
-
let foo = -1.0001
-
-
let foo = -1_000_000.0000001
-
-
let binary = -0b10000
-
-
let binary = -0b1000_0001
-
-
let hex = -0xA
-
-
let hex = -0xAA_BB
-
-
let octal = -0o21
-
-
let octal = -0o21_1
-
-
let exp = -1_000_000.000000e2
-
-
let foo: Double = -(200)
-
-
let foo: Double = -(200 / 447.214)
-
-
let foo = -6.2832e-6
-
-
let foo = +100
-
-
let foo = +1_000
-
-
let foo = +1_000_000
-
-
let foo = +1.0001
-
-
let foo = +1_000_000.0000001
-
-
let binary = +0b10000
-
-
let binary = +0b1000_0001
-
-
let hex = +0xA
-
-
let hex = +0xAA_BB
-
-
let octal = +0o21
-
-
let octal = +0o21_1
-
-
let exp = +1_000_000.000000e2
-
-
let foo: Double = +(200)
-
-
let foo: Double = +(200 / 447.214)
-
-
let foo = +6.2832e-6
-
-
let foo = 100
-
-
let foo = 1_000
-
-
let foo = 1_000_000
-
-
let foo = 1.0001
-
-
let foo = 1_000_000.0000001
-
-
let binary = 0b10000
-
-
let binary = 0b1000_0001
-
-
let hex = 0xA
-
-
let hex = 0xAA_BB
-
-
let octal = 0o21
-
-
let octal = 0o21_1
-
-
let exp = 1_000_000.000000e2
-
-
let foo: Double = (200)
-
-
let foo: Double = (200 / 447.214)
-
-
let foo = 6.2832e-6
-
-

Triggering Examples

-
let foo = -↓10_0
-
-
let foo = -↓1000
-
-
let foo = -↓1000e2
-
-
let foo = -↓1000E2
-
-
let foo = -↓1__000
-
-
let foo = -↓1.0001
-
-
let foo = -↓1_000_000.000000_1
-
-
let foo = -↓1000000.000000_1
-
-
let foo = -↓6.2832e-6
-
-
let foo = +↓10_0
-
-
let foo = +↓1000
-
-
let foo = +↓1000e2
-
-
let foo = +↓1000E2
-
-
let foo = +↓1__000
-
-
let foo = +↓1.0001
-
-
let foo = +↓1_000_000.000000_1
-
-
let foo = +↓1000000.000000_1
-
-
let foo = +↓6.2832e-6
-
-
let foo = ↓10_0
-
-
let foo = ↓1000
-
-
let foo = ↓1000e2
-
-
let foo = ↓1000E2
-
-
let foo = ↓1__000
-
-
let foo = ↓1.0001
-
-
let foo = ↓1_000_000.000000_1
-
-
let foo = ↓1000000.000000_1
-
-
let foo = ↓6.2832e-6
-
-
let foo: Double = -(↓100000)
-
-
let foo: Double = -(↓10.000000_1)
-
-
let foo: Double = -(↓123456 / ↓447.214214)
-
-
let foo: Double = +(↓100000)
-
-
let foo: Double = +(↓10.000000_1)
-
-
let foo: Double = +(↓123456 / ↓447.214214)
-
-
let foo: Double = (↓100000)
-
-
let foo: Double = (↓10.000000_1)
-
-
let foo: Double = (↓123456 / ↓447.214214)
-
- -
-
- - -
-
- - - diff --git a/object_literal.html b/object_literal.html deleted file mode 100644 index 82bccb1a6..000000000 --- a/object_literal.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - object_literal Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Object Literal

- -

Prefer object literals over image and color inits

- -
    -
  • Identifier: object_literal
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -image_literal - -true -
    -color_literal - -true -
  • -
-

Non Triggering Examples

-
let image = #imageLiteral(resourceName: "image.jpg")
-
-
let color = #colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
-
-
let image = UIImage(named: aVariable)
-
-
let image = UIImage(named: "interpolated \(variable)")
-
-
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
-
-
let image = NSImage(named: aVariable)
-
-
let image = NSImage(named: "interpolated \(variable)")
-
-
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
-
-

Triggering Examples

-
let image = ↓UIImage(named: "foo")
-
-
let color = ↓UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓UIColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓UIColor(white: 0.5, alpha: 1)
-
-
let image = ↓NSImage(named: "foo")
-
-
let color = ↓NSColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓NSColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓NSColor(white: 0.5, alpha: 1)
-
-
let image = ↓UIImage.init(named: "foo")
-
-
let color = ↓UIColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓UIColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓UIColor.init(white: 0.5, alpha: 1)
-
-
let image = ↓NSImage.init(named: "foo")
-
-
let color = ↓NSColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
-
-
let color = ↓NSColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
-
-
let color = ↓NSColor.init(white: 0.5, alpha: 1)
-
- -
-
- - -
-
- - - diff --git a/one_declaration_per_file.html b/one_declaration_per_file.html deleted file mode 100644 index dcd34e39e..000000000 --- a/one_declaration_per_file.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - one_declaration_per_file Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

One Declaration per File

- -

Only a single declaration is allowed in a file

- -
    -
  • Identifier: one_declaration_per_file
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {}
-
-
class Foo {}
-extension Foo {}
-
-
struct S {
-    struct N {}
-}
-
-

Triggering Examples

-
class Foo {}
-↓class Bar {}
-
-
protocol Foo {}
-↓enum Bar {}
-
-
struct Foo {}
-↓struct Bar {}
-
- -
-
- - -
-
- - - diff --git a/opening_brace.html b/opening_brace.html deleted file mode 100644 index 1fba4c611..000000000 --- a/opening_brace.html +++ /dev/null @@ -1,628 +0,0 @@ - - - - opening_brace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Opening Brace Spacing

- -

Opening braces should be preceded by a single space and on the same line as the declaration

- -
    -
  • Identifier: opening_brace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_multiline_func - -false -
  • -
-

Non Triggering Examples

-
func abc() {
-}
-
-
[].map() { $0 }
-
-
[].map({ })
-
-
if let a = b { }
-
-
while a == b { }
-
-
guard let a = b else { }
-
-
struct Rule {}
-
-
struct Parent {
-    struct Child {
-        let foo: Int
-    }
-}
-
-
func f(rect: CGRect) {
-    {
-        let centre = CGPoint(x: rect.midX, y: rect.midY)
-        print(centre)
-    }()
-}
-
-
func f(rect: CGRect) -> () -> Void {
-    {
-        let centre = CGPoint(x: rect.midX, y: rect.midY)
-        print(centre)
-    }
-}
-
-
func f() -> () -> Void {
-    {}
-}
-
-
class Rule:
-  NSObject {
-  var a: String {
-    return ""
-  }
-}
-
-
self.foo(
-    (
-        "String parameter",
-        { "Do something here" }
-    )
-)
-
-
let pattern = #/(\{(?<key>\w+)\})/#
-
-
if c {}
-else {}
-
-

Triggering Examples

-
func abc()↓{
-}
-
-
func abc()
-    ↓{ }
-
-
func abc(a: A,
-    b: B)
-↓{
-
-
[].map()↓{ $0 }
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button(action: {
-      self.showOptions.toggle()
-    })↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button(action: {
-      self.showOptions.toggle()
-    })
-   ↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
struct OldContentView: View {
-  @State private var showOptions = false
-
-  var body: some View {
-    Button {
-      self.showOptions.toggle()
-    } label:↓{
-      Image(systemName: "gear")
-    }
-  }
-}
-
-
if let a = b↓{ }
-
-
while a == b↓{ }
-
-
guard let a = b else↓{ }
-
-
if
-    let a = b,
-    let c = d
-    where a == c↓{ }
-
-
while
-    let a = b,
-    let c = d
-    where a == c↓{ }
-
-
guard
-    let a = b,
-    let c = d
-    where a == c else↓{ }
-
-
struct Rule↓{}
-
-
struct Rule
-↓{
-}
-
-
struct Rule
-
-    ↓{
-}
-
-
struct Parent {
-    struct Child
-    ↓{
-        let foo: Int
-    }
-}
-
-
switch a↓{}
-
-
if
-    let a = b,
-    let c = d,
-    a == c
-↓{ }
-
-
while
-    let a = b,
-    let c = d,
-    a == c
-↓{ }
-
-
guard
-    let a = b,
-    let c = d,
-    a == c else
-↓{ }
-
-
class Rule↓{}
-
-
-
actor Rule↓{}
-
-
-
enum Rule↓{}
-
-
-
protocol Rule↓{}
-
-
-
extension Rule↓{}
-
-
-
class Rule {
-  var a: String↓{
-    return ""
-  }
-}
-
-
class Rule {
-  var a: String {
-    willSet↓{
-
-    }
-    didSet  ↓{
-
-    }
-  }
-}
-
-
precedencegroup Group↓{
-  assignment: true
-}
-
-
if
-    "test".isEmpty
-↓{
-    // code here
-}
-
-
func fooFun() {
-    let foo: String? = "foo"
-    let bar: String? = "bar"
-
-    if
-        let foooo = foo,
-        let barrr = bar
-    ↓{
-        print(foooo + barrr)
-    }
-}
-
-
if
-    let a = ["A", "B"].first,
-    let b = ["B"].first
-↓{
-    print(a)
-}
-
-
if c  ↓{}
-else  ↓{}
-
- -
-
- - -
-
- - - diff --git a/operator_usage_whitespace.html b/operator_usage_whitespace.html deleted file mode 100644 index 93eef7c29..000000000 --- a/operator_usage_whitespace.html +++ /dev/null @@ -1,562 +0,0 @@ - - - - operator_usage_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Operator Usage Whitespace

- -

Operators should be surrounded by a single whitespace when they are being used

- -
    -
  • Identifier: operator_usage_whitespace
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -lines_look_around - -2 -
    -skip_aligned_constants - -true -
    -allowed_no_space_operators - -[“…”, “..<”] -
  • -
-

Non Triggering Examples

-
let foo = 1 + 2
-
-
let foo = 1 > 2
-
-
let foo = !false
-
-
let foo: Int?
-
-
let foo: Array<String>
-
-
let model = CustomView<Container<Button>, NSAttributedString>()
-
-
let foo: [String]
-
-
let foo = 1 + 
-  2
-
-
let range = 1...3
-
-
let range = 1 ... 3
-
-
let range = 1..<3
-
-
#if swift(>=3.0)
-    foo()
-#endif
-
-
array.removeAtIndex(-200)
-
-
let name = "image-1"
-
-
button.setImage(#imageLiteral(resourceName: "image-1"), for: .normal)
-
-
let doubleValue = -9e-11
-
-
let foo = GenericType<(UIViewController) -> Void>()
-
-
let foo = Foo<Bar<T>, Baz>()
-
-
let foo = SignalProducer<Signal<Value, Error>, Error>([ self.signal, next ]).flatten(.concat)
-
-
"let foo =  1"
-
-
  enum Enum {
-  case hello   = 1
-  case hello2  = 1
-  }
-
-
let something = Something<GenericParameter1,
-                          GenericParameter2>()
-
-
return path.flatMap { path in
-    return compileCommands[path] ??
-        compileCommands[path.path(relativeTo: FileManager.default.currentDirectoryPath)]
-}
-
-
internal static func == (lhs: Vertex, rhs: Vertex) -> Bool {
-    return lhs.filePath == rhs.filePath
-        && lhs.originalRemoteString == rhs.originalRemoteString
-        && lhs.rootDirectory == rhs.rootDirectory
-}
-
-
internal static func == (lhs: Vertex, rhs: Vertex) -> Bool {
-    return lhs.filePath == rhs.filePath &&
-        lhs.originalRemoteString == rhs.originalRemoteString &&
-        lhs.rootDirectory == rhs.rootDirectory
-}
-
-
private static let pattern =
-    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
-    "|" +                       // or
-    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
-
-
private static let pattern =
-    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
-    "|"                       + // or
-    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
-
-
typealias Foo = Bar
-
-
protocol A {
-    associatedtype B = C
-}
-
-
tabbedViewController.title = nil
-
-

Triggering Examples

-
let foo = 1↓+2
-
-
let foo = 1↓   + 2
-
-
let foo = 1↓   +    2
-
-
let foo = 1↓ +    2
-
-
let foo↓=1↓+2
-
-
let foo↓=1 + 2
-
-
let foo↓=bar
-
-
let range = 1↓ ..<  3
-
-
let foo = bar↓   ?? 0
-
-
let foo = bar↓ !=  0
-
-
let foo = bar↓ !==  bar2
-
-
let v8 = Int8(1)↓  << 6
-
-
let v8 = 1↓ <<  (6)
-
-
let v8 = 1↓ <<  (6)
- let foo = 1 > 2
-
-
let foo↓  = [1]
-
-
let foo↓  = "1"
-
-
let foo↓ =  "1"
-
-
  enum Enum {
-  case one↓  =  1
-  case two  = 1
-  }
-
-
  enum Enum {
-  case one  = 1
-  case two↓  =  1
-  }
-
-
  enum Enum {
-  case one↓   = 1
-  case two↓  = 1
-  }
-
-
typealias Foo↓ =  Bar
-
-
protocol A {
-    associatedtype B↓  = C
-}
-
-
tabbedViewController.title↓  = nil
-
-
let foo = bar ? 0↓:1
-
-
let foo = bar↓ ?   0 : 1
-
- -
-
- - -
-
- - - diff --git a/operator_whitespace.html b/operator_whitespace.html deleted file mode 100644 index e2ad09fef..000000000 --- a/operator_whitespace.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - operator_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Operator Function Whitespace

- -

Operators should be surrounded by a single whitespace when defining them

- -
    -
  • Identifier: operator_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func <| (lhs: Int, rhs: Int) -> Int {}
-
-
func <|< <A>(lhs: A, rhs: A) -> A {}
-
-
func abc(lhs: Int, rhs: Int) -> Int {}
-
-

Triggering Examples

-
↓func <|(lhs: Int, rhs: Int) -> Int {}
-
-
↓func <|<<A>(lhs: A, rhs: A) -> A {}
-
-
↓func <|  (lhs: Int, rhs: Int) -> Int {}
-
-
↓func <|<  <A>(lhs: A, rhs: A) -> A {}
-
-
↓func  <| (lhs: Int, rhs: Int) -> Int {}
-
-
↓func  <|< <A>(lhs: A, rhs: A) -> A {}
-
- -
-
- - -
-
- - - diff --git a/optional_enum_case_matching.html b/optional_enum_case_matching.html deleted file mode 100644 index e6d506ca2..000000000 --- a/optional_enum_case_matching.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - optional_enum_case_matching Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Optional Enum Case Match

- -

Matching an enum case against an optional enum without ‘?’ is supported on Swift 5.1 and above

- -
    -
  • Identifier: optional_enum_case_matching
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
- case .bar: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case (.bar, .baz): break
- case (.bar, _): break
- case (_, .baz): break
- default: break
-}
-
-
switch (x, y) {
-case (.c, _?):
-    break
-case (.c, nil):
-    break
-case (_, _):
-    break
-}
-
-

Triggering Examples

-
switch foo {
- case .bar↓?: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case Foo.bar↓?: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case .bar↓?, .baz↓?: break
- default: break
-}
-
-
switch foo {
- case .bar↓? where x > 1: break
- case .baz: break
- default: break
-}
-
-
switch foo {
- case (.bar↓?, .baz↓?): break
- case (.bar↓?, _): break
- case (_, .bar↓?): break
- default: break
-}
-
- -
-
- - -
-
- - - diff --git a/orphaned_doc_comment.html b/orphaned_doc_comment.html deleted file mode 100644 index 637c24022..000000000 --- a/orphaned_doc_comment.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - orphaned_doc_comment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Orphaned Doc Comment

- -

A doc comment should be attached to a declaration

- -
    -
  • Identifier: orphaned_doc_comment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/// My great property
-var myGreatProperty: String!
-
-
//////////////////////////////////////
-//
-// Copyright header.
-//
-//////////////////////////////////////
-
-
/// Look here for more info: https://github.com.
-var myGreatProperty: String!
-
-
/// Look here for more info:
-/// https://github.com.
-var myGreatProperty: String!
-
-

Triggering Examples

-
↓/// My great property
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-
-
-// Not a doc string
-var myGreatProperty: String!
-
-
↓/// Look here for more info: https://github.com.
-// Not a doc string
-↓/// My great property
-// Not a doc string
-var myGreatProperty: String!
-
-
extension Nested {
-    ↓///
-    /// Look here for more info: https://github.com.
-
-    // Not a doc string
-    var myGreatProperty: String!
-}
-
- -
-
- - -
-
- - - diff --git a/overridden_super_call.html b/overridden_super_call.html deleted file mode 100644 index f7e27a3a8..000000000 --- a/overridden_super_call.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - overridden_super_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Overridden Method Calls Super

- -

Some overridden methods should always call super.

- -
    -
  • Identifier: overridden_super_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -included - -[“*”] -
  • -
-

Non Triggering Examples

-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-    }
-}
-
-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {
-        self.method1()
-        super.viewWillAppear(animated)
-        self.method2()
-    }
-}
-
-
class VC: UIViewController {
-    override func loadView() {
-    }
-}
-
-
class Some {
-    func viewWillAppear(_ animated: Bool) {
-    }
-}
-
-
class VC: UIViewController {
-    override func viewDidLoad() {
-    defer {
-        super.viewDidLoad()
-        }
-    }
-}
-
-

Triggering Examples

-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {↓
-        //Not calling to super
-        self.method()
-    }
-}
-
-
class VC: UIViewController {
-    override func viewWillAppear(_ animated: Bool) {↓
-        super.viewWillAppear(animated)
-        //Other code
-        super.viewWillAppear(animated)
-    }
-}
-
-
class VC: UIViewController {
-    override func didReceiveMemoryWarning() {↓
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/override_in_extension.html b/override_in_extension.html deleted file mode 100644 index 0651441e1..000000000 --- a/override_in_extension.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - override_in_extension Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Override in Extension

- -

Extensions shouldn’t override declarations

- -
    -
  • Identifier: override_in_extension
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension Person {
-  var age: Int { return 42 }
-}
-
-
extension Person {
-  func celebrateBirthday() {}
-}
-
-
class Employee: Person {
-  override func celebrateBirthday() {}
-}
-
-
class Foo: NSObject {}
-extension Foo {
-    override var description: String { return "" }
-}
-
-
struct Foo {
-    class Bar: NSObject {}
-}
-extension Foo.Bar {
-    override var description: String { return "" }
-}
-
-

Triggering Examples

-
extension Person {
-  override ↓var age: Int { return 42 }
-}
-
-
extension Person {
-  override ↓func celebrateBirthday() {}
-}
-
- -
-
- - -
-
- - - diff --git a/pattern_matching_keywords.html b/pattern_matching_keywords.html deleted file mode 100644 index b7691e656..000000000 --- a/pattern_matching_keywords.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - pattern_matching_keywords Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Pattern Matching Keywords

- -

Combine multiple pattern matching bindings by moving keywords out of tuples

- -
    -
  • Identifier: pattern_matching_keywords
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-    default: break
-}
-
-
switch foo {
-    case 1: break
-}
-
-
switch foo {
-    case bar: break
-}
-
-
switch foo {
-    case let (x, y): break
-}
-
-
switch foo {
-    case .foo(let x): break
-}
-
-
switch foo {
-    case let .foo(x, y): break
-}
-
-
switch foo {
-    case .foo(let x), .bar(let x): break
-}
-
-
switch foo {
-    case .foo(let x, var y): break
-}
-
-
switch foo {
-    case var (x, y): break
-}
-
-
switch foo {
-    case .foo(var x): break
-}
-
-
switch foo {
-    case var .foo(x, y): break
-}
-
-
switch foo {
-    case (y, let x, z): break
-}
-
-

Triggering Examples

-
switch foo {
-    case (↓let x,  ↓let y): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, .foo): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, _): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, f()): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, s.f()): break
-}
-
-
switch foo {
-    case (↓let x,  ↓let y, s.t): break
-}
-
-
switch foo {
-    case .foo(↓let x, ↓let y): break
-}
-
-
switch foo {
-    case (.yamlParsing(↓let x), .yamlParsing(↓let y)): break
-}
-
-
switch foo {
-    case (↓var x,  ↓var y): break
-}
-
-
switch foo {
-    case .foo(↓var x, ↓var y): break
-}
-
-
switch foo {
-    case (.yamlParsing(↓var x), .yamlParsing(↓var y)): break
-}
-
- -
-
- - -
-
- - - diff --git a/period_spacing.html b/period_spacing.html deleted file mode 100644 index 4bd90663c..000000000 --- a/period_spacing.html +++ /dev/null @@ -1,423 +0,0 @@ - - - - period_spacing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Period Spacing

- -

Periods should not be followed by more than one space

- -
    -
  • Identifier: period_spacing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let pi = 3.2
-
-
let pi = Double.pi
-
-
let pi = Double. pi
-
-
let pi = Double.  pi
-
-
// A. Single.
-
-
///   - code: Identifier of the error. Integer.
-
-
// value: Multiline.
-//        Comment.
-
-
/**
-Sentence ended in period.
-
-- Sentence 2 new line characters after.
-**/
-
-

Triggering Examples

-
/* Only god knows why. ↓ This symbol does nothing. */
-
-
// Only god knows why. ↓ This symbol does nothing.
-
-
// Single. Double. ↓ End.
-
-
// Single. Double. ↓ Triple. ↓  End.
-
-
// Triple. ↓  Quad. ↓   End.
-
-
///   - code: Identifier of the error. ↓ Integer.
-
- -
-
- - -
-
- - - diff --git a/prefer_nimble.html b/prefer_nimble.html deleted file mode 100644 index df0b3df60..000000000 --- a/prefer_nimble.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - prefer_nimble Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Nimble

- -

Prefer Nimble matchers over XCTAssert functions

- -
    -
  • Identifier: prefer_nimble
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
expect(foo) == 1
-
-
expect(foo).to(equal(1))
-
-

Triggering Examples

-
↓XCTAssertTrue(foo)
-
-
↓XCTAssertEqual(foo, 2)
-
-
↓XCTAssertNotEqual(foo, 2)
-
-
↓XCTAssertNil(foo)
-
-
↓XCTAssert(foo)
-
-
↓XCTAssertGreaterThan(foo, 10)
-
- -
-
- - -
-
- - - diff --git a/prefer_self_in_static_references.html b/prefer_self_in_static_references.html deleted file mode 100644 index b55fb9fdf..000000000 --- a/prefer_self_in_static_references.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - prefer_self_in_static_references Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Self in Static References

- -

Use Self to refer to the surrounding type name

- -
    -
  • Identifier: prefer_self_in_static_references
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    class C {
-        static let primes = [2, 3, 5, 7]
-        func isPrime(i: Int) -> Bool { Self.primes.contains(i) }
-
-
    struct T {
-        static let i = 0
-    }
-    struct S {
-        static let i = 0
-    }
-    extension T {
-        static let j = S.i + T.i
-        static let k = { T.j }()
-    }
-
-
    class `Self` {
-        static let i = 0
-        func f() -> Int { Self.i }
-    }
-
-

Triggering Examples

-
final class CheckCellView: NSTableCellView {
-  @IBOutlet var checkButton: NSButton!
-
-  override func awakeFromNib() {
-    checkButton.action = #selector(↓CheckCellView.check(_:))
-  }
-
-  @objc func check(_ button: AnyObject?) {}
-}
-
-
    class C {
-        static let i = 1
-        var j: Int {
-            let ii = ↓C.i
-            return ii
-        }
-    }
-
-
    class C {
-        func f() {
-            _ = [↓C]()
-            _ = [Int: ↓C]()
-        }
-    }
-
-
    struct S {
-        let j: Int
-        static let i = 1
-        static func f() -> Int { ↓S.i }
-        func g() -> Any { ↓S.self }
-        func h() -> ↓S { ↓S(j: 2) }
-        func i() -> KeyPath<↓S, Int> { \↓S.j }
-        func j(@Wrap(-↓S.i, ↓S.i) n: Int = ↓S.i) {}
-    }
-
-
    struct S {
-        struct T {
-            static let i = 3
-        }
-        struct R {
-            static let j = S.T.i
-        }
-        static let h = ↓S.T.i + ↓S.R.j
-    }
-
-
    enum E {
-        case A
-        static func f() -> ↓E { ↓E.A }
-        static func g() -> ↓E { ↓E.f() }
-    }
-
- -
-
- - -
-
- - - diff --git a/prefer_self_type_over_type_of_self.html b/prefer_self_type_over_type_of_self.html deleted file mode 100644 index 0d9ae1f67..000000000 --- a/prefer_self_type_over_type_of_self.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - prefer_self_type_over_type_of_self Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Self Type Over Type of Self

- -

Prefer Self over type(of: self) when accessing properties or calling methods

- -
    -
  • Identifier: prefer_self_type_over_type_of_self
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    func bar() {
-        Self.baz()
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(Self.baz)
-    }
-}
-
-
class A {
-    func foo(param: B) {
-        type(of: param).bar()
-    }
-}
-
-
class A {
-    func foo() {
-        print(type(of: self))
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    func bar() {
-        ↓type(of: self).baz()
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(↓type(of: self).baz)
-    }
-}
-
-
class Foo {
-    func bar() {
-        print(↓Swift.type(of: self).baz)
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/prefer_zero_over_explicit_init.html b/prefer_zero_over_explicit_init.html deleted file mode 100644 index 7aac798a3..000000000 --- a/prefer_zero_over_explicit_init.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - prefer_zero_over_explicit_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefer Zero Over Explicit Init

- -

Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0))

- -
    -
  • Identifier: prefer_zero_over_explicit_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
CGRect(x: 0, y: 0, width: 0, height: 1)
-
-
CGPoint(x: 0, y: -1)
-
-
CGSize(width: 2, height: 4)
-
-
CGVector(dx: -5, dy: 0)
-
-
UIEdgeInsets(top: 0, left: 1, bottom: 0, right: 1)
-
-

Triggering Examples

-
↓CGPoint(x: 0, y: 0)
-
-
↓CGPoint(x: 0.000000, y: 0)
-
-
↓CGPoint(x: 0.000000, y: 0.000)
-
-
↓CGRect(x: 0, y: 0, width: 0, height: 0)
-
-
↓CGSize(width: 0, height: 0)
-
-
↓CGVector(dx: 0, dy: 0)
-
-
↓UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-
- -
-
- - -
-
- - - diff --git a/prefixed_toplevel_constant.html b/prefixed_toplevel_constant.html deleted file mode 100644 index 3cc184ba6..000000000 --- a/prefixed_toplevel_constant.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - prefixed_toplevel_constant Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prefixed Top-Level Constant

- -

Top-level constants should be prefixed by k

- -
    -
  • Identifier: prefixed_toplevel_constant
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_private - -false -
  • -
-

Non Triggering Examples

-
private let kFoo = 20.0
-
-
public let kFoo = false
-
-
internal let kFoo = "Foo"
-
-
let kFoo = true
-
-
let Foo = true
-
-
struct Foo {
-    let bar = 20.0
-}
-
-
private var foo = 20.0
-
-
public var foo = false
-
-
internal var foo = "Foo"
-
-
var foo = true
-
-
var foo = true, bar = true
-
-
var foo = true, let kFoo = true
-
-
let
-    kFoo = true
-
-
var foo: Int {
-    return a + b
-}
-
-
let kFoo = {
-    return a + b
-}()
-
-
var foo: String {
-    let bar = ""
-    return bar
-}
-
-
if condition() {
-    let result = somethingElse()
-    print(result)
-    exit()
-}
-
-
[1, 2, 3, 1000, 4000].forEach { number in
-    let isSmall = number < 10
-    if isSmall {
-        print("\(number) is a small number")
-    }
-}
-
-

Triggering Examples

-
private let ↓Foo = 20.0
-
-
public let ↓Foo = false
-
-
internal let ↓Foo = "Foo"
-
-
let ↓Foo = true
-
-
let ↓foo = 2, ↓bar = true
-
-
let
-    ↓foo = true
-
-
let ↓foo = {
-    return a + b
-}()
-
- -
-
- - -
-
- - - diff --git a/private_action.html b/private_action.html deleted file mode 100644 index 35559bfe9..000000000 --- a/private_action.html +++ /dev/null @@ -1,458 +0,0 @@ - - - - private_action Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Actions

- -

IBActions should be private

- -
    -
  • Identifier: private_action
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-    @IBAction private func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction private func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
-}
-
-
private extension Foo {
-    @IBAction func barButtonTapped(_ sender: UIButton) {}
-}
-
-
fileprivate extension Foo {
-    @IBAction func barButtonTapped(_ sender: UIButton) {}
-}
-
-

Triggering Examples

-
class Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
class Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
struct Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
extension Foo {
-    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
public extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
-
internal extension Foo {
-    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
-}
-
- -
-
- - -
-
- - - diff --git a/private_outlet.html b/private_outlet.html deleted file mode 100644 index 30bef4d3b..000000000 --- a/private_outlet.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - private_outlet Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Outlets

- -

IBOutlets should be private to avoid leaking UIKit to higher layers

- -
    -
  • Identifier: private_outlet
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_private_set - -false -
  • -
-

Non Triggering Examples

-
class Foo { @IBOutlet private var label: UILabel? }
-
-
class Foo { @IBOutlet private var label: UILabel! }
-
-
class Foo { var notAnOutlet: UILabel }
-
-
class Foo { @IBOutlet weak private var label: UILabel? }
-
-
class Foo { @IBOutlet private weak var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate weak var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) var label: UILabel! }
-
-
class Foo { @IBOutlet weak private(set) var label: UILabel? }
-
-
class Foo { @IBOutlet private(set) weak var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate(set) weak var label: UILabel? }
-
-

Triggering Examples

-
class Foo { @IBOutlet ↓var label: UILabel? }
-
-
class Foo { @IBOutlet ↓var label: UILabel! }
-
-
class Foo { @IBOutlet private(set) ↓var label: UILabel? }
-
-
class Foo { @IBOutlet fileprivate(set) ↓var label: UILabel? }
-
- -
-
- - -
-
- - - diff --git a/private_over_fileprivate.html b/private_over_fileprivate.html deleted file mode 100644 index be72c0f6d..000000000 --- a/private_over_fileprivate.html +++ /dev/null @@ -1,442 +0,0 @@ - - - - private_over_fileprivate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private over Fileprivate

- -

Prefer private over fileprivate declarations

- -
    -
  • Identifier: private_over_fileprivate
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -validate_extensions - -false -
  • -
-

Non Triggering Examples

-
extension String {}
-
-
private extension String {}
-
-
public 
- enum MyEnum {}
-
-
open extension 
- String {}
-
-
internal extension String {}
-
-
extension String {
-  fileprivate func Something(){}
-}
-
-
class MyClass {
-  fileprivate let myInt = 4
-}
-
-
actor MyActor {
-  fileprivate let myInt = 4
-}
-
-
class MyClass {
-  fileprivate(set) var myInt = 4
-}
-
-
struct Outter {
-  struct Inter {
-    fileprivate struct Inner {}
-  }
-}
-
-

Triggering Examples

-
↓fileprivate enum MyEnum {}
-
-
↓fileprivate class MyClass {
-  fileprivate(set) var myInt = 4
-}
-
-
↓fileprivate actor MyActor {
-  fileprivate let myInt = 4
-}
-
- -
-
- - -
-
- - - diff --git a/private_subject.html b/private_subject.html deleted file mode 100644 index dab40ad62..000000000 --- a/private_subject.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - private_subject Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Combine Subject

- -

Combine Subject should be private

- -
    -
  • Identifier: private_subject
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
final class Foobar {
-    private let goodSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    fileprivate let goodSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    fileprivate let goodSubject: CurrentValueSubject<String, Never>
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<String, Never> = .init("toto")
-}
-
-
final class Foobar {
-    private let goodSubject = PassthroughSubject<Set<String>, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Set<String>, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Set<String>, Never> = .init([])
-}
-
-
final class Foobar {
-    private let goodSubject =
-        PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private let goodSubject:
-        PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject =
-        CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    init() {
-        let goodSubject = CurrentValueSubject<Bool, Never>(true)
-        self.goosSubject = goodSubject
-    }
-}
-
-
func foo() {
-    let goodSubject = PassthroughSubject<Bool, Never>(true)
-}
-
-

Triggering Examples

-
final class Foobar {
-    let ↓badSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject: PassthroughSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let goodSubject: PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    private let goodSubject: PassthroughSubject<Bool, Never>
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
-    private let goodSubject: PassthroughSubject<Bool, Never>
-    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject = CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    let ↓badSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject: CurrentValueSubject<Bool, Never>
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    let goodSubject: CurrentValueSubject<String, Never> = .init("toto")
-}
-
-
final class Foobar {
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(false)
-}
-
-
final class Foobar {
-    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
-    private let goodSubject: CurrentValueSubject<Bool, Never>
-    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(true)
-}
-
-
final class Foobar {
-    let ↓badSubject = PassthroughSubject<Set<String>, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject: PassthroughSubject<Set<String>, Never> = .init()
-}
-
-
final class Foobar {
-    let ↓badSubject: CurrentValueSubject<Set<String>, Never> = .init([])
-}
-
-
final class Foobar {
-    let ↓badSubject =
-        PassthroughSubject<Bool, Never>()
-}
-
-
final class Foobar {
-    let ↓badSubject:
-        PassthroughSubject<Bool, Never> = .init()
-}
-
-
final class Foobar {
-    let ↓badSubject =
-        CurrentValueSubject<Bool, Never>(true)
-}
-
- -
-
- - -
-
- - - diff --git a/private_swiftui_state.html b/private_swiftui_state.html deleted file mode 100644 index 7d6c7b084..000000000 --- a/private_swiftui_state.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - private_swiftui_state Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private SwiftUI State Properties

- -

SwiftUI state properties should be private

- -
    -
  • Identifier: private_swiftui_state
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct MyApp: App {
-    @State private var isPlaying: Bool = false
-}
-
-
struct MyScene: Scene {
-    @State private var isPlaying: Bool = false
-}
-
-
struct CofntentView: View {
-    @State private var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    @State private var isPlaying: Bool = false
-
-    struct InnerView: View {
-        @State private var showsIndicator: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-
-    @State var nonTriggeringState: Bool = false
-}
-
-
struct ContentView: View {
-    var s: Int {
-        @State
-        var s: Int = 3
-        return s
-    }
-
-    var body: some View { Text("") }
-}
-
-
struct ContentView: View {
-    var isPlaying = false
-}
-
-
struct MyApp: App {
-    @StateObject private var model = DataModel()
-}
-
-
struct MyScene: Scene {
-    @StateObject private var model = DataModel()
-}
-
-
struct ContentView: View {
-    @StateObject private var model = DataModel()
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @StateObject private var dataModel = DataModel()
-    }
-
-    @StateObject var nonTriggeringObject = MyModel()
-}
-
-
struct Foo {
-    @State var bar = false
-}
-
-
class Foo: ObservableObject {
-    @State var bar = Bar()
-}
-
-
extension MyObject {
-    struct ContentView: View {
-        @State private var isPlaying: Bool = false
-    }
-}
-
-
actor ContentView: View {
-    @State private var isPlaying: Bool = false
-}
-
-

Triggering Examples

-
struct MyApp: App {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyScene: Scene {
-    @State ↓public var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct ContentView: View {
-    struct InnerView: View {
-        @State private var showsIndicator: Bool = false
-    }
-
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-}
-
-
struct MyStruct {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-
-    @State var isPlaying: Bool = false
-}
-
-
final class ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
extension MyObject {
-    struct ContentView: View {
-        @State ↓var isPlaying: Bool = false
-    }
-}
-
-
actor ContentView: View {
-    @State ↓var isPlaying: Bool = false
-}
-
-
struct MyApp: App {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct MyScene: Scene {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct ContentView: View {
-    @StateObject ↓var model = DataModel()
-}
-
-
struct ContentView: View {
-    @State ↓private(set) var isPlaying = false
-
-
struct ContentView: View {
-    @State ↓fileprivate(set) public var isPlaying = false
-
- -
-
- - -
-
- - - diff --git a/private_unit_test.html b/private_unit_test.html deleted file mode 100644 index 7b2aa8b58..000000000 --- a/private_unit_test.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - private_unit_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Private Unit Test

- -

Unit tests marked private are silently skipped

- -
    -
  • Identifier: private_unit_test
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
    -regex - -“XCTestCase” -
  • -
-

Non Triggering Examples

-
class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
internal class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
public class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
@objc private class FooTest: XCTestCase {
-    @objc private func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
private class Foo: NSObject {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
private class Foo {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-}
-
-
public class FooTest: XCTestCase {
-    private func test1(param: Int) {}
-    private func test2() -> String { "" }
-    private func atest() {}
-    private static func test3() {}
-}
-
-

Triggering Examples

-
private ↓class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private func test4() {}
-}
-
-
class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
-
internal class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
-
public class FooTest: XCTestCase {
-    func test1() {}
-    internal func test2() {}
-    public func test3() {}
-    private ↓func test4() {}
-}
-
- -
-
- - -
-
- - - diff --git a/prohibited_interface_builder.html b/prohibited_interface_builder.html deleted file mode 100644 index 3334fc2e9..000000000 --- a/prohibited_interface_builder.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - prohibited_interface_builder Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prohibited Interface Builder

- -

Creating views using Interface Builder should be avoided

- -
    -
  • Identifier: prohibited_interface_builder
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-    var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @objc func buttonTapped(_ sender: UIButton) {}
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet ↓var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @IBAction ↓func buttonTapped(_ sender: UIButton) {}
-}
-
- -
-
- - -
-
- - - diff --git a/prohibited_super_call.html b/prohibited_super_call.html deleted file mode 100644 index 31182923a..000000000 --- a/prohibited_super_call.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - prohibited_super_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Prohibited Calls to Super

- -

Some methods should not call super.

- -
    -
  • Identifier: prohibited_super_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -excluded - -[] -
    -included - -[“*”] -
  • -
-

Non Triggering Examples

-
class VC: UIViewController {
-    override func loadView() {
-    }
-}
-
-
class NSView {
-    func updateLayer() {
-        self.method1()
-    }
-}
-
-
public class FileProviderExtension: NSFileProviderExtension {
-    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {
-        guard let identifier = persistentIdentifierForItem(at: url) else {
-            completionHandler(NSFileProviderError(.noSuchItem))
-            return
-        }
-    }
-}
-
-

Triggering Examples

-
class VC: UIViewController {
-    override func loadView() {↓
-        super.loadView()
-    }
-}
-
-
class VC: NSFileProviderExtension {
-    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {↓
-        self.method1()
-        super.providePlaceholder(at:url, completionHandler: completionHandler)
-    }
-}
-
-
class VC: NSView {
-    override func updateLayer() {↓
-        self.method1()
-        super.updateLayer()
-        self.method2()
-    }
-}
-
-
class VC: NSView {
-    override func updateLayer() {↓
-        defer {
-            super.updateLayer()
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/protocol_property_accessors_order.html b/protocol_property_accessors_order.html deleted file mode 100644 index a063da82e..000000000 --- a/protocol_property_accessors_order.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - protocol_property_accessors_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Protocol Property Accessors Order

- -

When declaring properties in protocols, the order of accessors should be get set

- -
    -
  • Identifier: protocol_property_accessors_order
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
protocol Foo {
- var bar: String { get set }
- }
-
-
protocol Foo {
- var bar: String { get }
- }
-
-
protocol Foo {
- var bar: String { set }
- }
-
-

Triggering Examples

-
protocol Foo {
- var bar: String { ↓set get }
- }
-
- -
-
- - -
-
- - - diff --git a/quick_discouraged_call.html b/quick_discouraged_call.html deleted file mode 100644 index 1c32bae36..000000000 --- a/quick_discouraged_call.html +++ /dev/null @@ -1,682 +0,0 @@ - - - - quick_discouraged_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Call

- -

Discouraged call inside ‘describe’ and/or ‘context’ block.

- -
    -
  • Identifier: quick_discouraged_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests {
-   override func spec() {
-       describe("foo") {
-           let foo = Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           beforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           beforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-           afterEach {
-               let foo = Foo()
-               foo.toto()
-           }
-           describe("bar") {
-           }
-           context("bar") {
-           }
-           it("bar") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           justBeforeEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           aroundEach {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-          itBehavesLike("bar")
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           it("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xcontext("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xdescribe("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           xit("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fcontext("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fdescribe("foo") {
-           afterEach { toto.append(foo) }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           fit("does something") {
-               let foo = Foo()
-               foo.toto()
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       fitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xitBehavesLike("foo")
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override static func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("foo") {
-               let foo = ↓Foo()
-           }
-           context("bar") {
-               let foo = ↓Foo()
-               ↓foo.bar()
-               it("does something") {
-                   let foo = Foo()
-                   foo.toto()
-               }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("foo") {
-               context("foo") {
-                   beforeEach {
-                       let foo = Foo()
-                       foo.toto()
-                   }
-                   it("bar") {
-                   }
-                   context("foo") {
-                       let foo = ↓Foo()
-                   }
-               }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       sharedExamples("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       sharedExamples("foo") {
-           ↓foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xdescribe("foo") {
-           let foo = ↓Foo()
-       }
-       fdescribe("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       xcontext("foo") {
-           let foo = ↓Foo()
-       }
-       fcontext("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       xcontext("foo") {
-           let foo = ↓Foo()
-       }
-       fcontext("foo") {
-           let foo = ↓Foo()
-       }
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/quick_discouraged_focused_test.html b/quick_discouraged_focused_test.html deleted file mode 100644 index ec640b0f7..000000000 --- a/quick_discouraged_focused_test.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - quick_discouraged_focused_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Focused Test

- -

Non-focused tests won’t run as long as this test is focused

- -
    -
  • Identifier: quick_discouraged_focused_test
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           describe("bar") { }
-           context("bar") {
-               it("bar") { }
-           }
-           it("bar") { }
-           itBehavesLike("bar")
-       }
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fdescribe("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fcontext("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fit("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓fit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓fit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("bar") {
-               ↓fit("toto") { }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓fitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       ↓fitBehavesLike("foo")
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/quick_discouraged_pending_test.html b/quick_discouraged_pending_test.html deleted file mode 100644 index 5319fee84..000000000 --- a/quick_discouraged_pending_test.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - quick_discouraged_pending_test Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Quick Discouraged Pending Test

- -

This test won’t run as long as it’s marked pending

- -
    -
  • Identifier: quick_discouraged_pending_test
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           describe("bar") { }
-           context("bar") {
-               it("bar") { }
-           }
-           it("bar") { }
-           itBehavesLike("bar")
-       }
-   }
-}
-
-

Triggering Examples

-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xdescribe("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xcontext("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xit("foo") { }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           ↓xit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       context("foo") {
-           ↓xit("bar") { }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       describe("foo") {
-           context("bar") {
-               ↓xit("toto") { }
-           }
-       }
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓pending("foo")
-   }
-}
-
-
class TotoTests: QuickSpec {
-   override func spec() {
-       ↓xitBehavesLike("foo")
-   }
-}
-
-
class TotoTests: QuickSpecSubclass {
-   override func spec() {
-       ↓xitBehavesLike("foo")
-   }
-}
-
- -
-
- - -
-
- - - diff --git a/raw_value_for_camel_cased_codable_enum.html b/raw_value_for_camel_cased_codable_enum.html deleted file mode 100644 index 57c92fc3a..000000000 --- a/raw_value_for_camel_cased_codable_enum.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - raw_value_for_camel_cased_codable_enum Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Raw Value for Camel Cased Codable Enum

- -

Camel cased cases of Codable String enums should have raw values

- -
    -
  • Identifier: raw_value_for_camel_cased_codable_enum
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers: Codable {
-  case int(Int)
-  case short(Int16)
-}
-
-
enum Numbers: Int, Codable {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: Double, Codable {
-  case one = 1.1
-  case two = 2.2
-}
-
-
enum Numbers: String, Codable {
-  case one = "one"
-  case two = "two"
-}
-
-
enum Status: String, Codable {
-    case OK, ACCEPTABLE
-}
-
-
enum Status: String, Codable {
-    case ok
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String {
-    case ok
-    case notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: Int, Codable {
-    case ok
-    case notAcceptable
-    case maybeAcceptable = -1
-}
-
-

Triggering Examples

-
enum Status: String, Codable {
-    case ok
-    case ↓notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Decodable {
-   case ok
-   case ↓notAcceptable
-   case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Encodable {
-   case ok
-   case ↓notAcceptable
-   case maybeAcceptable = "maybe_acceptable"
-}
-
-
enum Status: String, Codable {
-    case ok
-    case ↓notAcceptable
-    case maybeAcceptable = "maybe_acceptable"
-}
-
- -
-
- - -
-
- - - diff --git a/reduce_boolean.html b/reduce_boolean.html deleted file mode 100644 index c221864c5..000000000 --- a/reduce_boolean.html +++ /dev/null @@ -1,414 +0,0 @@ - - - - reduce_boolean Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Reduce Boolean

- -

Prefer using .allSatisfy() or .contains() over reduce(true) or reduce(false).

- -
    -
  • Identifier: reduce_boolean
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
nums.reduce(0) { $0.0 + $0.1 }
-
-
nums.reduce(0.0) { $0.0 + $0.1 }
-
-
nums.reduce(initial: true) { $0.0 && $0.1 == 3 }
-
-

Triggering Examples

-
let allNines = nums.↓reduce(true) { $0.0 && $0.1 == 9 }
-
-
let anyNines = nums.↓reduce(false) { $0.0 || $0.1 == 9 }
-
-
let allValid = validators.↓reduce(true) { $0 && $1(input) }
-
-
let anyValid = validators.↓reduce(false) { $0 || $1(input) }
-
-
let allNines = nums.↓reduce(true, { $0.0 && $0.1 == 9 })
-
-
let anyNines = nums.↓reduce(false, { $0.0 || $0.1 == 9 })
-
-
let allValid = validators.↓reduce(true, { $0 && $1(input) })
-
-
let anyValid = validators.↓reduce(false, { $0 || $1(input) })
-
-
nums.reduce(into: true) { (r: inout Bool, s) in r = r && (s == 3) }
-
- -
-
- - -
-
- - - diff --git a/reduce_into.html b/reduce_into.html deleted file mode 100644 index cec08ec2d..000000000 --- a/reduce_into.html +++ /dev/null @@ -1,465 +0,0 @@ - - - - reduce_into Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Reduce into

- -

Prefer reduce(into:_:) over reduce(_:_:) for copy-on-write types

- -
    -
  • Identifier: reduce_into
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = values.reduce(into: "abc") { $0 += "\($1)" }
-
-
values.reduce(into: Array<Int>()) { result, value in
-    result.append(value)
-}
-
-
let rows = violations.enumerated().reduce(into: "") { rows, indexAndViolation in
-    rows.append(generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1))
-}
-
-
zip(group, group.dropFirst()).reduce(into: []) { result, pair in
-    result.append(pair.0 + pair.1)
-}
-
-
let foo = values.reduce(into: [String: Int]()) { result, value in
-    result["\(value)"] = value
-}
-
-
let foo = values.reduce(into: Dictionary<String, Int>.init()) { result, value in
-    result["\(value)"] = value
-}
-
-
let foo = values.reduce(into: [Int](repeating: 0, count: 10)) { result, value in
-    result.append(value)
-}
-
-
let foo = values.reduce(MyClass()) { result, value in
-    result.handleValue(value)
-    return result
-}
-
-

Triggering Examples

-
let bar = values.↓reduce("abc") { $0 + "\($1)" }
-
-
values.↓reduce(Array<Int>()) { result, value in
-    result += [value]
-}
-
-
[1, 2, 3].↓reduce(Set<Int>()) { acc, value in
-    var result = acc
-    result.insert(value)
-    return result
-}
-
-
let rows = violations.enumerated().↓reduce("") { rows, indexAndViolation in
-    return rows + generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1)
-}
-
-
zip(group, group.dropFirst()).↓reduce([]) { result, pair in
-    result + [pair.0 + pair.1]
-}
-
-
let foo = values.↓reduce([String: Int]()) { result, value in
-    var result = result
-    result["\(value)"] = value
-    return result
-}
-
-
let bar = values.↓reduce(Dictionary<String, Int>.init()) { result, value in
-    var result = result
-    result["\(value)"] = value
-    return result
-}
-
-
let bar = values.↓reduce([Int](repeating: 0, count: 10)) { result, value in
-    return result + [value]
-}
-
-
extension Data {
-    var hexString: String {
-        return ↓reduce("") { (output, byte) -> String in
-            output + String(format: "%02x", byte)
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/redundant_discardable_let.html b/redundant_discardable_let.html deleted file mode 100644 index 05ab78043..000000000 --- a/redundant_discardable_let.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - redundant_discardable_let Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Discardable Let

- -

Prefer _ = foo() over let _ = foo() when discarding a result from a function

- -
    -
  • Identifier: redundant_discardable_let
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
_ = foo()
-
-
if let _ = foo() { }
-
-
guard let _ = foo() else { return }
-
-
let _: ExplicitType = foo()
-
-
while let _ = SplashStyle(rawValue: maxValue) { maxValue += 1 }
-
-
async let _ = await foo()
-
-

Triggering Examples

-
↓let _ = foo()
-
-
if _ = foo() { ↓let _ = bar() }
-
- -
-
- - -
-
- - - diff --git a/redundant_nil_coalescing.html b/redundant_nil_coalescing.html deleted file mode 100644 index accac1d11..000000000 --- a/redundant_nil_coalescing.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - redundant_nil_coalescing Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Nil Coalescing

- -

nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant

- -
    -
  • Identifier: redundant_nil_coalescing
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var myVar: Int?; myVar ?? 0
-
-

Triggering Examples

-
var myVar: Int? = nil; myVar ↓?? nil
-
- -
-
- - -
-
- - - diff --git a/redundant_objc_attribute.html b/redundant_objc_attribute.html deleted file mode 100644 index deae65214..000000000 --- a/redundant_objc_attribute.html +++ /dev/null @@ -1,580 +0,0 @@ - - - - redundant_objc_attribute Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant @objc Attribute

- -

Objective-C attribute (@objc) is redundant in declaration

- -
    -
  • Identifier: redundant_objc_attribute
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
@objc private var foo: String? {}
-
-
@IBInspectable private var foo: String? {}
-
-
@objc private func foo(_ sender: Any) {}
-
-
@IBAction private func foo(_ sender: Any) {}
-
-
@GKInspectable private var foo: String! {}
-
-
private @GKInspectable var foo: String! {}
-
-
@NSManaged var foo: String!
-
-
@objc @NSCopying var foo: String!
-
-
@objcMembers
-class Foo {
-    var bar: Any?
-    @objc
-    class Bar: NSObject {
-        @objc
-        var foo: Any?
-    }
-}
-
-
@objc
-extension Foo {
-    var bar: Int {
-        return 0
-    }
-}
-
-
extension Foo {
-    @objc
-    var bar: Int { return 0 }
-}
-
-
@objc @IBDesignable
-extension Foo {
-    var bar: Int { return 0 }
-}
-
-
@IBDesignable
-extension Foo {
-    @objc
-    var bar: Int { return 0 }
-    var fooBar: Int { return 1 }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc
-    private var bar: Int {
-        return 0
-    }
-}
-
-
@objcMembers
-class Foo {
-    @objc
-    class Bar: NSObject {
-        @objc var foo: Any?
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc class Bar {}
-}
-
-
extension BlockEditorSettings {
-    @objc(addElementsObject:)
-    @NSManaged public func addToElements(_ value: BlockEditorSettingElement)
-}
-
-
@objcMembers
-public class Foo: NSObject {
-    @objc
-    private func handler(_ notification: Notification) {
-    }
-
-    func registerForNotifications() {
-        NotificationCenter.default.addObserver(self, selector: #selector(handler(_:)), name: nil, object: nil)
-    }
-}
-
-
class Foo: NSObject { }
-
-@objc extension Foo {
-    @objc enum Bar: Int {
-       case bar
-    }
-
-    var bar: Bar { .bar }
-}
-
-
class Foo: NSObject { }
-
-@objc extension Foo {
-    @objc private enum Baz: Int {
-      case baz
-    }
-
-    private var baz: Baz { .baz }
-}
-
-
@objcMembers
-internal class Foo: NSObject {
-    @objc
-    private var baz: Int = 1
-
-    var x: Any? {
-        value(forKey: "baz")
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objc enum Bar: Int {
-       case bar
-    }
-}
-
-

Triggering Examples

-
↓@objc @IBInspectable private var foo: String? {}
-
-
@IBInspectable ↓@objc private var foo: String? {}
-
-
↓@objc @IBAction private func foo(_ sender: Any) {}
-
-
@IBAction ↓@objc private func foo(_ sender: Any) {}
-
-
↓@objc @GKInspectable private var foo: String! {}
-
-
@GKInspectable ↓@objc private var foo: String! {}
-
-
↓@objc @NSManaged private var foo: String!
-
-
@NSManaged ↓@objc private var foo: String!
-
-
↓@objc @IBDesignable class Foo {}
-
-
@objcMembers
-class Foo: NSObject {
-    ↓@objc var bar: Any?
-}
-
-
@objcMembers
-class Foo: NSObject {
-    ↓@objc var bar: Any?
-    ↓@objc var foo: Any?
-    @objc
-    class Bar {
-        @objc
-        var foo: Any?
-    }
-}
-
-
@objc
-extension Foo {
-    ↓@objc
-    var bar: Int {
-        return 0
-    }
-}
-
-
@objc @IBDesignable
-extension Foo {
-    ↓@objc
-    var bar: Int {
-        return 0
-    }
-}
-
-
@objcMembers
-class Foo: NSObject {
-    @objcMembers
-    class Bar: NSObject {
-        ↓@objc var foo: Any
-    }
-}
-
-
@objc
-extension Foo {
-    ↓@objc
-    private var bar: Int {
-        return 0
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/redundant_optional_initialization.html b/redundant_optional_initialization.html deleted file mode 100644 index 57d4ac06e..000000000 --- a/redundant_optional_initialization.html +++ /dev/null @@ -1,441 +0,0 @@ - - - - redundant_optional_initialization Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Optional Initialization

- -

Initializing an optional variable with nil is redundant

- -
    -
  • Identifier: redundant_optional_initialization
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var myVar: Int?
-
-
let myVar: Int? = nil
-
-
var myVar: Int? = 0
-
-
func foo(bar: Int? = 0) { }
-
-
var myVar: Optional<Int>
-
-
let myVar: Optional<Int> = nil
-
-
var myVar: Optional<Int> = 0
-
-
var foo: Int? {
-  if bar != nil { }
-  return 0
-}
-
-
var foo: Int? = {
-  if bar != nil { }
-  return 0
-}()
-
-
lazy var test: Int? = nil
-
-
func funcName() {
-  var myVar: String?
-}
-
-
func funcName() {
-  let myVar: String? = nil
-}
-
-

Triggering Examples

-
var myVar: Int?↓ = nil
-
-
var myVar: Optional<Int>↓ = nil
-
-
var myVar: Int?↓=nil
-
-
var myVar: Optional<Int>↓=nil
-)
-
-
var myVar: String?↓ = nil {
-  didSet { print("didSet") }
-}
-
-
func funcName() {
-    var myVar: String?↓ = nil
-}
-
- -
-
- - -
-
- - - diff --git a/redundant_self_in_closure.html b/redundant_self_in_closure.html deleted file mode 100644 index f44b6dbc1..000000000 --- a/redundant_self_in_closure.html +++ /dev/null @@ -1,559 +0,0 @@ - - - - redundant_self_in_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Self in Closure

- -

Explicit use of ‘self’ is not required

- -
    -
  • Identifier: redundant_self_in_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    struct S {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f {
-                x = 1
-                f { x = 1 }
-                g()
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [weak self] in
-                self?.x = 1
-                self?.g()
-                guard let self = self ?? C() else { return }
-                self?.x = 1
-            }
-            C().f { self.x = 1 }
-            f { [weak self] in if let self { x = 1 } }
-        }
-    }
-
-
    struct S {
-        var x = 0, error = 0, exception = 0
-        var y: Int?, z: Int?, u: Int, v: Int?, w: Int?
-        func f(_ work: @escaping (Int) -> Void) { work() }
-        func g(x: Int) {
-            f { u in
-                self.x = x
-                let x = 1
-                self.x = 2
-                if let y, let v {
-                    self.y = 3
-                    self.v = 1
-                }
-                guard let z else {
-                    let v = 4
-                    self.x = 5
-                    self.v = 6
-                    return
-                }
-                self.z = 7
-                while let v { self.v = 8 }
-                for w in [Int]() { self.w = 9 }
-                self.u = u
-                do {} catch { self.error = 10 }
-                do {} catch let exception { self.exception = 11 }
-            }
-        }
-    }
-
-
    enum E {
-        case a(Int)
-        case b(Int, Int)
-    }
-    struct S {
-        var x: E = .a(3), y: Int, z: Int
-        func f(_ work: @escaping () -> Void) { work() }
-        func g(x: Int) {
-            f {
-                switch x {
-                case let .a(y):
-                    self.y = 1
-                case .b(let y, var z):
-                    self.y = 2
-                    self.z = 3
-                }
-            }
-        }
-    }
-
-

Triggering Examples

-
    struct S {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f {
-                ↓self.x = 1
-                if ↓self.x == 1 { ↓self.g() }
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func g() {
-            {
-                ↓self.x = 1
-                ↓self.g()
-            }()
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [self] in
-                ↓self.x = 1
-                ↓self.g()
-                f { self.x = 1 }
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [unowned self] in ↓self.x = 1 }
-            f { [self = self] in ↓self.x = 1 }
-            f { [s = self] in s.x = 1 }
-        }
-    }
-
-
    struct S {
-        var x = 0
-        var y: Int?, z: Int?, v: Int?, w: Int?
-        func f(_ work: @escaping () -> Void) { work() }
-        func g(w: Int, _ v: Int) {
-            f {
-                self.w = 1
-                ↓self.x = 2
-                if let y { ↓self.x = 3 }
-                else { ↓self.y = 3 }
-                guard let z else {
-                    ↓self.z = 4
-                    ↓self.x = 5
-                    return
-                }
-                ↓self.y = 6
-                while let y { ↓self.x = 7 }
-                for y in [Int]() { ↓self.x = 8 }
-                self.v = 9
-                do {
-                    let x = 10
-                    self.x = 11
-                }
-                ↓self.x = 12
-            }
-        }
-    }
-
-
    class C {
-        var x = 0
-        func f(_ work: @escaping () -> Void) { work() }
-        func g() {
-            f { [weak self] in
-                self?.x = 1
-                guard let self else { return }
-                ↓self.x = 1
-            }
-            f { [weak self] in
-                self?.x = 1
-                if let self = self else { ↓self.x = 1 }
-                self?.x = 1
-            }
-            f { [weak self] in
-                self?.x = 1
-                while let self else { ↓self.x = 1 }
-                self?.x = 1
-            }
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/redundant_set_access_control.html b/redundant_set_access_control.html deleted file mode 100644 index 902b1b779..000000000 --- a/redundant_set_access_control.html +++ /dev/null @@ -1,430 +0,0 @@ - - - - redundant_set_access_control Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Access Control for Setter

- -

Property setter access level shouldn’t be explicit if it’s the same as the variable access level

- -
    -
  • Identifier: redundant_set_access_control
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
private(set) public var foo: Int
-
-
public let foo: Int
-
-
public var foo: Int
-
-
var foo: Int
-
-
private final class A {
-  private(set) var value: Int
-}
-
-
extension Color {
-    public internal(set) static var someColor = Color.anotherColor
-}
-
-

Triggering Examples

-
↓private(set) private var foo: Int
-
-
↓fileprivate(set) fileprivate var foo: Int
-
-
↓internal(set) internal var foo: Int
-
-
↓public(set) public var foo: Int
-
-
open class Foo {
-  ↓open(set) open var bar: Int
-}
-
-
class A {
-  ↓internal(set) var value: Int
-}
-
-
internal class A {
-  ↓internal(set) var value: Int
-}
-
-
fileprivate class A {
-  ↓fileprivate(set) var value: Int
-}
-
- -
-
- - -
-
- - - diff --git a/redundant_string_enum_value.html b/redundant_string_enum_value.html deleted file mode 100644 index cd3ee5a86..000000000 --- a/redundant_string_enum_value.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - redundant_string_enum_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant String Enum Value

- -

String enum values can be omitted when they are equal to the enumcase name

- -
    -
  • Identifier: redundant_string_enum_value
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum Numbers: String {
-  case one
-  case two
-}
-
-
enum Numbers: Int {
-  case one = 1
-  case two = 2
-}
-
-
enum Numbers: String {
-  case one = "ONE"
-  case two = "TWO"
-}
-
-
enum Numbers: String {
-  case one = "ONE"
-  case two = "two"
-}
-
-
enum Numbers: String {
-  case one, two
-}
-
-

Triggering Examples

-
enum Numbers: String {
-  case one = ↓"one"
-  case two = ↓"two"
-}
-
-
enum Numbers: String {
-  case one = ↓"one", two = ↓"two"
-}
-
-
enum Numbers: String {
-  case one, two = ↓"two"
-}
-
- -
-
- - -
-
- - - diff --git a/redundant_type_annotation.html b/redundant_type_annotation.html deleted file mode 100644 index 89208d194..000000000 --- a/redundant_type_annotation.html +++ /dev/null @@ -1,550 +0,0 @@ - - - - redundant_type_annotation Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Type Annotation

- -

Variables should not have redundant type annotation

- -
    -
  • Identifier: redundant_type_annotation
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignore_attributes - -[“IBInspectable”] -
    -consider_default_literal_types_redundant - -false -
  • -
-

Non Triggering Examples

-
var url = URL()
-
-
var url: CustomStringConvertible = URL()
-
-
var one: Int = 1, two: Int = 2, three: Int
-
-
guard let url = URL() else { return }
-
-
if let url = URL() { return }
-
-
let alphanumerics = CharacterSet.alphanumerics
-
-
var set: Set<Int> = Set([])
-
-
var set: Set<Int> = Set.init([])
-
-
var set = Set<Int>([])
-
-
var set = Set<Int>.init([])
-
-
guard var set: Set<Int> = Set([]) else { return }
-
-
if var set: Set<Int> = Set.init([]) { return }
-
-
guard var set = Set<Int>([]) else { return }
-
-
if var set = Set<Int>.init([]) { return }
-
-
var one: A<T> = B()
-
-
var one: A = B<T>()
-
-
var one: A<T> = B<T>()
-
-
let a = A.b.c.d
-
-
let a: B = A.b.c.d
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction: Direction = .up
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction = Direction.up
-
-
@IgnoreMe var a: Int = Int(5)
-
-
var a: Int {
-    @IgnoreMe let i: Int = Int(1)
-    return i
-}
-
-
var bol: Bool = true
-
-
var dbl: Double = 0.0
-
-
var int: Int = 0
-
-
var str: String = "str"
-
-

Triggering Examples

-
var url↓:URL=URL()
-
-
var url↓:URL = URL(string: "")
-
-
var url↓: URL = URL()
-
-
let url↓: URL = URL()
-
-
lazy var url↓: URL = URL()
-
-
let url↓: URL = URL()!
-
-
var one: Int = 1, two↓: Int = Int(5), three: Int
-
-
guard let url↓: URL = URL() else { return }
-
-
if let url↓: URL = URL() { return }
-
-
let alphanumerics↓: CharacterSet = CharacterSet.alphanumerics
-
-
var set↓: Set<Int> = Set<Int>([])
-
-
var set↓: Set<Int> = Set<Int>.init([])
-
-
var set↓: Set = Set<Int>([])
-
-
var set↓: Set = Set<Int>.init([])
-
-
guard var set↓: Set = Set<Int>([]) else { return }
-
-
if var set↓: Set = Set<Int>.init([]) { return }
-
-
guard var set↓: Set<Int> = Set<Int>([]) else { return }
-
-
if var set↓: Set<Int> = Set<Int>.init([]) { return }
-
-
var set↓: Set = Set<Int>([]), otherSet: Set<Int>
-
-
var num↓: Int = Int.random(0..<10)
-
-
let a↓: A = A.b.c.d
-
-
let a↓: A = A.f().b
-
-
class ViewController: UIViewController {
-  func someMethod() {
-    let myVar↓: Int = Int(5)
-  }
-}
-
-
let a↓: [Int] = [Int]()
-
-
let a↓: A.B = A.B()
-
-
enum Direction {
-    case up
-    case down
-}
-
-var direction↓: Direction = Direction.up
-
-
@DontIgnoreMe var a↓: Int = Int(5)
-
-
@IgnoreMe
-var a: Int {
-    let i↓: Int = Int(1)
-    return i
-}
-
-
var bol↓: Bool = true
-
-
var dbl↓: Double = 0.0
-
-
var int↓: Int = 0
-
-
var str↓: String = "str"
-
- -
-
- - -
-
- - - diff --git a/redundant_void_return.html b/redundant_void_return.html deleted file mode 100644 index ec9c3f685..000000000 --- a/redundant_void_return.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - redundant_void_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Redundant Void Return

- -

Returning Void in a function declaration is redundant

- -
    -
  • Identifier: redundant_void_return
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -include_closures - -true -
  • -
-

Non Triggering Examples

-
func foo() {}
-
-
func foo() -> Int {}
-
-
func foo() -> Int -> Void {}
-
-
func foo() -> VoidResponse
-
-
let foo: (Int) -> Void
-
-
func foo() -> Int -> () {}
-
-
let foo: (Int) -> ()
-
-
func foo() -> ()?
-
-
func foo() -> ()!
-
-
func foo() -> Void?
-
-
func foo() -> Void!
-
-
struct A {
-    subscript(key: String) {
-        print(key)
-    }
-}
-
-
doSomething { arg -> Void in
-    print(arg)
-}
-
-

Triggering Examples

-
func foo()↓ -> Void {}
-
-
protocol Foo {
-  func foo()↓ -> Void
-}
-
-
func foo()↓ -> () {}
-
-
func foo()↓ -> ( ) {}
-
-
protocol Foo {
-  func foo()↓ -> ()
-}
-
-
doSomething { arg↓ -> () in
-    print(arg)
-}
-
-
doSomething { arg↓ -> Void in
-    print(arg)
-}
-
- -
-
- - -
-
- - - diff --git a/required_deinit.html b/required_deinit.html deleted file mode 100644 index 562d396ee..000000000 --- a/required_deinit.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - required_deinit Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Required Deinit

- -

Classes should have an explicit deinit method

- -
    -
  • Identifier: required_deinit
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Apple {
-    deinit { }
-}
-
-
enum Banana { }
-
-
protocol Cherry { }
-
-
struct Damson { }
-
-
class Outer {
-    deinit { print("Deinit Outer") }
-    class Inner {
-        deinit { print("Deinit Inner") }
-    }
-}
-
-

Triggering Examples

-
↓class Apple { }
-
-
↓class Banana: NSObject, Equatable { }
-
-
↓class Cherry {
-    // deinit { }
-}
-
-
↓class Damson {
-    func deinitialize() { }
-}
-
-
class Outer {
-    func hello() -> String { return "outer" }
-    deinit { }
-    ↓class Inner {
-        func hello() -> String { return "inner" }
-    }
-}
-
-
↓class Outer {
-    func hello() -> String { return "outer" }
-    class Inner {
-        func hello() -> String { return "inner" }
-        deinit { }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/required_enum_case.html b/required_enum_case.html deleted file mode 100644 index 13ee6b523..000000000 --- a/required_enum_case.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - required_enum_case Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Required Enum Case

- -

Enums conforming to a specified protocol must implement a specific case(s).

- -
    -
  • Identifier: required_enum_case
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -{Protocol Name} - - - - - - - - - - - - - - - -
    KeyValue
    -{Case Name 1} - -{warning|error} -
    -{Case Name 2} - -{warning|error} -
    -
  • -
-

Non Triggering Examples

-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error, notConnected
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error, notConnected(error: Error)
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-    case notConnected
-}
-
-
enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-    case notConnected(error: Error)
-}
-
-

Triggering Examples

-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success, error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-}
-
-
↓enum MyNetworkResponse: String, NetworkResponsable {
-    case success
-    case error
-}
-
- -
-
- - -
-
- - - diff --git a/return_arrow_whitespace.html b/return_arrow_whitespace.html deleted file mode 100644 index 64b94efe2..000000000 --- a/return_arrow_whitespace.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - return_arrow_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Returning Whitespace

- -

Return arrow and return type should be separated by a single space or on a separate line

- -
    -
  • Identifier: return_arrow_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func abc() -> Int {}
-
-
func abc() -> [Int] {}
-
-
func abc() -> (Int, Int) {}
-
-
var abc = {(param: Int) -> Void in }
-
-
func abc() ->
-    Int {}
-
-
func abc()
-    -> Int {}
-
-
func reallyLongFunctionMethods<T>(withParam1: Int, param2: String, param3: Bool) where T: AGenericConstraint
-    -> Int {
-    return 1
-}
-
-
typealias SuccessBlock = ((Data) -> Void)
-
-

Triggering Examples

-
func abc()↓->Int {}
-
-
func abc()↓->[Int] {}
-
-
func abc()↓->(Int, Int) {}
-
-
func abc()↓-> Int {}
-
-
func abc()↓->   Int {}
-
-
func abc()↓ ->Int {}
-
-
func abc()↓  ->  Int {}
-
-
var abc = {(param: Int)↓ ->Bool in }
-
-
var abc = {(param: Int)↓->Bool in }
-
-
typealias SuccessBlock = ((Data)↓->Void)
-
-
func abc()
-  ↓->  Int {}
-
-
func abc()
- ↓->  Int {}
-
-
func abc()↓  ->
-  Int {}
-
-
func abc()↓  ->
-Int {}
-
- -
-
- - -
-
- - - diff --git a/return_value_from_void_function.html b/return_value_from_void_function.html deleted file mode 100644 index aafa1c636..000000000 --- a/return_value_from_void_function.html +++ /dev/null @@ -1,604 +0,0 @@ - - - - return_value_from_void_function Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Return Value from Void Function

- -

Returning values from Void functions should be avoided

- -
    -
  • Identifier: return_value_from_void_function
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func foo() {
-    return
-}
-
-
func foo() {
-    return /* a comment */
-}
-
-
func foo() -> Int {
-    return 1
-}
-
-
func foo() -> Void {
-    if condition {
-        return
-    }
-    bar()
-}
-
-
func foo() {
-    return;
-    bar()
-}
-
-
func test() {}
-
-
init?() {
-    guard condition else {
-        return nil
-    }
-}
-
-
init?(arg: String?) {
-    guard arg != nil else {
-        return nil
-    }
-}
-
-
func test() {
-    guard condition else {
-        return
-    }
-}
-
-
func test() -> Result<String, Error> {
-    func other() {}
-    func otherVoid() -> Void {}
-}
-
-
func test() -> Int? {
-    return nil
-}
-
-
func test() {
-    if bar {
-        print("")
-        return
-    }
-    let foo = [1, 2, 3].filter { return true }
-    return
-}
-
-
func test() {
-    guard foo else {
-        bar()
-        return
-    }
-}
-
-
func spec() {
-    var foo: Int {
-        return 0
-    }
-
-
func f() -> () { g() }
-
-
func f() { g() }
-
-
func f() { { return g() }() }
-
-
func f() {
-    func g() -> Int {
-        return 1
-    }
-}
-
-
init?() { return nil }
-
-
func f() {
-    var i: Int { return 1 }
-}
-
-

Triggering Examples

-
func foo() {
-    ↓return bar()
-}
-
-
func foo() -> () {
-    ↓return self.bar()
-}
-
-
func foo() -> Void {
-    ↓return bar()
-}
-
-
func foo() -> Void {
-    ↓return /* comment */ bar()
-}
-
-
func foo() {
-    ↓return
-    self.bar()
-}
-
-
func foo() {
-    variable += 1
-    ↓return
-    variable += 1
-}
-
-
func initThing() {
-    guard foo else {
-        ↓return print("")
-    }
-}
-
-
// Leading comment
-func test() {
-    guard condition else {
-        ↓return assertionfailure("")
-    }
-}
-
-
func test() -> Result<String, Error> {
-    func other() {
-        guard false else {
-            ↓return assertionfailure("")
-        }
-    }
-    func otherVoid() -> Void {}
-}
-
-
func test() {
-    guard conditionIsTrue else {
-        sideEffects()
-        return // comment
-    }
-    guard otherCondition else {
-        ↓return assertionfailure("")
-    }
-    differentSideEffect()
-}
-
-
func test() {
-    guard otherCondition else {
-        ↓return assertionfailure(""); // comment
-    }
-    differentSideEffect()
-}
-
-
func test() {
-  if x {
-    ↓return foo()
-  }
-  bar()
-}
-
-
func test() {
-  switch x {
-    case .a:
-      ↓return foo() // return to skip baz()
-    case .b:
-      bar()
-  }
-  baz()
-}
-
-
func test() {
-  if check {
-    if otherCheck {
-      ↓return foo()
-    }
-  }
-  bar()
-}
-
-
func test() {
-    ↓return foo()
-}
-
-
func test() {
-  ↓return foo({
-    return bar()
-  })
-}
-
-
func test() {
-  guard x else {
-    ↓return foo()
-  }
-  bar()
-}
-
-
func test() {
-  let closure: () -> () = {
-    return assert()
-  }
-  if check {
-    if otherCheck {
-      return // comments are fine
-    }
-  }
-  ↓return foo()
-}
-
- -
-
- - -
-
- - - diff --git a/rule-directory.html b/rule-directory.html deleted file mode 100644 index 768dbd352..000000000 --- a/rule-directory.html +++ /dev/null @@ -1,611 +0,0 @@ - - - - Rule Directory Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Rule Directory

-

Default Rules

- - -

Opt-in Rules

- - -

Analyzer Rules

- - - -
-
- - -
-
- - - diff --git a/search.json b/search.json deleted file mode 100644 index fcecd3151..000000000 --- a/search.json +++ /dev/null @@ -1 +0,0 @@ -{"Structs/ViolationCorrection.html#/s:13SwiftLintCore19ViolationCorrectionV5start0A6Syntax16AbsolutePositionVvp":{"name":"start","abstract":"

Start position of the violation range.

","parent_name":"ViolationCorrection"},"Structs/ViolationCorrection.html#/s:13SwiftLintCore19ViolationCorrectionV5start3end11replacementAC0A6Syntax16AbsolutePositionV_AISStcfc":{"name":"init(start:end:replacement:)","abstract":"

Create a ViolationCorrection.

","parent_name":"ViolationCorrection"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV7warningSivp":{"name":"warning","abstract":"

The threshold for a violation to be a warning.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV5errorSiSgvp":{"name":"error","abstract":"

The threshold for a violation to be an error.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV7warning5errorACyxGSi_SiSgtcfc":{"name":"init(warning:error:)","abstract":"

Create a SeverityLevelsConfiguration based on the sepecified warning and error thresholds.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore27SeverityLevelsConfigurationV6paramsSayAA13RuleParameterVySiGGvp":{"name":"params","abstract":"

The rule parameters that define the thresholds that should map to each severity.

","parent_name":"SeverityLevelsConfiguration"},"Structs/SeverityLevelsConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"SeverityLevelsConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV10identifierSSvp":{"name":"identifier","abstract":"

The identifier for this custom rule.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV4nameSSSgvp":{"name":"name","abstract":"

The name for this custom rule.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV7messageSSvp":{"name":"message","abstract":"

The message to be presented when producing violations.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV8includedSaySo19NSRegularExpressionCGvp":{"name":"included","abstract":"

Regular expressions to include when matching the file path.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV8excludedSaySo19NSRegularExpressionCGvp":{"name":"excluded","abstract":"

Regular expressions to exclude when matching the file path.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV18excludedMatchKindsShy21SourceKittenFramework10SyntaxKindOGvp":{"name":"excludedMatchKinds","abstract":"

The syntax kinds to exclude from matches. If the regex matched syntax kinds from this list, it would","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV12captureGroupSivp":{"name":"captureGroup","abstract":"

The index of the regex capture group to match.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore24CacheDescriptionProviderP05cacheE0SSvp":{"name":"cacheDescription","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV11descriptionAA15RuleDescriptionVvp":{"name":"description","abstract":"

The RuleDescription for the custom rule defined here.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore18RegexConfigurationV10identifierACyxGSS_tcfc":{"name":"init(identifier:)","abstract":"

Create a RegexConfiguration with the specified identifier, with other properties to be set later.

","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"RegexConfiguration"},"Structs/RegexConfiguration.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"RegexConfiguration"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8position0A6Syntax16AbsolutePositionVvp":{"name":"position","abstract":"

The violation’s position.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV6reasonSSSgvp":{"name":"reason","abstract":"

A specific reason for the violation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8severityAA0F8SeverityOSgvp":{"name":"severity","abstract":"

The violation’s severity.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:13SwiftLintCore21ReasonedRuleViolationV8position6reason8severityAC0A6Syntax16AbsolutePositionV_SSSgAA0F8SeverityOSgtcfc":{"name":"init(position:reason:severity:)","abstract":"

Creates a ReasonedRuleViolation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ReasonedRuleViolation"},"Structs/YamlParser.html#/s:13SwiftLintCore10YamlParserV5parse_3envSDySSypGSS_SDyS2SGtKFZ":{"name":"parse(_:env:)","abstract":"

Parses the input YAML string as an untyped dictionary.

","parent_name":"YamlParser"},"Structs/Version.html#/s:13SwiftLintCore7VersionV5valueSSvp":{"name":"value","abstract":"

The string value for this version.

","parent_name":"Version"},"Structs/Version.html#/s:13SwiftLintCore7VersionV7currentACvpZ":{"name":"current","abstract":"

The current SwiftLint version.

","parent_name":"Version"},"Structs/SwiftVersion.html#/s:SY8RawValueQa":{"name":"RawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValuexSg03RawB0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV4fiveACvpZ":{"name":"five","abstract":"

Swift 5.0.x - https://swift.org/download/#swift-50

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotOneACvpZ":{"name":"fiveDotOne","abstract":"

Swift 5.1.x - https://swift.org/download/#swift-51

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotTwoACvpZ":{"name":"fiveDotTwo","abstract":"

Swift 5.2.x - https://swift.org/download/#swift-52

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotThreeACvpZ":{"name":"fiveDotThree","abstract":"

Swift 5.3.x - https://swift.org/download/#swift-53

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotFourACvpZ":{"name":"fiveDotFour","abstract":"

Swift 5.4.x - https://swift.org/download/#swift-54

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotFiveACvpZ":{"name":"fiveDotFive","abstract":"

Swift 5.5.x - https://swift.org/download/#swift-55

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV10fiveDotSixACvpZ":{"name":"fiveDotSix","abstract":"

Swift 5.6.x - https://swift.org/download/#swift-56

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotSevenACvpZ":{"name":"fiveDotSeven","abstract":"

Swift 5.7.x - https://swift.org/download/#swift-57

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV12fiveDotEightACvpZ":{"name":"fiveDotEight","abstract":"

Swift 5.8.x - https://swift.org/download/#swift-58

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV11fiveDotNineACvpZ":{"name":"fiveDotNine","abstract":"

Swift 5.9.x - https://swift.org/download/#swift-59

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:13SwiftLintCore0A7VersionV7currentACvpZ":{"name":"current","abstract":"

The current detected Swift compiler version, based on the currently accessible SourceKit version.

","parent_name":"SwiftVersion"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5value21SourceKittenFramework0dE0Vvp":{"name":"value","abstract":"

The raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV4kind21SourceKittenFramework0D4KindOSgvp":{"name":"kind","abstract":"

The syntax kind associated with is token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5valueAC21SourceKittenFramework0dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV5range21SourceKittenFramework9ByteRangeVvp":{"name":"range","abstract":"

The byte range in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV6offset21SourceKittenFramework9ByteCountVvp":{"name":"offset","abstract":"

The starting byte offset in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:13SwiftLintCore0aB11SyntaxTokenV6length21SourceKittenFramework9ByteCountVvp":{"name":"length","abstract":"

The length in bytes for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5value21SourceKittenFramework0dE0Vvp":{"name":"value","abstract":"

The raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV6tokensSayAA0abD5TokenVGvp":{"name":"tokens","abstract":"

The SwiftLint-specific syntax tokens for this syntax map.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5valueAC21SourceKittenFramework0dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV6tokens11inByteRangeSayAA0abD5TokenVG21SourceKittenFramework0hI0V_tF":{"name":"tokens(inByteRange:)","abstract":"

Returns array of syntax tokens intersecting with byte range.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:13SwiftLintCore0aB9SyntaxMapV5kinds11inByteRangeSay21SourceKittenFramework0D4KindOGAF0hI0V_tF":{"name":"kinds(inByteRange:)","abstract":"

Returns the syntax kinds in the specified byte range.

","parent_name":"SwiftLintSyntaxMap"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV14ruleIdentifierSSvp":{"name":"ruleIdentifier","abstract":"

The identifier of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV15ruleDescriptionSSvp":{"name":"ruleDescription","abstract":"

The description of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8ruleNameSSvp":{"name":"ruleName","abstract":"

The name of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8severityAA0E8SeverityOvp":{"name":"severity","abstract":"

The severity of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV8locationAA8LocationVvp":{"name":"location","abstract":"

The location of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV6reasonSSvp":{"name":"reason","abstract":"

The justification for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV11descriptionSSvp":{"name":"description","abstract":"

A printable description for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV15ruleDescription8severity8location6reasonAcA04RuleG0V_AA0E8SeverityOAA8LocationVSSSgtcfc":{"name":"init(ruleDescription:severity:location:reason:)","abstract":"

Creates a StyleViolation by specifying its properties directly.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV4with8severityAcA0E8SeverityO_tF":{"name":"with(severity:)","abstract":"

Returns the same violation, but with the severity that is passed in

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:13SwiftLintCore14StyleViolationV4with8locationAcA8LocationV_tF":{"name":"with(location:)","abstract":"

Returns the same violation, but with the location that is passed in

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"StyleViolation"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV8severityAA17ViolationSeverityOvp":{"name":"severity","abstract":"

The severity that should be assigned to the violation of this parameter’s value is met.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV5valuexvp":{"name":"value","abstract":"

The value to configure the rule.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:13SwiftLintCore13RuleParameterV8severity5valueACyxGAA17ViolationSeverityO_xtcfc":{"name":"init(severity:value:)","abstract":"

Creates a RuleParameter by specifying its properties directly.

","parent_name":"RuleParameter"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV4listSDySSAA0D0_pXpGvp":{"name":"list","abstract":"

The rules contained in this list.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV5rulesAcA0D0_pXpd_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:13SwiftLintCore8RuleListV5rulesACSayAA0D0_pXpG_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleList"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV10identifierSSvp":{"name":"identifier","abstract":"

The rule’s unique identifier, to be used in configuration files and SwiftLint commands.","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV4nameSSvp":{"name":"name","abstract":"

The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV11descriptionSSvp":{"name":"description","abstract":"

The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV4kindAA0D4KindOvp":{"name":"kind","abstract":"

The RuleKind that best categorizes this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV21nonTriggeringExamplesSayAA7ExampleVGvp":{"name":"nonTriggeringExamples","abstract":"

Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV18triggeringExamplesSayAA7ExampleVGvp":{"name":"triggeringExamples","abstract":"

Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV11correctionsSDyAA7ExampleVAFGvp":{"name":"corrections","abstract":"

Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV17deprecatedAliasesShySSGvp":{"name":"deprecatedAliases","abstract":"

Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV03minA7VersionAA0aG0Vvp":{"name":"minSwiftVersion","abstract":"

The oldest version of the Swift compiler supported by this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV18requiresFileOnDiskSbvp":{"name":"requiresFileOnDisk","abstract":"

Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV07consoleE0SSvp":{"name":"consoleDescription","abstract":"

The console-printable string for this description.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV14allIdentifiersSaySSGvp":{"name":"allIdentifiers","abstract":"

All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:13SwiftLintCore15RuleDescriptionV10identifier4name11description4kind03minA7Version21nonTriggeringExamples010triggeringN011corrections17deprecatedAliases18requiresFileOnDiskACSS_S2SAA0D4KindOAA0aK0VSayAA7ExampleVGATSDyA2SGShySSGSbtcfc":{"name":"init(identifier:name:description:kind:minSwiftVersion:nonTriggeringExamples:triggeringExamples:corrections:deprecatedAliases:requiresFileOnDisk:)","abstract":"

Creates a RuleDescription by specifying all its properties directly.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleDescription"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV5errorACyxGvpZ":{"name":"error","abstract":"

Configuration with a warning severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV7warningACyxGvpZ":{"name":"warning","abstract":"

Configuration with an error severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationVyACyxGAA09ViolationD0Ocfc":{"name":"init(_:)","abstract":"

Create a SeverityConfiguration with the specified severity.

","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"SeverityConfiguration"},"Structs/SeverityConfiguration.html#/s:13SwiftLintCore21SeverityConfigurationV13asDescription4withAA04RuleeG0VSS_tF":{"name":"asDescription(with:)","abstract":"

Severity configurations are special in that they shall not be nested when an option name is provided.","parent_name":"SeverityConfiguration"},"Structs/ConfigurationElement/DeprecationNotice.html#/s:13SwiftLintCore20ConfigurationElementV17DeprecationNoticeO18suggestAlternativeyAEyx_GSS_SStcAGmSQRzAA012AcceptableBydE0RzlF":{"name":"suggestAlternative(ruleID:name:)","abstract":"

Warning suggesting an alternative option.

","parent_name":"DeprecationNotice"},"Structs/ConfigurationElement/DeprecationNotice.html":{"name":"DeprecationNotice","abstract":"

A deprecation notice.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp":{"name":"wrappedValue","abstract":"

Wrapped option value.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV14projectedValueACyxGvp":{"name":"projectedValue","abstract":"

The wrapper itself providing access to all its data. This field can only be accessed by the","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV3keySSvp":{"name":"key","abstract":"

Name of this configuration entry.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV6inlineSbvp":{"name":"inline","abstract":"

Whether this configuration element will be inlined into its description.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3key17deprecationNotice13postprocessorACyxGx_SSAC011DeprecationJ0Oyx_GSgyxzctcfc":{"name":"init(wrappedValue:key:deprecationNotice:postprocessor:)","abstract":"

Default constructor.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV3keyACyqd__SgGSS_tcAERszSQRd__AA012AcceptableBydE0Rd__lufc":{"name":"init(key:)","abstract":"

Constructor for optional values.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue6inlineACyxGx_SbtcAA19InlinableOptionTypeRzrlufc":{"name":"init(wrappedValue:inline:)","abstract":"

Constructor for an InlinableOptionType without a key.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3keyACyxGx_SStcAA19InlinableOptionTypeRzrlufc":{"name":"init(wrappedValue:key:)","abstract":"

Constructor for an InlinableOptionType with a name. The configuration will explicitly not be inlined.

","parent_name":"ConfigurationElement"},"Structs/ConfigurationElement.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"ConfigurationElement"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore23RuleConfigurationOptionV9noOptionsACvpZ":{"name":"noOptions","abstract":"

An option serving as a marker for an empty configuration description.

","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationOption.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"RuleConfigurationOption"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"RuleConfigurationDescription"},"Structs/RuleConfigurationDescription.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"RuleConfigurationDescription"},"Structs/Region.html#/s:13SwiftLintCore6RegionV5startAA8LocationVvp":{"name":"start","abstract":"

The location describing the start of the region. All locations that are less than this value","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV3endAA8LocationVvp":{"name":"end","abstract":"

The location describing the end of the region. All locations that are greater than this value","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV23disabledRuleIdentifiersShyAA0F10IdentifierOGvp":{"name":"disabledRuleIdentifiers","abstract":"

All SwiftLint rule identifiers that are disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV5start3end23disabledRuleIdentifiersAcA8LocationV_AHShyAA0H10IdentifierOGtcfc":{"name":"init(start:end:disabledRuleIdentifiers:)","abstract":"

Creates a Region by setting explicit values for all its properties.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV8containsySbAA8LocationVF":{"name":"contains(_:)","abstract":"

Whether the specific location is contained in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV13isRuleEnabledySbxAA0F0RzlF":{"name":"isRuleEnabled(_:)","abstract":"

Whether the specified rule is enabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV14isRuleDisabledySbxAA0F0RzlF":{"name":"isRuleDisabled(_:)","abstract":"

Whether the specified rule is disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV16areRulesDisabled7ruleIDsSbSaySSG_tF":{"name":"areRulesDisabled(ruleIDs:)","abstract":"

Whether the given rules are disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:13SwiftLintCore6RegionV26deprecatedAliasesDisabling4ruleShySSGx_tAA4RuleRzlF":{"name":"deprecatedAliasesDisabling(rule:)","abstract":"

Returns the deprecated rule aliases that are disabling the specified rule in this region.","parent_name":"Region"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4fileSSSgvp":{"name":"file","abstract":"

The file path on disk for this location.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4lineSiSgvp":{"name":"line","abstract":"

The line offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV9characterSiSgvp":{"name":"character","abstract":"

The character offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV11descriptionSSvp":{"name":"description","abstract":"

A lossless printable description of this location.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV12relativeFileSSSgvp":{"name":"relativeFile","abstract":"

The file path for this location relative to the current working directory.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file4line9characterACSSSg_SiSgAHtcfc":{"name":"init(file:line:character:)","abstract":"

Creates a Location by specifying its properties directly.

","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file10byteOffsetAcA0aB4FileC_21SourceKittenFramework9ByteCountVtcfc":{"name":"init(file:byteOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a byte-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file8positionAcA0aB4FileC_0A6Syntax16AbsolutePositionVtcfc":{"name":"init(file:position:)","abstract":"

Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file.","parent_name":"Location"},"Structs/Location.html#/s:13SwiftLintCore8LocationV4file15characterOffsetAcA0aB4FileC_Sitcfc":{"name":"init(file:characterOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Location"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV15styleViolations5usingSayAA14StyleViolationVGAA11RuleStorageC_tF":{"name":"styleViolations(using:)","abstract":"

Computes or retrieves style violations.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV27styleViolationsAndRuleTimes5usingSayAA14StyleViolationVG_SaySS2id_Sd4timetGtAA0I7StorageC_tF":{"name":"styleViolationsAndRuleTimes(using:)","abstract":"

Computes or retrieves style violations and the time spent executing each rule.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV7correct5usingSayAA10CorrectionVGAA11RuleStorageC_tF":{"name":"correct(using:)","abstract":"

Applies corrections for all rules to this file, returning performed corrections.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:13SwiftLintCore15CollectedLinterV6format7useTabs11indentWidthySb_SitF":{"name":"format(useTabs:indentWidth:)","abstract":"

Formats the file associated with this linter.

","parent_name":"CollectedLinter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV12isCollectingSbvp":{"name":"isCollecting","abstract":"

Whether or not this linter will be used to collect information from several files.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV4file13configuration5cache17compilerArgumentsAcA0aB4FileC_AA13ConfigurationVAA0D5CacheCSgSaySSGtcfc":{"name":"init(file:configuration:cache:compilerArguments:)","abstract":"

Creates a Linter by specifying its properties directly.

","parent_name":"Linter"},"Structs/Linter.html#/s:13SwiftLintCore6LinterV7collect4intoAA09CollectedD0VAA11RuleStorageC_tF":{"name":"collect(into:)","abstract":"

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

","parent_name":"Linter"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4codeSSvp":{"name":"code","abstract":"

The contents of the example

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV13configurationSDySSs8Sendable_pGSgvp":{"name":"configuration","abstract":"

The untyped configuration to apply to the rule, if deviating from the default configuration.","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV20testMultiByteOffsetsSbvp":{"name":"testMultiByteOffsets","abstract":"

Whether the example should be tested by prepending multibyte grapheme clusters

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV11testOnLinuxSbvp":{"name":"testOnLinux","abstract":"

Whether the example should be tested on Linux

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4files12StaticStringVvp":{"name":"file","abstract":"

The path to the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4lineSuvp":{"name":"line","abstract":"

The line in the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV_13configuration20testMultiByteOffsets0F17WrappingInComment0fjK6String0F14DisableCommand0F7OnLinux4file4line24excludeFromDocumentationACSS_SDySSs8Sendable_pGSgS5bs06StaticM0VSuSbtcfc":{"name":"init(_:configuration:testMultiByteOffsets:testWrappingInComment:testWrappingInString:testDisableCommand:testOnLinux:file:line:excludeFromDocumentation:)","abstract":"

Create a new Example with the specified code, file, and line.

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV4with4codeACSS_tF":{"name":"with(code:)","abstract":"

Returns the same example, but with the code that is passed in

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV24removingViolationMarkersACyF":{"name":"removingViolationMarkers()","abstract":"

Returns a copy of the Example with all instances of the “↓” character removed.

","parent_name":"Example"},"Structs/Example.html#/s:13SwiftLintCore7ExampleV7focusedACyF":{"name":"focused()","abstract":"

Makes the current example focused. This is for debugging purposes only.

","parent_name":"Example"},"Structs/Example.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Example"},"Structs/Example.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Example"},"Structs/Example.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Example"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV15ruleDescriptionAA04RuleF0Vvp":{"name":"ruleDescription","abstract":"

The description of the rule for which this correction was applied.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV8locationAA8LocationVvp":{"name":"location","abstract":"

The location of the original violation that was corrected.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV18consoleDescriptionSSvp":{"name":"consoleDescription","abstract":"

The console-printable description for this correction.

","parent_name":"Correction"},"Structs/Correction.html#/s:13SwiftLintCore10CorrectionV15ruleDescription8locationAcA04RuleF0V_AA8LocationVtcfc":{"name":"init(ruleDescription:location:)","abstract":"

Memberwise initializer.

","parent_name":"Correction"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV7defaultACvpZ":{"name":"default","abstract":"

The default Configuration resulting from an empty configuration file.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV15defaultFileNameSSvpZ":{"name":"defaultFileName","abstract":"

The default file name to look for user-defined configurations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13includedPathsSaySSGvp":{"name":"includedPaths","abstract":"

The paths that should be included when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13excludedPathsSaySSGvp":{"name":"excludedPaths","abstract":"

The paths that should be excluded when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV11indentationAC16IndentationStyleOvp":{"name":"indentation","abstract":"

The style to use when indenting Swift source code.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV16warningThresholdSiSgvp":{"name":"warningThreshold","abstract":"

The threshold for the number of warnings to tolerate before treating the lint as having failed.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV8reporterSSSgvp":{"name":"reporter","abstract":"

The identifier for the Reporter to use to report style violations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV9cachePathSSSgvp":{"name":"cachePath","abstract":"

The location of the persisted cache to use with this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV22allowZeroLintableFilesSbvp":{"name":"allowZeroLintableFiles","abstract":"

Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV6strictSbvp":{"name":"strict","abstract":"

Treat warnings as errors

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV013basedOnCustomD5FilesSbvp":{"name":"basedOnCustomConfigurationFiles","abstract":"

This value is true iff the --config parameter was used to specify (a) configuration file(s)","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV5rulesSayAA4Rule_pGvp":{"name":"rules","abstract":"

All rules enabled in this configuration

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV13rootDirectorySSvp":{"name":"rootDirectory","abstract":"

The root directory is the directory that included & excluded paths relate to.","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV9rulesModeAC05RulesF0Ovp":{"name":"rulesMode","abstract":"

The rules mode used for this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:13SwiftLintCore13ConfigurationV18configurationFiles14enableAllRules9cachePath27ignoreParentAndChildConfigs20mockedNetworkResults25useDefaultConfigOnFailureACSaySSG_SbSSSgSbSDyS2SGSbSgtcfc":{"name":"init(configurationFiles:enableAllRules:cachePath:ignoreParentAndChildConfigs:mockedNetworkResults:useDefaultConfigOnFailure:)","abstract":"

Creates a Configuration with convenience parameters.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"Configuration"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO8previousyA2EmF":{"name":"previous","abstract":"

The command should only apply to the line preceding its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO4thisyA2EmF":{"name":"this","abstract":"

The command should only apply to the same line as its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO4nextyA2EmF":{"name":"next","abstract":"

The command should only apply to the line following its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:13SwiftLintCore7CommandV8ModifierO7invalidyA2EmF":{"name":"invalid","abstract":"

The modifier string was invalid.

","parent_name":"Modifier"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO6enableyA2EmF":{"name":"enable","abstract":"

The rule(s) associated with this command should be enabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO7disableyA2EmF":{"name":"disable","abstract":"

The rule(s) associated with this command should be disabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html#/s:13SwiftLintCore7CommandV6ActionO7invalidyA2EmF":{"name":"invalid","abstract":"

The action string was invalid.

","parent_name":"Action"},"Structs/Command/Action.html":{"name":"Action","abstract":"

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

","parent_name":"Command"},"Structs/Command/Modifier.html":{"name":"Modifier","abstract":"

The modifier for a command, used to modify its scope.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV6actionAC6ActionOvp":{"name":"action","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV15ruleIdentifiersShyAA14RuleIdentifierOGvp":{"name":"ruleIdentifiers","abstract":"

The identifiers for the rules associated with this command.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV4lineSivp":{"name":"line","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV9characterSiSgvp":{"name":"character","abstract":"

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

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV8modifierAC8ModifierOSgvp":{"name":"modifier","abstract":"

This command’s modifier, if any.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV6action15ruleIdentifiers4line9character8modifier15trailingCommentA2C6ActionO_ShyAA14RuleIdentifierOGS2iSgAC8ModifierOSgSSSgtcfc":{"name":"init(action:ruleIdentifiers:line:character:modifier:trailingComment:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/Command.html#/s:13SwiftLintCore7CommandV12actionString4line9characterACSS_S2itcfc":{"name":"init(actionString:line:character:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV5errorACyxGvpZ":{"name":"error","abstract":"

Configuration with a warning severity.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV7warningACyxGvpZ":{"name":"warning","abstract":"

Configuration with an error severity.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV3offACyxGvpZ":{"name":"off","abstract":"

Configuration disabling an option.

","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32ChildOptionSeverityConfigurationV8severityAA09ViolationF0OSgvp":{"name":"severity","abstract":"

The ChildOptionSeverityConfiguration mapped to a usually used ViolationSeverity. It’s nil if the option","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","parent_name":"ChildOptionSeverityConfiguration"},"Structs/ChildOptionSeverityConfiguration.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"ChildOptionSeverityConfiguration"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV10violationsSayAA14StyleViolationVGvp":{"name":"violations","abstract":"

The stored violations.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV8fromPathACSS_tKcfc":{"name":"init(fromPath:)","abstract":"

Creates a Baseline from a saved file.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV10violationsACSayAA14StyleViolationVG_tcfc":{"name":"init(violations:)","abstract":"

Creates a Baseline from a list of violations.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV5write6toPathySS_tKF":{"name":"write(toPath:)","abstract":"

Writes a Baseline to disk in JSON format.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV6filterySayAA14StyleViolationVGAGF":{"name":"filter(_:)","abstract":"

Filters out violations that are present in the Baseline.

","parent_name":"Baseline"},"Structs/Baseline.html#/s:13SwiftLintCore8BaselineV7compareySayAA14StyleViolationVGACF":{"name":"compare(_:)","abstract":"

Returns the violations that are present in another Baseline, but not in this one.

","parent_name":"Baseline"},"Structs/Stack.html#/s:13SwiftLintCore5StackVACyxGycfc":{"name":"init()","abstract":"

Creates an empty Stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV5countSivp":{"name":"count","abstract":"

The number of elements in this stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV4pushyyxF":{"name":"push(_:)","abstract":"

Pushes (appends) an element onto the stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV3popxSgyF":{"name":"pop()","abstract":"

Removes and returns the last element of the stack.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV4peekxSgyF":{"name":"peek()","abstract":"

Returns the last element of the stack if the stack is not empty; otherwise, nil.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV8contains5whereS2bxXE_tF":{"name":"contains(where:)","abstract":"

Check whether the sequence contains an element that satisfies the given predicate.

","parent_name":"Stack"},"Structs/Stack.html#/s:13SwiftLintCore5StackV10modifyLast2byyyxzXE_tF":{"name":"modifyLast(by:)","abstract":"

Modify the last element.

","parent_name":"Stack"},"Structs/Stack.html#/s:s28CustomDebugStringConvertibleP16debugDescriptionSSvp":{"name":"debugDescription","parent_name":"Stack"},"Structs/RuleListDocumentation.html#/s:13SwiftLintCore21RuleListDocumentationVyAcA0dE0Vcfc":{"name":"init(_:)","abstract":"

Creates a RuleListDocumentation instance from a RuleList.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html#/s:13SwiftLintCore21RuleListDocumentationV5write2toy10Foundation3URLV_tKF":{"name":"write(to:)","abstract":"

Write the rule list documentation as markdown files to the specified directory.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html":{"name":"RuleListDocumentation","abstract":"

User-facing documentation for a SwiftLint RuleList.

"},"Structs/Stack.html":{"name":"Stack","abstract":"

A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.

"},"Structs/Baseline.html":{"name":"Baseline","abstract":"

A set of violations that can be used to filter newly detected violations.

"},"Structs/ChildOptionSeverityConfiguration.html":{"name":"ChildOptionSeverityConfiguration","abstract":"

A rule configuration that allows to disable (off) an option of a rule or specify its severity level in which"},"Structs/Command.html":{"name":"Command","abstract":"

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

"},"Structs/Configuration.html":{"name":"Configuration","abstract":"

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

"},"Structs/Correction.html":{"name":"Correction","abstract":"

A value describing a SwiftLint violation that was corrected.

"},"Structs/Example.html":{"name":"Example","abstract":"

Captures code and context information for an example of a triggering or"},"Structs/Linter.html":{"name":"Linter","abstract":"

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

"},"Structs/CollectedLinter.html":{"name":"CollectedLinter","abstract":"

Represents a file that can compute style violations and corrections for a list of rules.

"},"Structs/Location.html":{"name":"Location","abstract":"

The placement of a segment of Swift in a collection of source files.

"},"Structs/Region.html":{"name":"Region","abstract":"

A contiguous region of Swift source code.

"},"Structs/RuleConfigurationDescription.html":{"name":"RuleConfigurationDescription","abstract":"

Description of a rule configuration.

"},"Structs/RuleConfigurationOption.html":{"name":"RuleConfigurationOption","abstract":"

A single option of a RuleConfigurationDescription.

"},"Structs.html#/s:13SwiftLintCore35RuleConfigurationDescriptionBuilderV":{"name":"RuleConfigurationDescriptionBuilder","abstract":"

A result builder creating configuration descriptions.

"},"Structs/ConfigurationElement.html":{"name":"ConfigurationElement","abstract":"

A single parameter of a rule configuration.

"},"Structs/SeverityConfiguration.html":{"name":"SeverityConfiguration","abstract":"

A rule configuration that allows specifying the desired severity level for violations.

"},"Structs/RuleDescription.html":{"name":"RuleDescription","abstract":"

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

"},"Structs/RuleList.html":{"name":"RuleList","abstract":"

A list of available SwiftLint rules.

"},"Structs/RuleParameter.html":{"name":"RuleParameter","abstract":"

A configuration parameter for rules.

"},"Structs/StyleViolation.html":{"name":"StyleViolation","abstract":"

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

"},"Structs/SwiftLintSyntaxMap.html":{"name":"SwiftLintSyntaxMap","abstract":"

Represents a Swift file’s syntax information.

"},"Structs/SwiftLintSyntaxToken.html":{"name":"SwiftLintSyntaxToken","abstract":"

A SwiftLint-aware Swift syntax token.

"},"Structs/SwiftVersion.html":{"name":"SwiftVersion","abstract":"

A value describing the version of the Swift compiler.

"},"Structs/Version.html":{"name":"Version","abstract":"

A type describing the SwiftLint version.

"},"Structs/YamlParser.html":{"name":"YamlParser","abstract":"

An interface for parsing YAML.

"},"Structs/ReasonedRuleViolation.html":{"name":"ReasonedRuleViolation","abstract":"

A violation produced by ViolationsSyntaxVisitors.

"},"Structs/RegexConfiguration.html":{"name":"RegexConfiguration","abstract":"

A rule configuration used for defining custom rules in yaml.

"},"Structs/SeverityLevelsConfiguration.html":{"name":"SeverityLevelsConfiguration","abstract":"

A rule configuration that allows specifying thresholds for warning and error severities.

"},"Structs/ViolationCorrection.html":{"name":"ViolationCorrection","abstract":"

The correction of a violation that is basically the violation’s range in the source code and a"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP11makeVisitor4fileAA010ViolationsdG0Cy17ConfigurationTypeQzGAA0aB4FileC_tF":{"name":"makeVisitor(file:)","abstract":"

Produce a ViolationsSyntaxVisitor for the given file.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP13makeViolation4file9violationAA05StyleG0VAA0aB4FileC_AA08ReasonedeG0VtF":{"name":"makeViolation(file:violation:)","abstract":"

Produce a violation for the given file and absolute position.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore0A10SyntaxRuleP10preprocess4file0aD0010SourceFileD0VSgAA0abI0C_tF":{"name":"preprocess(file:)","abstract":"

Gives a chance for the rule to do some pre-processing on the syntax tree.","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxCorrectableRule.html#/s:13SwiftLintCore0A21SyntaxCorrectableRuleP12makeRewriter4fileAA010ViolationsdH0Cy17ConfigurationTypeQzGSgAA0aB4FileC_tF":{"name":"makeRewriter(file:)","abstract":"

Produce a ViolationsSyntaxRewriter for the given file.

","parent_name":"SwiftSyntaxCorrectableRule"},"Protocols/SwiftSyntaxCorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","parent_name":"SwiftSyntaxCorrectableRule"},"Protocols/SeverityBasedRuleConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vy6ParentQzGvp":{"name":"severityConfiguration","abstract":"

The configuration of a rule’s severity.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/SeverityBasedRuleConfiguration.html#/s:13SwiftLintCore30SeverityBasedRuleConfigurationPAAE8severityAA09ViolationD0Ovp":{"name":"severity","abstract":"

The severity of a rule.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP6ParentQa":{"name":"Parent","abstract":"

The type of the rule that’s using this configuration.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP20parameterDescriptionAA0deG0VSgvp":{"name":"parameterDescription","abstract":"

A description for this configuration’s parameters. It can be built using the annotated result builder.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","abstract":"

Apply an untyped configuration to the current value.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:13SwiftLintCore17RuleConfigurationPAAE13supportedKeysShySSGvp":{"name":"supportedKeys","abstract":"

All keys supported by this configuration.

","parent_name":"RuleConfiguration"},"Protocols/AnalyzerRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"AnalyzerRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore27SubstitutionCorrectableRuleP15violationRanges2inSaySo8_NSRangeVGAA0aB4FileC_tF":{"name":"violationRanges(in:)","abstract":"

Returns the NSString-based NSRanges to be replaced in the specified file.

","parent_name":"SubstitutionCorrectableRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore27SubstitutionCorrectableRuleP12substitution3for2inSo8_NSRangeV_SStSgAH_AA0aB4FileCtF":{"name":"substitution(for:in:)","abstract":"

Returns the substitution to apply for the given range.

","parent_name":"SubstitutionCorrectableRule"},"Protocols/SubstitutionCorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","parent_name":"SubstitutionCorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4file17compilerArgumentsSayAA10CorrectionVGAA0aB4FileC_SaySSGtF":{"name":"correct(file:compilerArguments:)","abstract":"

Attempts to correct the violations to this rule in the specified file.

","parent_name":"CorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4fileSayAA10CorrectionVGAA0aB4FileC_tF":{"name":"correct(file:)","abstract":"

Attempts to correct the violations to this rule in the specified file.

","parent_name":"CorrectableRule"},"Protocols/CorrectableRule.html#/s:13SwiftLintCore15CorrectableRuleP7correct4file5using17compilerArgumentsSayAA10CorrectionVGAA0aB4FileC_AA0E7StorageCSaySSGtF":{"name":"correct(file:using:compilerArguments:)","abstract":"

Attempts to correct the violations to this rule in the specified file after collecting file info for all files","parent_name":"CorrectableRule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11DescriptionQa":{"name":"Description","abstract":"

The rule’s description type.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP17ConfigurationTypeQa":{"name":"ConfigurationType","abstract":"

The type of the configuration used to configure this rule.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11descriptionAA0D11DescriptionVvpZ":{"name":"description","abstract":"

A verbose description of many of this rule’s properties.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP24configurationDescription0F0Qzvp":{"name":"configurationDescription","abstract":"

A description of how this rule has been configured to run. It can be built using the annotated result builder.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP13configuration17ConfigurationTypeQzvp":{"name":"configuration","abstract":"

This rule’s configuration.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP06shouldB10EmptyFilesSbvp":{"name":"shouldLintEmptyFiles","abstract":"

Whether this rule should be used on empty files. Defaults to false.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePxycfc":{"name":"init()","abstract":"

A default initializer for rules. All rules need to be trivially initializable.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP13configurationxyp_tKcfc":{"name":"init(configuration:)","abstract":"

Creates a rule by applying its configuration.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP9isEqualToySbAaB_pF":{"name":"isEqualTo(_:)","abstract":"

Whether or not the specified rule is equivalent to the current rule.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","abstract":"

Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePAAE16cacheDescriptionSSvp":{"name":"cacheDescription","abstract":"

The cache description which will be used to determine if a previous","parent_name":"Rule"},"Protocols/Rule.html#/s:13SwiftLintCore4RulePAAE10identifierSSvpZ":{"name":"identifier","abstract":"

The rule’s unique identifier which is the same as Rule.description.identifier.

","parent_name":"Rule"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP10identifierSSvpZ":{"name":"identifier","abstract":"

The unique identifier for this reporter.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","abstract":"

Whether or not this reporter can output incrementally as violations are found or if all violations must be","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP11descriptionSSvpZ":{"name":"description","abstract":"

A more detailed description of the reporter’s output.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP11descriptionSSvp":{"name":"description","abstract":"

For CustomStringConvertible conformance.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:13SwiftLintCore8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","abstract":"

Return a string with the report for the specified violations.

","parent_name":"Reporter"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8FileInfoQa":{"name":"FileInfo","abstract":"

The kind of information to collect for each file being linted for this rule.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP11collectInfo3for17compilerArguments04FileG0QzAA0abK0C_SaySSGtF":{"name":"collectInfo(for:compilerArguments:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP11collectInfo3for04FileG0QzAA0abI0C_tF":{"name":"collectInfo(for:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8validate4file13collectedInfo17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SDyAL0nI0QzGSaySSGtF":{"name":"validate(file:collectedInfo:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore14CollectingRuleP8validate4file13collectedInfoSayAA14StyleViolationVGAA0aB4FileC_SDyAK0lI0QzGtF":{"name":"validate(file:collectedInfo:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:13SwiftLintCore4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CacheDescriptionProvider.html#/s:13SwiftLintCore24CacheDescriptionProviderP05cacheE0SSvp":{"name":"cacheDescription","abstract":"

The cache description which will be used to determine if a previous","parent_name":"CacheDescriptionProvider"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP8KindTypeQa":{"name":"KindType","abstract":"

The kind of token being recursed over.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP8validate4file4kind10dictionarySayAA14StyleViolationVGAA0aB4FileC_8KindTypeQzAA22SourceKittenDictionaryVtF":{"name":"validate(file:kind:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRuleP4kind4from8KindTypeQzSgAA22SourceKittenDictionaryV_tF":{"name":"kind(from:)","abstract":"

Get the kind from the specified dictionary.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:13SwiftLintCore7ASTRulePAAE8validate4file10dictionarySayAA14StyleViolationVGAA0aB4FileC_AA22SourceKittenDictionaryVtF":{"name":"validate(file:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","abstract":"

Initializer taking a value from a configuration to create an element of Self.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","abstract":"

Make the object an option.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP13asDescription4withAA04RulefI0VSS_tF":{"name":"asDescription(with:)","abstract":"

Make the object a description.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/AcceptableByConfigurationElement.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP5apply_6ruleIDyypSg_SStKF":{"name":"apply(_:ruleID:)","abstract":"

Update the object.

","parent_name":"AcceptableByConfigurationElement"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","abstract":"

Convert an object to Markdown.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","abstract":"

Convert an object to a single line string.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","abstract":"

Indicate if the item has some content that is useful to document.

","parent_name":"Documentable"},"Protocols/Documentable.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","abstract":"

Convert an object to YAML as used in .swiftlint.yml.

","parent_name":"Documentable"},"Protocols/Documentable.html":{"name":"Documentable","abstract":"

A type that can be converted into a human-readable representation.

"},"Protocols/AcceptableByConfigurationElement.html":{"name":"AcceptableByConfigurationElement","abstract":"

Type of an object that can be used as a configuration element.

"},"Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP":{"name":"InlinableOptionType","abstract":"

An option type that can appear inlined into its using configuration.

"},"Protocols/ASTRule.html":{"name":"ASTRule","abstract":"

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s"},"Protocols/CacheDescriptionProvider.html":{"name":"CacheDescriptionProvider","abstract":"

Interface providing access to a cache description.

"},"Protocols.html#/s:13SwiftLintCore17AnyCollectingRuleP":{"name":"AnyCollectingRule","abstract":"

Type-erased protocol used to check whether a rule is collectable.

"},"Protocols/CollectingRule.html":{"name":"CollectingRule","abstract":"

A rule that requires knowledge of all other files being linted.

"},"Protocols/Reporter.html":{"name":"Reporter","abstract":"

An interface for reporting violations as strings.

"},"Protocols/Rule.html":{"name":"Rule","abstract":"

An executable value that can identify issues (violations) in Swift source code.

"},"Protocols.html#/s:13SwiftLintCore9OptInRuleP":{"name":"OptInRule","abstract":"

A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

"},"Protocols/CorrectableRule.html":{"name":"CorrectableRule","abstract":"

A rule that can correct violations.

"},"Protocols/SubstitutionCorrectableRule.html":{"name":"SubstitutionCorrectableRule","abstract":"

A correctable rule that can apply its corrections by replacing the content of ranges in the offending file with"},"Protocols.html#/s:13SwiftLintCore17SourceKitFreeRuleP":{"name":"SourceKitFreeRule","abstract":"

A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

"},"Protocols/AnalyzerRule.html":{"name":"AnalyzerRule","abstract":"

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like"},"Protocols/RuleConfiguration.html":{"name":"RuleConfiguration","abstract":"

A configuration value for a rule to allow users to modify its behavior.

"},"Protocols/SeverityBasedRuleConfiguration.html":{"name":"SeverityBasedRuleConfiguration","abstract":"

A configuration for a rule that allows to configure at least the severity.

"},"Protocols/SwiftSyntaxCorrectableRule.html":{"name":"SwiftSyntaxCorrectableRule","abstract":"

A SwiftLint CorrectableRule that performs its corrections using a SwiftSyntax SyntaxRewriter.

"},"Protocols/SwiftSyntaxRule.html":{"name":"SwiftSyntaxRule","abstract":"

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

"},"Functions.html#/s:13SwiftLintCore12reporterFrom10identifierAA8Reporter_pXpSSSg_tF":{"name":"reporterFrom(identifier:)","abstract":"

Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any"},"Extensions/Double.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Double"},"Extensions/Double.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Double"},"Extensions/Int.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Int"},"Extensions/Int.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Int"},"Extensions/Set.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Set"},"Extensions/Set.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Set"},"Extensions/String.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"String"},"Extensions/String.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"String"},"Extensions/Bool.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Bool"},"Extensions/Bool.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Bool"},"Extensions/Optional.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Optional"},"Extensions/Optional.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Optional"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE26skipWrappingInCommentTestsSayACGyF":{"name":"skipWrappingInCommentTests()","abstract":"

Make these examples skip wrapping in comment tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE25skipWrappingInStringTestsSayACGyF":{"name":"skipWrappingInStringTests()","abstract":"

Make these examples skip wrapping in string tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE24skipMultiByteOffsetTestsSayACGyF":{"name":"skipMultiByteOffsetTests()","abstract":"

Make these examples skip multi-byte offset tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE23skipDisableCommandTestsSayACGyF":{"name":"skipDisableCommandTests()","abstract":"

Make these examples skip disable command tests.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA7ExampleVRszlE23removingViolationMarkerSayACGyF":{"name":"removingViolationMarker()","abstract":"

Remove all violation markers from the examples.

","parent_name":"Array"},"Extensions/Array.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP8asOptionAA0I4TypeOyF":{"name":"asOption()","parent_name":"Array"},"Extensions/Array.html#/s:13SwiftLintCore32AcceptableByConfigurationElementP7fromAny7contextxyp_SStKcfc":{"name":"init(fromAny:context:)","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA0aB11SyntaxTokenVRszlE5kindsSay21SourceKittenFramework0D4KindOGvp":{"name":"kinds","abstract":"

The kinds for these tokens.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA21ReasonedRuleViolationVRszlE6appendyy0A6Syntax16AbsolutePositionVF":{"name":"append(_:)","abstract":"

Append a minimal violation for the specified position.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCoreAA21ReasonedRuleViolationVRszlE6append10contentsOfySay0A6Syntax16AbsolutePositionVG_tF":{"name":"append(contentsOf:)","abstract":"

Append minimal violations for the specified positions.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCore0A6Syntax04DeclD8Protocol_pXpRszlE3allSayAbC_pXpGvpZ":{"name":"all","abstract":"

All visitable declaration syntax types.

","parent_name":"Array"},"Extensions/Array.html#/s:Sa13SwiftLintCore0A6Syntax04DeclD8Protocol_pXpRszlE9allExceptySayAbC_pXpGAbC_pXpd_tFZ":{"name":"allExcept(_:)","abstract":"

All declarations except for the specified ones.

","parent_name":"Array"},"Extensions/Array.html":{"name":"Array"},"Extensions/Optional.html":{"name":"Optional"},"Extensions/Bool.html":{"name":"Bool"},"Extensions/String.html":{"name":"String"},"Extensions/Set.html":{"name":"Set"},"Extensions/Int.html":{"name":"Int"},"Extensions/Double.html":{"name":"Double"},"Enums/ViolationSeverity.html#/s:13SwiftLintCore17ViolationSeverityO7warningyA2CmF":{"name":"warning","abstract":"

Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:13SwiftLintCore17ViolationSeverityO5erroryA2CmF":{"name":"error","abstract":"

Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ViolationSeverity"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO4callyA2CmF":{"name":"call","abstract":"

A call to a named function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO8argumentyA2CmF":{"name":"argument","abstract":"

An argument value for a function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO5arrayyA2CmF":{"name":"array","abstract":"

An Array expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO10dictionaryyA2CmF":{"name":"dictionary","abstract":"

A Dictionary expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO13objectLiteralyA2CmF":{"name":"objectLiteral","abstract":"

An object literal expression. https://developer.apple.com/swift/blog/?id=33

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO7closureyA2CmF":{"name":"closure","abstract":"

A closure expression. https://docs.swift.org/swift-book/LanguageGuide/Closures.html

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:13SwiftLintCore0A14ExpressionKindO5tupleyA2CmF":{"name":"tuple","abstract":"

A tuple expression. https://docs.swift.org/swift-book/ReferenceManual/Types.html#ID448

","parent_name":"SwiftExpressionKind"},"Enums/RuleListError.html#/s:13SwiftLintCore13RuleListErrorO24duplicatedConfigurationsyAcA0D0_pXp_tcACmF":{"name":"duplicatedConfigurations(rule:)","abstract":"

The rule list contains more than one configuration for the specified rule.

","parent_name":"RuleListError"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO4lintyA2CmF":{"name":"lint","abstract":"

Describes rules that validate Swift source conventions.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO9idiomaticyA2CmF":{"name":"idiomatic","abstract":"

Describes rules that validate common practices in the Swift community.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO5styleyA2CmF":{"name":"style","abstract":"

Describes rules that validate stylistic choices.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO7metricsyA2CmF":{"name":"metrics","abstract":"

Describes rules that validate magnitudes or measurements of Swift source.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:13SwiftLintCore8RuleKindO11performanceyA2CmF":{"name":"performance","abstract":"

Describes rules that validate that code patterns with poor performance are avoided.

","parent_name":"RuleKind"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO3allyA2CmF":{"name":"all","abstract":"

Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO6singleyACSS_tcACmF":{"name":"single(identifier:)","abstract":"

Represents a single SwiftLint rule with the specified identifier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierO20stringRepresentationSSvp":{"name":"stringRepresentation","abstract":"

The spelling of the string for this idenfitier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:13SwiftLintCore14RuleIdentifierOyACSScfc":{"name":"init(_:)","abstract":"

Creates a RuleIdentifier by its string representation.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:s26ExpressibleByStringLiteralP06stringD0x0cD4TypeQz_tcfc":{"name":"init(stringLiteral:)","parent_name":"RuleIdentifier"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO5emptyyA2CmF":{"name":"empty","abstract":"

An irrelevant option. It will be ignored in documentation serialization.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4flagyACSbcACmF":{"name":"flag(_:)","abstract":"

A boolean flag.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6stringyACSScACmF":{"name":"string(_:)","abstract":"

A string option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6symbolyACSScACmF":{"name":"symbol(_:)","abstract":"

Like a string option but without quotes in the serialized output.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO7integeryACSicACmF":{"name":"integer(_:)","abstract":"

An integer option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO5floatyACSdcACmF":{"name":"float(_:)","abstract":"

A floating point number option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO8severityyAcA17ViolationSeverityOcACmF":{"name":"severity(_:)","abstract":"

Special option for a ViolationSeverity.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4listyACSayACGcACmF":{"name":"list(_:)","abstract":"

A list of options.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO6nestedyAcA28RuleConfigurationDescriptionVcACmF":{"name":"nested(_:)","abstract":"

An option which is another set of configuration options to be nested in the serialized output.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP10hasContentSbvp":{"name":"hasContent","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP8markdownSSyF":{"name":"markdown()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP8oneLinerSSyF":{"name":"oneLiner()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore12DocumentableP4yamlSSyF":{"name":"yaml()","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO2egoiyAA017RuleConfigurationD0VSS_ACtFZ":{"name":"=>(_:_:)","abstract":"

Operator enabling an easy way to create a configuration option.

","parent_name":"OptionType"},"Enums/OptionType.html#/s:13SwiftLintCore10OptionTypeO4nestyAcA28RuleConfigurationDescriptionVyXEFZ":{"name":"nest(_:)","abstract":"

Create an option defined by nested configuration description.

","parent_name":"OptionType"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO20invalidConfigurationyACSS_tcACmF":{"name":"invalidConfiguration(ruleID:)","abstract":"

The configuration didn’t match internal expectations.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO29deprecatedConfigurationOptionyACSS_S2SSgtcACmF":{"name":"deprecatedConfigurationOption(ruleID:key:alternative:)","abstract":"

Issued when an option is deprecated. Suggests an alternative optionally.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14nothingAppliedyACSS_tcACmF":{"name":"nothingApplied(ruleID:)","abstract":"

Used in configuration parsing when no changes have been applied. Use only internally!

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO18listedMultipleTimeyACSS_SitcACmF":{"name":"listedMultipleTime(ruleID:times:)","abstract":"

Rule is listed multiple times in the configuration.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO17renamedIdentifieryACSS_SStcACmF":{"name":"renamedIdentifier(old:new:)","abstract":"

An identifier old has been renamed to new.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24invalidConfigurationKeysyACSS_ShySSGtcACmF":{"name":"invalidConfigurationKeys(ruleID:keys:)","abstract":"

Some configuration keys are invalid.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14invalidRuleIDsyACShySSGcACmF":{"name":"invalidRuleIDs(_:)","abstract":"

Used rule IDs are invalid.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO25ruleNotPresentInOnlyRulesyACSS_tcACmF":{"name":"ruleNotPresentInOnlyRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not present in only_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO014ruleDisabledInF5RulesyACSS_tcACmF":{"name":"ruleDisabledInDisabledRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is disabled.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO33ruleDisabledInParentConfigurationyACSS_tcACmF":{"name":"ruleDisabledInParentConfiguration(ruleID:)","abstract":"

Found a rule configuration for a rule that is disabled in the parent configuration.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO019ruleNotEnabledInOptH5RulesyACSS_tcACmF":{"name":"ruleNotEnabledInOptInRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not enabled in opt_in_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO31ruleNotEnabledInParentOnlyRulesyACSS_tcACmF":{"name":"ruleNotEnabledInParentOnlyRules(ruleID:)","abstract":"

Found a rule configuration for a rule that is not enabled in parent only_rules.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14genericWarningyACSScACmF":{"name":"genericWarning(_:)","abstract":"

A generic warning specified by a string.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO12genericErroryACSScACmF":{"name":"genericError(_:)","abstract":"

A generic error specified by a string.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO14ruleDeprecatedyACSS_tcACmF":{"name":"ruleDeprecated(ruleID:)","abstract":"

A deprecation warning for a rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO19initialFileNotFoundyACSS_tcACmF":{"name":"initialFileNotFound(path:)","abstract":"

The initial configuration file was not found.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO12fileNotFoundyACSS_tcACmF":{"name":"fileNotFound(path:)","abstract":"

A file at specified path was not found.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO15fileNotReadableyACSSSg_SStcACmF":{"name":"fileNotReadable(path:ruleID:)","abstract":"

The file at path is not readable or cannot be opened.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO15fileNotWritableyACSS_tcACmF":{"name":"fileNotWritable(path:)","abstract":"

The file at path is not writable.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO13indexingErroryACSSSg_SStcACmF":{"name":"indexingError(path:ruleID:)","abstract":"

The file at path cannot be indexed by a specific rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24missingCompilerArgumentsyACSSSg_SStcACmF":{"name":"missingCompilerArguments(path:ruleID:)","abstract":"

No arguments were provided to compile a file at path within a specific rule.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO17missingCursorInfoyACSSSg_SStcACmF":{"name":"missingCursorInfo(path:ruleID:)","abstract":"

Cursor information cannot be extracted from a specific location.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO11yamlParsingyACSScACmF":{"name":"yamlParsing(_:)","abstract":"

An error that occurred when parsing YAML.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO19baselineNotReadableyACSS_tcACmF":{"name":"baselineNotReadable(path:)","abstract":"

The baseline file at path is not readable or cannot be opened.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO24printDeprecationWarningsSbvpZ":{"name":"printDeprecationWarnings","abstract":"

Flag to enable warnings for deprecations being printed to the console. Printing is enabled by default.

","parent_name":"Issue"},"Enums/Issue.html#/s:13SwiftLintCore5IssueO5printyyF":{"name":"print()","abstract":"

Print the issue to the console.

","parent_name":"Issue"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO7privateyA2CmF":{"name":"private","abstract":"

Accessible by the declaration’s immediate lexical scope.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO11fileprivateyA2CmF":{"name":"fileprivate","abstract":"

Accessible by the declaration’s same file.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO8internalyA2CmF":{"name":"internal","abstract":"

Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO7packageyA2CmF":{"name":"package","abstract":"

Accessible by all the modules defined in the same Swift package.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO6publicyA2CmF":{"name":"public","abstract":"

Accessible by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO4openyA2CmF":{"name":"open","abstract":"

Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO11descriptionACSgSS_tcfc":{"name":"init(description:)","abstract":"

Initializes an access control level by its Swift source keyword value.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:13SwiftLintCore18AccessControlLevelO9isPrivateSbvp":{"name":"isPrivate","abstract":"

Returns true if is private or fileprivate

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"AccessControlLevel"},"Enums/ExecutableInfo.html#/s:13SwiftLintCore14ExecutableInfoO7buildIDSSSgvpZ":{"name":"buildID","abstract":"

A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

","parent_name":"ExecutableInfo"},"Enums/ExecutableInfo.html":{"name":"ExecutableInfo","abstract":"

Information about this executable.

"},"Enums/AccessControlLevel.html":{"name":"AccessControlLevel","abstract":"

The accessibility of a Swift source declaration.

"},"Enums/Issue.html":{"name":"Issue","abstract":"

All possible SwiftLint issues which are printed as warnings by default.

"},"Enums/OptionType.html":{"name":"OptionType","abstract":"

Type of an option.

"},"Enums/RuleIdentifier.html":{"name":"RuleIdentifier","abstract":"

An identifier representing a SwiftLint rule, or all rules.

"},"Enums/RuleKind.html":{"name":"RuleKind","abstract":"

All the possible rule kinds (categories).

"},"Enums/RuleListError.html":{"name":"RuleListError","abstract":"

All possible rule list configuration errors.

"},"Enums/SwiftExpressionKind.html":{"name":"SwiftExpressionKind","abstract":"

The kind of expression for a contiguous set of Swift source tokens.

"},"Enums/ViolationSeverity.html":{"name":"ViolationSeverity","abstract":"

The magnitude of a StyleViolation.

"},"Global%20Variables.html#/s:13SwiftLintCore13reportersListSayAA8Reporter_pXpGvp":{"name":"reportersList","abstract":"

The reporters list containing all the reporters built into SwiftLint.

"},"Global%20Variables.html#/s:13SwiftLintCore9coreRulesSayAA4Rule_pXpGvp":{"name":"coreRules","abstract":"

The rule list containing all available rules built into SwiftLintCore.

"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC13configurationxvp":{"name":"configuration","abstract":"

A rule’s configuration.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file from which the traversed syntax tree stems from.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC17locationConverter0aE0014SourceLocationH0Cvp":{"name":"locationConverter","abstract":"

A source location converter associated with the syntax tree being traversed.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC13configuration4fileACyxGx_AA0aB4FileCtcfc":{"name":"init(configuration:file:)","abstract":"

Initializer for a ViolationsSyntaxVisitor.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC10violationsSayAA21ReasonedRuleViolationVGvp":{"name":"violations","abstract":"

Positions in a source file where violations should be reported.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC20violationCorrectionsSayAA19ViolationCorrectionVGvp":{"name":"violationCorrections","abstract":"

Ranges of violations to be used in rewriting (see SwiftSyntaxCorrectableRule). It is not mandatory to fill","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC21skippableDeclarationsSay0aE004DeclE8Protocol_pXpGvp":{"name":"skippableDeclarations","abstract":"

List of declaration types that shall be skipped while traversing the AST.

","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ActorDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ClassDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE08EnumDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE013ExtensionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012FunctionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE015InitializerDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012ProtocolDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE010StructDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE013SubscriptDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:13SwiftLintCore23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012VariableDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5Scopea":{"name":"Scope","abstract":"

A type that remembers the declared identifiers (in order) up to the current position in the code.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5scopeAA5StackVyShySSGGvp":{"name":"scope","abstract":"

The hierarchical stack of identifiers declared up to the current position in the code.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC13configuration4file5scopeACyxGx_AA0aB4FileCAA5StackVyShySSGGtcfc":{"name":"init(configuration:file:scope:)","abstract":"

Initializer.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC18hasSeenDeclaration3forSbSS_tF":{"name":"hasSeenDeclaration(for:)","abstract":"

Indicate whether a given identifier is in scope.

","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC5visity0A6Syntax0iG12ContinueKindOAE017CodeBlockItemListI0VF":{"name":"visit(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax017CodeBlockItemListJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax012VariableDeclJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/DeclaredIdentifiersTrackingVisitor.html#/s:13SwiftLintCore34DeclaredIdentifiersTrackingVisitorC9visitPostyy0A6Syntax09GuardStmtJ0VF":{"name":"visitPost(_:)","parent_name":"DeclaredIdentifiersTrackingVisitor"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO12indentSpacesyAESicAEmF":{"name":"indentSpaces(_:)","abstract":"

Indentation with a number of spaces.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO14unindentSpacesyAESicAEmF":{"name":"unindentSpaces(_:)","abstract":"

Reverse indentation of a number of spaces.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO10indentTabsyAESicAEmF":{"name":"indentTabs(_:)","abstract":"

Indentation with a number of tabs

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html#/s:13SwiftLintCore21CodeIndentingRewriterC16IndentationStyleO12unindentTabsyAESicAEmF":{"name":"unindentTabs(_:)","abstract":"

Reverse indentation of a number of tabs.

","parent_name":"IndentationStyle"},"Classes/CodeIndentingRewriter/IndentationStyle.html":{"name":"IndentationStyle","abstract":"

Style defining whether the rewriter shall indent or unindent and whether it shall use tabs or spaces and","parent_name":"CodeIndentingRewriter"},"Classes/CodeIndentingRewriter.html#/s:13SwiftLintCore21CodeIndentingRewriterC5styleA2C16IndentationStyleO_tcfc":{"name":"init(style:)","abstract":"

Initializer accepting an indentation style.

","parent_name":"CodeIndentingRewriter"},"Classes/CodeIndentingRewriter.html#/s:13SwiftLintCore21CodeIndentingRewriterC5visity0A6Syntax05TokenH0VAGF":{"name":"visit(_:)","parent_name":"CodeIndentingRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC13configurationxvp":{"name":"configuration","abstract":"

A rule’s configuration.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file from which the traversed syntax tree stems from.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC17locationConverter0aE0014SourceLocationH0Cvp":{"name":"locationConverter","abstract":"

A converter of positions in the traversed source file.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC15disabledRegionsSay0aE011SourceRangeVGvp":{"name":"disabledRegions","abstract":"

The regions in the traversed file that are disabled by a command.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC19correctionPositionsSay0aE016AbsolutePositionVGvp":{"name":"correctionPositions","abstract":"

Positions in a source file where corrections were applied.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC13configuration4fileACyxGx_AA0aB4FileCtcfc":{"name":"init(configuration:file:)","abstract":"

Initilizer for a ViolationsSyntaxRewriter.

","parent_name":"ViolationsSyntaxRewriter"},"Classes/ViolationsSyntaxRewriter.html#/s:13SwiftLintCore24ViolationsSyntaxRewriterC8visitAnyy0aE00E0VSgAGF":{"name":"visitAny(_:)","parent_name":"ViolationsSyntaxRewriter"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4file21SourceKittenFramework0D0Cvp":{"name":"file","abstract":"

The underlying SourceKitten file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC2id10Foundation4UUIDVvp":{"name":"id","abstract":"

The associated unique identifier for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC06isTestD0Sbvp":{"name":"isTestFile","abstract":"

Whether or not this is a file generated for testing purposes.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC9isVirtualSbvp":{"name":"isVirtual","abstract":"

A file is virtual if it is not backed by a filesystem path.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4fileAC21SourceKittenFramework0D0C_tcfc":{"name":"init(file:)","abstract":"

Creates a SwiftLintFile with a SourceKitten File.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4pathACSgSS_tcfc":{"name":"init(path:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk.","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC20pathDeferringReadingACSS_tcfc":{"name":"init(pathDeferringReading:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC8contentsACSS_tcfc":{"name":"init(contents:)","abstract":"

Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC4pathSSSgvp":{"name":"path","abstract":"

The path on disk for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC8contentsSSvp":{"name":"contents","abstract":"

The file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC10stringView21SourceKittenFramework06StringF0Vvp":{"name":"stringView","abstract":"

A string view into the contents of this file optimized for string manipulation operations.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:13SwiftLintCore0aB4FileC5linesSay21SourceKittenFramework4LineVGvp":{"name":"lines","abstract":"

The parsed lines for this file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"SwiftLintFile"},"Classes/RuleStorage.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"RuleStorage"},"Classes/RuleStorage.html#/s:13SwiftLintCore11RuleStorageCACycfc":{"name":"init()","abstract":"

Creates a RuleStorage with no initial stored data.

","parent_name":"RuleStorage"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC6sharedACvpZ":{"name":"shared","abstract":"

Shared rule registry instance.

","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC4listAA0D4ListVvp":{"name":"list","abstract":"

Rule list associated with this registry. Lazily created, and","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC8register5rulesySayAA0D0_pXpG_tF":{"name":"register(rules:)","abstract":"

Register rules.

","parent_name":"RuleRegistry"},"Classes/RuleRegistry.html#/s:13SwiftLintCore12RuleRegistryC4rule5forIDAA0D0_pXpSgSS_tF":{"name":"rule(forID:)","abstract":"

Look up a rule for a given ID.

","parent_name":"RuleRegistry"},"Classes/LinterCache.html#/s:13SwiftLintCore11LinterCacheC13configuration11fileManagerAcA13ConfigurationV_xtcAA012LintableFileH0Rzlufc":{"name":"init(configuration:fileManager:)","abstract":"

Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

","parent_name":"LinterCache"},"Classes/LinterCache.html#/s:13SwiftLintCore11LinterCacheC4saveyyKF":{"name":"save()","abstract":"

Persists the cache to disk.

","parent_name":"LinterCache"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC6sharedACvpZ":{"name":"shared","abstract":"

Singleton.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC8activateyyF":{"name":"activate()","abstract":"

Tell the timer it should record time spent in rules.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html#/s:13SwiftLintCore15CustomRuleTimerC4dumpSDySSSdGyF":{"name":"dump()","abstract":"

Return all time spent for each custom rule, keyed by rule ID.

","parent_name":"CustomRuleTimer"},"Classes/CustomRuleTimer.html":{"name":"CustomRuleTimer","abstract":"

Utility to measure the time spent in each custom rule.

"},"Classes/LinterCache.html":{"name":"LinterCache","abstract":"

A persisted cache for storing and retrieving linter results.

"},"Classes/RuleRegistry.html":{"name":"RuleRegistry","abstract":"

Container to register and look up SwiftLint rules.

"},"Classes/RuleStorage.html":{"name":"RuleStorage","abstract":"

A storage mechanism for aggregating the results of CollectingRules.

"},"Classes/SwiftLintFile.html":{"name":"SwiftLintFile","abstract":"

A unit of Swift source code, either on disk or in memory.

"},"Classes/ViolationsSyntaxRewriter.html":{"name":"ViolationsSyntaxRewriter","abstract":"

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

"},"Classes/CodeIndentingRewriter.html":{"name":"CodeIndentingRewriter","abstract":"

Rewriter that indents or unindents a syntax piece including comments and nested"},"Classes/DeclaredIdentifiersTrackingVisitor.html":{"name":"DeclaredIdentifiersTrackingVisitor","abstract":"

A specialized ViolationsSyntaxVisitor that tracks declared identifiers per scope while traversing the AST.

"},"Classes/ViolationsSyntaxVisitor.html":{"name":"ViolationsSyntaxVisitor","abstract":"

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

"},"swift-syntax-dashboard.html":{"name":"Swift Syntax Dashboard"},"accessibility_label_for_image.html":{"name":"accessibility_label_for_image"},"accessibility_trait_for_button.html":{"name":"accessibility_trait_for_button"},"anonymous_argument_in_multiline_closure.html":{"name":"anonymous_argument_in_multiline_closure"},"anyobject_protocol.html":{"name":"anyobject_protocol"},"array_init.html":{"name":"array_init"},"attributes.html":{"name":"attributes"},"balanced_xctest_lifecycle.html":{"name":"balanced_xctest_lifecycle"},"blanket_disable_command.html":{"name":"blanket_disable_command"},"block_based_kvo.html":{"name":"block_based_kvo"},"capture_variable.html":{"name":"capture_variable"},"class_delegate_protocol.html":{"name":"class_delegate_protocol"},"closing_brace.html":{"name":"closing_brace"},"closure_body_length.html":{"name":"closure_body_length"},"closure_end_indentation.html":{"name":"closure_end_indentation"},"closure_parameter_position.html":{"name":"closure_parameter_position"},"closure_spacing.html":{"name":"closure_spacing"},"collection_alignment.html":{"name":"collection_alignment"},"colon.html":{"name":"colon"},"comma.html":{"name":"comma"},"comma_inheritance.html":{"name":"comma_inheritance"},"comment_spacing.html":{"name":"comment_spacing"},"compiler_protocol_init.html":{"name":"compiler_protocol_init"},"computed_accessors_order.html":{"name":"computed_accessors_order"},"conditional_returns_on_newline.html":{"name":"conditional_returns_on_newline"},"contains_over_filter_count.html":{"name":"contains_over_filter_count"},"contains_over_filter_is_empty.html":{"name":"contains_over_filter_is_empty"},"contains_over_first_not_nil.html":{"name":"contains_over_first_not_nil"},"contains_over_range_nil_comparison.html":{"name":"contains_over_range_nil_comparison"},"control_statement.html":{"name":"control_statement"},"convenience_type.html":{"name":"convenience_type"},"custom_rules.html":{"name":"custom_rules"},"cyclomatic_complexity.html":{"name":"cyclomatic_complexity"},"deployment_target.html":{"name":"deployment_target"},"direct_return.html":{"name":"direct_return"},"discarded_notification_center_observer.html":{"name":"discarded_notification_center_observer"},"discouraged_assert.html":{"name":"discouraged_assert"},"discouraged_direct_init.html":{"name":"discouraged_direct_init"},"discouraged_none_name.html":{"name":"discouraged_none_name"},"discouraged_object_literal.html":{"name":"discouraged_object_literal"},"discouraged_optional_boolean.html":{"name":"discouraged_optional_boolean"},"discouraged_optional_collection.html":{"name":"discouraged_optional_collection"},"duplicate_conditions.html":{"name":"duplicate_conditions"},"duplicate_enum_cases.html":{"name":"duplicate_enum_cases"},"duplicate_imports.html":{"name":"duplicate_imports"},"duplicated_key_in_dictionary_literal.html":{"name":"duplicated_key_in_dictionary_literal"},"dynamic_inline.html":{"name":"dynamic_inline"},"empty_collection_literal.html":{"name":"empty_collection_literal"},"empty_count.html":{"name":"empty_count"},"empty_enum_arguments.html":{"name":"empty_enum_arguments"},"empty_parameters.html":{"name":"empty_parameters"},"empty_parentheses_with_trailing_closure.html":{"name":"empty_parentheses_with_trailing_closure"},"empty_string.html":{"name":"empty_string"},"empty_xctest_method.html":{"name":"empty_xctest_method"},"enum_case_associated_values_count.html":{"name":"enum_case_associated_values_count"},"expiring_todo.html":{"name":"expiring_todo"},"explicit_acl.html":{"name":"explicit_acl"},"explicit_enum_raw_value.html":{"name":"explicit_enum_raw_value"},"explicit_init.html":{"name":"explicit_init"},"explicit_self.html":{"name":"explicit_self"},"explicit_top_level_acl.html":{"name":"explicit_top_level_acl"},"explicit_type_interface.html":{"name":"explicit_type_interface"},"extension_access_modifier.html":{"name":"extension_access_modifier"},"fallthrough.html":{"name":"fallthrough"},"fatal_error_message.html":{"name":"fatal_error_message"},"file_header.html":{"name":"file_header"},"file_length.html":{"name":"file_length"},"file_name.html":{"name":"file_name"},"file_name_no_space.html":{"name":"file_name_no_space"},"file_types_order.html":{"name":"file_types_order"},"final_test_case.html":{"name":"final_test_case"},"first_where.html":{"name":"first_where"},"flatmap_over_map_reduce.html":{"name":"flatmap_over_map_reduce"},"for_where.html":{"name":"for_where"},"force_cast.html":{"name":"force_cast"},"force_try.html":{"name":"force_try"},"force_unwrapping.html":{"name":"force_unwrapping"},"function_body_length.html":{"name":"function_body_length"},"function_default_parameter_at_end.html":{"name":"function_default_parameter_at_end"},"function_parameter_count.html":{"name":"function_parameter_count"},"generic_type_name.html":{"name":"generic_type_name"},"ibinspectable_in_extension.html":{"name":"ibinspectable_in_extension"},"identical_operands.html":{"name":"identical_operands"},"identifier_name.html":{"name":"identifier_name"},"implicit_getter.html":{"name":"implicit_getter"},"implicit_return.html":{"name":"implicit_return"},"implicitly_unwrapped_optional.html":{"name":"implicitly_unwrapped_optional"},"inclusive_language.html":{"name":"inclusive_language"},"indentation_width.html":{"name":"indentation_width"},"inert_defer.html":{"name":"inert_defer"},"invalid_swiftlint_command.html":{"name":"invalid_swiftlint_command"},"is_disjoint.html":{"name":"is_disjoint"},"joined_default_parameter.html":{"name":"joined_default_parameter"},"large_tuple.html":{"name":"large_tuple"},"last_where.html":{"name":"last_where"},"leading_whitespace.html":{"name":"leading_whitespace"},"legacy_cggeometry_functions.html":{"name":"legacy_cggeometry_functions"},"legacy_constant.html":{"name":"legacy_constant"},"legacy_constructor.html":{"name":"legacy_constructor"},"legacy_hashing.html":{"name":"legacy_hashing"},"legacy_multiple.html":{"name":"legacy_multiple"},"legacy_nsgeometry_functions.html":{"name":"legacy_nsgeometry_functions"},"legacy_objc_type.html":{"name":"legacy_objc_type"},"legacy_random.html":{"name":"legacy_random"},"let_var_whitespace.html":{"name":"let_var_whitespace"},"line_length.html":{"name":"line_length"},"literal_expression_end_indentation.html":{"name":"literal_expression_end_indentation"},"local_doc_comment.html":{"name":"local_doc_comment"},"lower_acl_than_parent.html":{"name":"lower_acl_than_parent"},"mark.html":{"name":"mark"},"missing_docs.html":{"name":"missing_docs"},"modifier_order.html":{"name":"modifier_order"},"multiline_arguments.html":{"name":"multiline_arguments"},"multiline_arguments_brackets.html":{"name":"multiline_arguments_brackets"},"multiline_function_chains.html":{"name":"multiline_function_chains"},"multiline_literal_brackets.html":{"name":"multiline_literal_brackets"},"multiline_parameters.html":{"name":"multiline_parameters"},"multiline_parameters_brackets.html":{"name":"multiline_parameters_brackets"},"multiple_closures_with_trailing_closure.html":{"name":"multiple_closures_with_trailing_closure"},"nesting.html":{"name":"nesting"},"nimble_operator.html":{"name":"nimble_operator"},"no_extension_access_modifier.html":{"name":"no_extension_access_modifier"},"no_fallthrough_only.html":{"name":"no_fallthrough_only"},"no_grouping_extension.html":{"name":"no_grouping_extension"},"no_magic_numbers.html":{"name":"no_magic_numbers"},"no_space_in_method_call.html":{"name":"no_space_in_method_call"},"non_optional_string_data_conversion.html":{"name":"non_optional_string_data_conversion"},"non_overridable_class_declaration.html":{"name":"non_overridable_class_declaration"},"notification_center_detachment.html":{"name":"notification_center_detachment"},"ns_number_init_as_function_reference.html":{"name":"ns_number_init_as_function_reference"},"nslocalizedstring_key.html":{"name":"nslocalizedstring_key"},"nslocalizedstring_require_bundle.html":{"name":"nslocalizedstring_require_bundle"},"nsobject_prefer_isequal.html":{"name":"nsobject_prefer_isequal"},"number_separator.html":{"name":"number_separator"},"object_literal.html":{"name":"object_literal"},"one_declaration_per_file.html":{"name":"one_declaration_per_file"},"opening_brace.html":{"name":"opening_brace"},"operator_usage_whitespace.html":{"name":"operator_usage_whitespace"},"operator_whitespace.html":{"name":"operator_whitespace"},"optional_enum_case_matching.html":{"name":"optional_enum_case_matching"},"orphaned_doc_comment.html":{"name":"orphaned_doc_comment"},"overridden_super_call.html":{"name":"overridden_super_call"},"override_in_extension.html":{"name":"override_in_extension"},"pattern_matching_keywords.html":{"name":"pattern_matching_keywords"},"period_spacing.html":{"name":"period_spacing"},"prefer_nimble.html":{"name":"prefer_nimble"},"prefer_self_in_static_references.html":{"name":"prefer_self_in_static_references"},"prefer_self_type_over_type_of_self.html":{"name":"prefer_self_type_over_type_of_self"},"prefer_zero_over_explicit_init.html":{"name":"prefer_zero_over_explicit_init"},"prefixed_toplevel_constant.html":{"name":"prefixed_toplevel_constant"},"private_action.html":{"name":"private_action"},"private_outlet.html":{"name":"private_outlet"},"private_over_fileprivate.html":{"name":"private_over_fileprivate"},"private_subject.html":{"name":"private_subject"},"private_swiftui_state.html":{"name":"private_swiftui_state"},"private_unit_test.html":{"name":"private_unit_test"},"prohibited_interface_builder.html":{"name":"prohibited_interface_builder"},"prohibited_super_call.html":{"name":"prohibited_super_call"},"protocol_property_accessors_order.html":{"name":"protocol_property_accessors_order"},"quick_discouraged_call.html":{"name":"quick_discouraged_call"},"quick_discouraged_focused_test.html":{"name":"quick_discouraged_focused_test"},"quick_discouraged_pending_test.html":{"name":"quick_discouraged_pending_test"},"raw_value_for_camel_cased_codable_enum.html":{"name":"raw_value_for_camel_cased_codable_enum"},"reduce_boolean.html":{"name":"reduce_boolean"},"reduce_into.html":{"name":"reduce_into"},"redundant_discardable_let.html":{"name":"redundant_discardable_let"},"redundant_nil_coalescing.html":{"name":"redundant_nil_coalescing"},"redundant_objc_attribute.html":{"name":"redundant_objc_attribute"},"redundant_optional_initialization.html":{"name":"redundant_optional_initialization"},"redundant_self_in_closure.html":{"name":"redundant_self_in_closure"},"redundant_set_access_control.html":{"name":"redundant_set_access_control"},"redundant_string_enum_value.html":{"name":"redundant_string_enum_value"},"redundant_type_annotation.html":{"name":"redundant_type_annotation"},"redundant_void_return.html":{"name":"redundant_void_return"},"required_deinit.html":{"name":"required_deinit"},"required_enum_case.html":{"name":"required_enum_case"},"return_arrow_whitespace.html":{"name":"return_arrow_whitespace"},"return_value_from_void_function.html":{"name":"return_value_from_void_function"},"self_binding.html":{"name":"self_binding"},"self_in_property_initialization.html":{"name":"self_in_property_initialization"},"shorthand_argument.html":{"name":"shorthand_argument"},"shorthand_operator.html":{"name":"shorthand_operator"},"shorthand_optional_binding.html":{"name":"shorthand_optional_binding"},"single_test_class.html":{"name":"single_test_class"},"sorted_enum_cases.html":{"name":"sorted_enum_cases"},"sorted_first_last.html":{"name":"sorted_first_last"},"sorted_imports.html":{"name":"sorted_imports"},"statement_position.html":{"name":"statement_position"},"static_operator.html":{"name":"static_operator"},"static_over_final_class.html":{"name":"static_over_final_class"},"strict_fileprivate.html":{"name":"strict_fileprivate"},"strong_iboutlet.html":{"name":"strong_iboutlet"},"superfluous_disable_command.html":{"name":"superfluous_disable_command"},"superfluous_else.html":{"name":"superfluous_else"},"switch_case_alignment.html":{"name":"switch_case_alignment"},"switch_case_on_newline.html":{"name":"switch_case_on_newline"},"syntactic_sugar.html":{"name":"syntactic_sugar"},"test_case_accessibility.html":{"name":"test_case_accessibility"},"todo.html":{"name":"todo"},"toggle_bool.html":{"name":"toggle_bool"},"trailing_closure.html":{"name":"trailing_closure"},"trailing_comma.html":{"name":"trailing_comma"},"trailing_newline.html":{"name":"trailing_newline"},"trailing_semicolon.html":{"name":"trailing_semicolon"},"trailing_whitespace.html":{"name":"trailing_whitespace"},"type_body_length.html":{"name":"type_body_length"},"type_contents_order.html":{"name":"type_contents_order"},"type_name.html":{"name":"type_name"},"typesafe_array_init.html":{"name":"typesafe_array_init"},"unavailable_condition.html":{"name":"unavailable_condition"},"unavailable_function.html":{"name":"unavailable_function"},"unhandled_throwing_task.html":{"name":"unhandled_throwing_task"},"unneeded_break_in_switch.html":{"name":"unneeded_break_in_switch"},"unneeded_override.html":{"name":"unneeded_override"},"unneeded_parentheses_in_closure_argument.html":{"name":"unneeded_parentheses_in_closure_argument"},"unneeded_synthesized_initializer.html":{"name":"unneeded_synthesized_initializer"},"unowned_variable_capture.html":{"name":"unowned_variable_capture"},"untyped_error_in_catch.html":{"name":"untyped_error_in_catch"},"unused_capture_list.html":{"name":"unused_capture_list"},"unused_closure_parameter.html":{"name":"unused_closure_parameter"},"unused_control_flow_label.html":{"name":"unused_control_flow_label"},"unused_declaration.html":{"name":"unused_declaration"},"unused_enumerated.html":{"name":"unused_enumerated"},"unused_import.html":{"name":"unused_import"},"unused_optional_binding.html":{"name":"unused_optional_binding"},"unused_setter_value.html":{"name":"unused_setter_value"},"valid_ibinspectable.html":{"name":"valid_ibinspectable"},"vertical_parameter_alignment.html":{"name":"vertical_parameter_alignment"},"vertical_parameter_alignment_on_call.html":{"name":"vertical_parameter_alignment_on_call"},"vertical_whitespace.html":{"name":"vertical_whitespace"},"vertical_whitespace_between_cases.html":{"name":"vertical_whitespace_between_cases"},"vertical_whitespace_closing_braces.html":{"name":"vertical_whitespace_closing_braces"},"vertical_whitespace_opening_braces.html":{"name":"vertical_whitespace_opening_braces"},"void_function_in_ternary.html":{"name":"void_function_in_ternary"},"void_return.html":{"name":"void_return"},"weak_delegate.html":{"name":"weak_delegate"},"xct_specific_matcher.html":{"name":"xct_specific_matcher"},"xctfail_message.html":{"name":"xctfail_message"},"yoda_condition.html":{"name":"yoda_condition"},"rule-directory.html":{"name":"Rule Directory"},"Rules.html":{"name":"Rules"},"Guides.html":{"name":"Guides","abstract":"

The following guides are available globally.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Global%20Variables.html":{"name":"Global Variables","abstract":"

The following global variables are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Functions.html":{"name":"Functions","abstract":"

The following functions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"}} \ No newline at end of file diff --git a/self_binding.html b/self_binding.html deleted file mode 100644 index 6929c3983..000000000 --- a/self_binding.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - self_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Self Binding

- -

Re-bind self to a consistent identifier name.

- -
    -
  • Identifier: self_binding
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -bind_identifier - -“self” -
  • -
-

Non Triggering Examples

-
if let self = self { return }
-
-
guard let self = self else { return }
-
-
if let this = this { return }
-
-
guard let this = this else { return }
-
-
if let this = self { return }
-
-
guard let this = self else { return }
-
-

Triggering Examples

-
if let ↓`self` = self { return }
-
-
guard let ↓`self` = self else { return }
-
-
if let ↓this = self { return }
-
-
guard let ↓this = self else { return }
-
-
if let ↓self = self { return }
-
-
guard let ↓self = self else { return }
-
-
if let ↓self { return }
-
-
guard let ↓self else { return }
-
- -
-
- - -
-
- - - diff --git a/self_in_property_initialization.html b/self_in_property_initialization.html deleted file mode 100644 index 2bd2e7e19..000000000 --- a/self_in_property_initialization.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - self_in_property_initialization Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Self in Property Initialization

- -

self refers to the unapplied NSObject.self() method, which is likely not expected; make the variable lazy to be able to refer to the current instance or use ClassName.self

- -
    -
  • Identifier: self_in_property_initialization
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class View: UIView {
-    let button: UIButton = {
-        return UIButton()
-    }()
-}
-
-
class View: UIView {
-    lazy var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(otherObject, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    private let collectionView: UICollectionView = {
-        let layout = UICollectionViewFlowLayout()
-        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
-        collectionView.registerReusable(Cell.self)
-
-        return collectionView
-    }()
-}
-
-

Triggering Examples

-
class View: UIView {
-    ↓var button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
-
class View: UIView {
-    ↓let button: UIButton = {
-        let button = UIButton()
-        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
-        return button
-    }()
-}
-
- -
-
- - -
-
- - - diff --git a/shorthand_argument.html b/shorthand_argument.html deleted file mode 100644 index e4ca4c607..000000000 --- a/shorthand_argument.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - shorthand_argument Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Argument

- -

Shorthand arguments like $0, $1, etc. in closures can be confusing. Avoid using them too far away from the beginning of the closure. Optionally, while usage of a single shorthand argument is okay, more than one or complex ones with field accesses might increase the risk of obfuscation.

- -
    -
  • Identifier: shorthand_argument
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allow_until_line_after_opening_brace - -4 -
    -always_disallow_more_than_one - -false -
    -always_disallow_member_access - -false -
  • -
-

Non Triggering Examples

-
    f { $0 }
-
-
    f {
-        $0
-      + $1
-      + $2
-    }
-
-
    f { $0.a + $0.b }
-
-
    f {
-        $0
-      +  g { $0 }
-
-

Triggering Examples

-
    f {
-        $0
-      + $1
-      + $2
-
-      + ↓$0
-    }
-
-
    f {
-        $0
-      + $1
-      + $2
-      +  5
-      + $0
-      + ↓$1
-    }
-
-
    f { ↓$0 + ↓$1 }
-
-
    f {
-        ↓$0.a
-      + ↓$0.b
-      + $1
-      + ↓$2.c
-}
-
- -
-
- - -
-
- - - diff --git a/shorthand_operator.html b/shorthand_operator.html deleted file mode 100644 index 295e20cf8..000000000 --- a/shorthand_operator.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - shorthand_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Operator

- -

Prefer shorthand operators (+=, -=, *=, /=) over doing the operation and assigning

- -
    -
  • Identifier: shorthand_operator
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
foo -= 1
-
-
foo += variable
-
-
foo *= bar.method()
-
-
self.foo = foo / 1
-
-
foo = self.foo + 1
-
-
page = ceilf(currentOffset * pageWidth)
-
-
foo = aMethod(foo / bar)
-
-
foo = aMethod(bar + foo)
-
-
public func -= (lhs: inout Foo, rhs: Int) {
-    lhs = lhs - rhs
-}
-
-
var helloWorld = "world!"
- helloWorld = "Hello, " + helloWorld
-
-
angle = someCheck ? angle : -angle
-
-
seconds = seconds * 60 + value
-
-

Triggering Examples

-
↓foo = foo * 1
-
-
↓foo = foo / aVariable
-
-
↓foo = foo - bar.method()
-
-
↓foo.aProperty = foo.aProperty - 1
-
-
↓self.aProperty = self.aProperty * 1
-
-
↓n = n + i / outputLength
-
-
↓n = n - i / outputLength
-
- -
-
- - -
-
- - - diff --git a/shorthand_optional_binding.html b/shorthand_optional_binding.html deleted file mode 100644 index 2578283ed..000000000 --- a/shorthand_optional_binding.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - shorthand_optional_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Shorthand Optional Binding

- -

Use shorthand syntax for optional binding

- -
    -
  • Identifier: shorthand_optional_binding
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.7.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    if let i {}
-    if let i = a {}
-    guard let i = f() else {}
-    if var i = i() {}
-    if let i = i as? Foo {}
-    guard let `self` = self else {}
-    while var i { i = nil }
-
-

Triggering Examples

-
    if ↓let i = i {}
-    if ↓let self = self {}
-    if ↓var `self` = `self` {}
-    if i > 0, ↓let j = j {}
-    if ↓let i = i, ↓var j = j {}
-
-
    guard ↓let i = i else {}
-    guard ↓let self = self else {}
-    guard ↓var `self` = `self` else {}
-    guard i > 0, ↓let j = j else {}
-    guard ↓let i = i, ↓var j = j else {}
-
-
    while ↓var i = i { i = nil }
-
- -
-
- - -
-
- - - diff --git a/single_test_class.html b/single_test_class.html deleted file mode 100644 index 7f29d1ebc..000000000 --- a/single_test_class.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - single_test_class Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Single Test Class

- -

Test files should contain a single QuickSpec or XCTestCase class.

- -
    -
  • Identifier: single_test_class
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
class FooTests {  }
-
-
class FooTests: QuickSpec {  }
-
-
class FooTests: XCTestCase {  }
-
-

Triggering Examples

-
↓class FooTests: QuickSpec {  }
-↓class BarTests: QuickSpec {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: QuickSpec {  }
-↓class TotoTests: QuickSpec {  }
-
-
↓class FooTests: XCTestCase {  }
-↓class BarTests: XCTestCase {  }
-
-
↓class FooTests: XCTestCase {  }
-↓class BarTests: XCTestCase {  }
-↓class TotoTests: XCTestCase {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-
-
↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-class TotoTests {  }
-
-
final ↓class FooTests: QuickSpec {  }
-↓class BarTests: XCTestCase {  }
-class TotoTests {  }
-
- -
-
- - -
-
- - - diff --git a/sorted_enum_cases.html b/sorted_enum_cases.html deleted file mode 100644 index 59be4daff..000000000 --- a/sorted_enum_cases.html +++ /dev/null @@ -1,468 +0,0 @@ - - - - sorted_enum_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Sorted Enum Cases

- -

Enum cases should be sorted

- -
    -
  • Identifier: sorted_enum_cases
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
enum foo {
-    case a
-    case b
-    case c
-}
-
-
enum foo {
-    case example
-    case exBoyfriend
-}
-
-
enum foo {
-    case a
-    case B
-    case c
-}
-
-
enum foo {
-    case a, b, c
-}
-
-
enum foo {
-    case a
-    case b, c
-}
-
-
enum foo {
-    case a(foo: Foo)
-    case b(String), c
-}
-
-
enum foo {
-    case a
-    case b, C, d
-}
-
-
@frozen
-enum foo {
-    case b
-    case a
-    case c, f, d
-}
-
-

Triggering Examples

-
enum foo {
-    ↓case b
-    ↓case a
-    case c
-}
-
-
enum foo {
-    ↓case B
-    ↓case a
-    case c
-}
-
-
enum foo {
-    case ↓b, ↓a, c
-}
-
-
enum foo {
-    case ↓B, ↓a, c
-}
-
-
enum foo {
-    ↓case b, c
-    ↓case a
-}
-
-
enum foo {
-    case a
-    case b, ↓d, ↓c
-}
-
-
enum foo {
-    case a(foo: Foo)
-    case ↓c, ↓b(String)
-}
-
- -
-
- - -
-
- - - diff --git a/sorted_first_last.html b/sorted_first_last.html deleted file mode 100644 index 204e989b8..000000000 --- a/sorted_first_last.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - sorted_first_last Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Min or Max over Sorted First or Last

- -

Prefer using min() or max() over sorted().first or sorted().last

- -
    -
  • Identifier: sorted_first_last
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: performance
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let min = myList.min()
-
-
let min = myList.min(by: { $0 < $1 })
-
-
let min = myList.min(by: >)
-
-
let max = myList.max()
-
-
let max = myList.max(by: { $0 < $1 })
-
-
let message = messages.sorted(byKeyPath: #keyPath(Message.timestamp)).last
-
-
let message = messages.sorted(byKeyPath: "timestamp", ascending: false).first
-
-
myList.sorted().firstIndex(of: key)
-
-
myList.sorted().lastIndex(of: key)
-
-
myList.sorted().firstIndex(where: someFunction)
-
-
myList.sorted().lastIndex(where: someFunction)
-
-
myList.sorted().firstIndex { $0 == key }
-
-
myList.sorted().lastIndex { $0 == key }
-
-
myList.sorted().first(where: someFunction)
-
-
myList.sorted().last(where: someFunction)
-
-
myList.sorted().first { $0 == key }
-
-
myList.sorted().last { $0 == key }
-
-

Triggering Examples

-
↓myList.sorted().first
-
-
↓myList.sorted(by: { $0.description < $1.description }).first
-
-
↓myList.sorted(by: >).first
-
-
↓myList.map { $0 + 1 }.sorted().first
-
-
↓myList.sorted(by: someFunction).first
-
-
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.first
-
-
↓myList.sorted().last
-
-
↓myList.sorted().last?.something()
-
-
↓myList.sorted(by: { $0.description < $1.description }).last
-
-
↓myList.map { $0 + 1 }.sorted().last
-
-
↓myList.sorted(by: someFunction).last
-
-
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.last
-
-
↓myList.map { $0 + 1 }.sorted { $0.first < $1.first }.last
-
- -
-
- - -
-
- - - diff --git a/sorted_imports.html b/sorted_imports.html deleted file mode 100644 index a4f50500d..000000000 --- a/sorted_imports.html +++ /dev/null @@ -1,460 +0,0 @@ - - - - sorted_imports Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Sorted Imports

- -

Imports should be sorted

- -
    -
  • Identifier: sorted_imports
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -grouping - -names -
  • -
-

Non Triggering Examples

-
import AAA
-import BBB
-import CCC
-import DDD
-
-
import Alamofire
-import API
-
-
import labc
-import Ldef
-
-
import BBB
-// comment
-import AAA
-import CCC
-
-
@testable import AAA
-import   CCC
-
-
import AAA
-@testable import   CCC
-
-
import EEE.A
-import FFF.B
-#if os(Linux)
-import DDD.A
-import EEE.B
-#else
-import CCC
-import DDD.B
-#endif
-import AAA
-import BBB
-
-

Triggering Examples

-
import AAA
-import ZZZ
-import ↓BBB
-import CCC
-
-
import DDD
-// comment
-import CCC
-import ↓AAA
-
-
@testable import CCC
-import   ↓AAA
-
-
import CCC
-@testable import   ↓AAA
-
-
import FFF.B
-import ↓EEE.A
-#if os(Linux)
-import DDD.A
-import EEE.B
-#else
-import DDD.B
-import ↓CCC
-#endif
-import AAA
-import BBB
-
- -
-
- - -
-
- - - diff --git a/statement_position.html b/statement_position.html deleted file mode 100644 index 64cffef48..000000000 --- a/statement_position.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - statement_position Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Statement Position

- -

Else and catch should be on the same line, one space after the previous declaration

- -
    -
  • Identifier: statement_position
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -statement_mode - -default -
  • -
-

Non Triggering Examples

-
} else if {
-
-
} else {
-
-
} catch {
-
-
"}else{"
-
-
struct A { let catchphrase: Int }
-let a = A(
- catchphrase: 0
-)
-
-
struct A { let `catch`: Int }
-let a = A(
- `catch`: 0
-)
-
-

Triggering Examples

-
↓}else if {
-
-
↓}  else {
-
-
↓}
-catch {
-
-
↓}
-      catch {
-
- -
-
- - -
-
- - - diff --git a/static_operator.html b/static_operator.html deleted file mode 100644 index ce0e9cd96..000000000 --- a/static_operator.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - static_operator Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Static Operator

- -

Operators should be declared as static functions, not free functions

- -
    -
  • Identifier: static_operator
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class A: Equatable {
-  static func == (lhs: A, rhs: A) -> Bool {
-    return false
-  }
-
-
class A<T>: Equatable {
-    static func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
-        return false
-    }
-
-
public extension Array where Element == Rule {
-  static func == (lhs: Array, rhs: Array) -> Bool {
-    if lhs.count != rhs.count { return false }
-    return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
-  }
-}
-
-
private extension Optional where Wrapped: Comparable {
-  static func < (lhs: Optional, rhs: Optional) -> Bool {
-    switch (lhs, rhs) {
-    case let (lhs?, rhs?):
-      return lhs < rhs
-    case (nil, _?):
-      return true
-    default:
-      return false
-    }
-  }
-}
-
-

Triggering Examples

-
↓func == (lhs: A, rhs: A) -> Bool {
-  return false
-}
-
-
↓func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
-  return false
-}
-
-
↓func == (lhs: [Rule], rhs: [Rule]) -> Bool {
-  if lhs.count != rhs.count { return false }
-  return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
-}
-
-
private ↓func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool {
-  switch (lhs, rhs) {
-  case let (lhs?, rhs?):
-    return lhs < rhs
-  case (nil, _?):
-    return true
-  default:
-    return false
-  }
-}
-
- -
-
- - -
-
- - - diff --git a/static_over_final_class.html b/static_over_final_class.html deleted file mode 100644 index e8693065b..000000000 --- a/static_over_final_class.html +++ /dev/null @@ -1,436 +0,0 @@ - - - - static_over_final_class Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Static Over Final Class

- -

Prefer static over final class for non-overridable declarations

- -
    -
  • Identifier: static_over_final_class
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class C {
-    static func f() {}
-}
-
-
class C {
-    static var i: Int { 0 }
-}
-
-
class C {
-    static subscript(_: Int) -> Int { 0 }
-}
-
-
class C {
-    class func f() {}
-}
-
-
final class C {}
-
-
final class C {
-    class D {
-      class func f() {}
-    }
-}
-
-

Triggering Examples

-
class C {
-    ↓final class func f() {}
-}
-
-
class C {
-    ↓final class var i: Int { 0 }
-}
-
-
class C {
-    ↓final class subscript(_: Int) -> Int { 0 }
-}
-
-
final class C {
-    ↓class func f() {}
-}
-
-
class C {
-    final class D {
-        ↓class func f() {}
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/strict_fileprivate.html b/strict_fileprivate.html deleted file mode 100644 index 8eb622bcc..000000000 --- a/strict_fileprivate.html +++ /dev/null @@ -1,435 +0,0 @@ - - - - strict_fileprivate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Strict Fileprivate

- -

fileprivate should be avoided

- -
    -
  • Identifier: strict_fileprivate
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
extension String {}
-
-
private extension String {}
-
-
public
-    extension String {
-        var i: Int { 1 }
-    }
-
-
    private enum E {
-        func f() {}
-    }
-
-
    public struct S {
-        internal let i: Int
-    }
-
-
    open class C {
-        private func f() {}
-    }
-
-
    internal actor A {}
-
-

Triggering Examples

-
    ↓fileprivate class C {
-        ↓fileprivate func f() {}
-    }
-
-
    ↓fileprivate extension String {
-        ↓fileprivate var isSomething: Bool { self == "something" }
-    }
-
-
    ↓fileprivate actor A {
-        ↓fileprivate let i = 1
-    }
-
-
    ↓fileprivate struct C {
-        ↓fileprivate(set) var myInt = 4
-    }
-
-
    struct Outter {
-        struct Inter {
-            ↓fileprivate struct Inner {}
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/strong_iboutlet.html b/strong_iboutlet.html deleted file mode 100644 index 30f21eb89..000000000 --- a/strong_iboutlet.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - strong_iboutlet Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Strong IBOutlet

- -

@IBOutlets shouldn’t be declared as weak

- -
    -
  • Identifier: strong_iboutlet
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet var label: UILabel?
-}
-
-
class ViewController: UIViewController {
-    weak var label: UILabel?
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-    @IBOutlet ↓weak var label: UILabel?
-}
-
-
class ViewController: UIViewController {
-    @IBOutlet ↓unowned var label: UILabel!
-}
-
-
class ViewController: UIViewController {
-    @IBOutlet ↓weak var textField: UITextField?
-}
-
- -
-
- - -
-
- - - diff --git a/superfluous_disable_command.html b/superfluous_disable_command.html deleted file mode 100644 index 97e98fb0d..000000000 --- a/superfluous_disable_command.html +++ /dev/null @@ -1,402 +0,0 @@ - - - - superfluous_disable_command Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Superfluous Disable Command

- -

SwiftLint ‘disable’ commands are superfluous when the disabled rule would not have triggered a violation in the disabled region. Use “ - ” if you wish to document a command.

- -
    -
  • Identifier: superfluous_disable_command
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc:Void // swiftlint:disable:this colon
-
-
// swiftlint:disable colon
-let abc:Void
-// swiftlint:enable colon
-
-

Triggering Examples

-
let abc: Void // swiftlint:disable:this colon
-
-
// swiftlint:disable colon
-let abc: Void
-// swiftlint:enable colon
-
- -
-
- - -
-
- - - diff --git a/superfluous_else.html b/superfluous_else.html deleted file mode 100644 index 23c57f289..000000000 --- a/superfluous_else.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - superfluous_else Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Superfluous Else

- -

Else branches should be avoided when the previous if-block exits the current scope

- -
    -
  • Identifier: superfluous_else
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    if i > 0 {
-        // comment
-    } else if i < 12 {
-        return 2
-    } else {
-        return 3
-    }
-
-
    if i > 0 {
-        let a = 1
-        if a > 1 {
-            // comment
-        } else {
-            return 1
-        }
-        // comment
-    } else {
-        return 3
-    }
-
-
    if i > 0 {
-        if a > 1 {
-            return 1
-        }
-    } else {
-        return 3
-    }
-
-
    for i in list {
-        if i > 12 {
-            // Do nothing
-        } else {
-            continue
-        }
-        if i > 14 {
-            // Do nothing
-        } else if i > 13 {
-            break
-        }
-    }
-
-

Triggering Examples

-
    if i > 0 {
-        return 1
-        // comment
-    } ↓else {
-        return 2
-    }
-
-
    if i > 0 {
-        return 1
-    } ↓else if i < 12 {
-        return 2
-    } ↓else if i > 18 {
-        return 3
-    }
-
-
    if i > 0 {
-        if i < 12 {
-            return 5
-        } ↓else {
-            if i > 11 {
-                return 6
-            } ↓else {
-                return 7
-            }
-        }
-    } ↓else if i < 12 {
-        return 2
-    } ↓else if i < 24 {
-        return 8
-    } ↓else {
-        return 3
-    }
-
-
    for i in list {
-        if i > 13 {
-            return
-        } ↓else if i > 12 {
-            continue
-        } ↓else if i > 11 {
-            break
-        } ↓else {
-            throw error
-        }
-    }
-
- -
-
- - -
-
- - - diff --git a/swift-syntax-dashboard.html b/swift-syntax-dashboard.html deleted file mode 100644 index 1a3f4ae18..000000000 --- a/swift-syntax-dashboard.html +++ /dev/null @@ -1,620 +0,0 @@ - - - - Swift Syntax Dashboard Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Swift Syntax Dashboard

- -

Efforts are actively under way to migrate most rules off SourceKit to use SwiftSyntax instead.

- -

Rules written using SwiftSyntax tend to be significantly faster and have fewer false positives -than rules that use SourceKit to get source structure information.

- -

24 out of 233 (10%) -of SwiftLint’s linter rules use SourceKit.

-

Rules Using SourceKit

-

Default Rules (6)

- - -

Opt-in Rules (18)

- - -

Rules not Using SourceKit

-

Default Rules (90)

- - -

Opt-in Rules (119)

- - - -
-
- - -
-
- - - diff --git a/switch_case_alignment.html b/switch_case_alignment.html deleted file mode 100644 index 0351fbbf4..000000000 --- a/switch_case_alignment.html +++ /dev/null @@ -1,521 +0,0 @@ - - - - switch_case_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Switch and Case Statement Alignment

- -

Case statements should vertically align with their closing brace, or indented if configured otherwise.

- -
    -
  • Identifier: switch_case_alignment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -indented_cases - -false -
    -ignore_one_liners - -false -
  • -
-

Non Triggering Examples

-
switch someBool {
-case true: // case 1
-    print('red')
-case false:
-    /*
-    case 2
-    */
-    if case let .someEnum(val) = someFunc() {
-        print('blue')
-    }
-}
-enum SomeEnum {
-    case innocent
-}
-
-
if aBool {
-    switch someBool {
-    case true:
-        print('red')
-    case false:
-        print('blue')
-    }
-}
-
-
switch someInt {
-// comments ignored
-case 0:
-    // zero case
-    print('Zero')
-case 1:
-    print('One')
-default:
-    print('Some other number')
-}
-
-
func f() -> Int {
-    return switch i {
-    case 1: 1
-    default: 2
-    }
-}
-
-
switch i { case .x: 1 default: 0 }
-
-
let a = switch i { case .x: 1 default: 0 }
-
-

Triggering Examples

-
switch someBool {
-    ↓case true:
-        print("red")
-    ↓case false:
-        print("blue")
-}
-
-
if aBool {
-    switch someBool {
-        ↓case true:
-            print('red')
-        ↓case false:
-            print('blue')
-    }
-}
-
-
switch someInt {
-    ↓case 0:
-        print('Zero')
-    ↓case 1:
-        print('One')
-    ↓default:
-        print('Some other number')
-}
-
-
let a = switch i {
-    ↓case 1: 1
-    ↓default: 2
-}
-
-
switch someBool {
-case true:
-    print('red')
-    ↓case false:
-        print('blue')
-}
-
-
if aBool {
-    switch someBool {
-        ↓case true:
-        print('red')
-    case false:
-    print('blue')
-    }
-}
-
-
let a = switch i {
-case 1: 1
-    ↓default: 2
-}
-
-
switch i { ↓case .x: 1 ↓default: 0 }
-
-
switch i {
-↓case .x: 1 ↓default: 0 }
-
-
switch i { ↓case .x: 1 ↓default: 0
-}
-
-
switch i
-{ ↓case .x: 1 ↓default: 0 }
-
-
let a = switch i {
-case .x: 1 ↓default: 0
-}
-
-
let a = switch i {
-↓case .x: 1 ↓default: 0 }
-
- -
-
- - -
-
- - - diff --git a/switch_case_on_newline.html b/switch_case_on_newline.html deleted file mode 100644 index 5b452b5ef..000000000 --- a/switch_case_on_newline.html +++ /dev/null @@ -1,502 +0,0 @@ - - - - switch_case_on_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Cases on Newline

- -

Cases inside a switch should always be on a newline

- -
    -
  • Identifier: switch_case_on_newline
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/*case 1: */return true
-
-
//case 1:
- return true
-
-
let x = [caseKey: value]
-
-
let x = [key: .default]
-
-
if case let .someEnum(value) = aFunction([key: 2]) { }
-
-
guard case let .someEnum(value) = aFunction([key: 2]) { }
-
-
for case let .someEnum(value) = aFunction([key: 2]) { }
-
-
enum Environment {
- case development
-}
-
-
enum Environment {
- case development(url: URL)
-}
-
-
enum Environment {
- case development(url: URL) // staging
-}
-
-
switch foo {
-    case 1:
- return true
-}
-
-
switch foo {
-    default:
- return true
-}
-
-
switch foo {
-    case let value:
- return true
-}
-
-
switch foo {
-    case .myCase: // error from network
- return true
-}
-
-
switch foo {
-    case let .myCase(value) where value > 10:
- return false
-}
-
-
switch foo {
-    case let .myCase(value)
- where value > 10:
- return false
-}
-
-
switch foo {
-    case let .myCase(code: lhsErrorCode, description: _)
- where lhsErrorCode > 10:
-return false
-}
-
-
switch foo {
-    case #selector(aFunction(_:)):
- return false
-}
-
-
do {
-  let loadedToken = try tokenManager.decodeToken(from: response)
-  return loadedToken
-} catch { throw error }
-
-

Triggering Examples

-
switch foo {
-    ↓case 1: return true
-}
-
-
switch foo {
-    ↓case let value: return true
-}
-
-
switch foo {
-    ↓default: return true
-}
-
-
switch foo {
-    ↓case "a string": return false
-}
-
-
switch foo {
-    ↓case .myCase: return false // error from network
-}
-
-
switch foo {
-    ↓case let .myCase(value) where value > 10: return false
-}
-
-
switch foo {
-    ↓case #selector(aFunction(_:)): return false
-}
-
-
switch foo {
-    ↓case let .myCase(value)
- where value > 10: return false
-}
-
-
switch foo {
-    ↓case .first,
- .second: return false
-}
-
- -
-
- - -
-
- - - diff --git a/syntactic_sugar.html b/syntactic_sugar.html deleted file mode 100644 index e447ccaf8..000000000 --- a/syntactic_sugar.html +++ /dev/null @@ -1,470 +0,0 @@ - - - - syntactic_sugar Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Syntactic Sugar

- -

Shorthand syntactic sugar should be used, i.e. [Int] instead of Array.

- -
    -
  • Identifier: syntactic_sugar
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let x: [Int]
-
-
let x: [Int: String]
-
-
let x: Int?
-
-
func x(a: [Int], b: Int) -> [Int: Any]
-
-
let x: Int!
-
-
extension Array {
-  func x() { }
-}
-
-
extension Dictionary {
-  func x() { }
-}
-
-
let x: CustomArray<String>
-
-
var currentIndex: Array<OnboardingPage>.Index?
-
-
func x(a: [Int], b: Int) -> Array<Int>.Index
-
-
unsafeBitCast(nonOptionalT, to: Optional<T>.self)
-
-
unsafeBitCast(someType, to: Swift.Array<T>.self)
-
-
IndexingIterator<Array<Dictionary<String, AnyObject>>>.self
-
-
let y = Optional<String>.Type
-
-
type is Optional<String>.Type
-
-
let x: Foo.Optional<String>
-
-
let x = case Optional<Any>.none = obj
-
-
let a = Swift.Optional<String?>.none
-
-

Triggering Examples

-
let x: ↓Array<String>
-
-
let x: ↓Dictionary<Int, String>
-
-
let x: ↓Optional<Int>
-
-
let x: ↓Swift.Array<String>
-
-
func x(a: ↓Array<Int>, b: Int) -> [Int: Any]
-
-
func x(a: ↓Swift.Array<Int>, b: Int) -> [Int: Any]
-
-
func x(a: [Int], b: Int) -> ↓Dictionary<Int, String>
-
-
let x = y as? ↓Array<[String: Any]>
-
-
let x = Box<Array<T>>()
-
-
func x() -> Box<↓Array<T>>
-
-
func x() -> ↓Dictionary<String, Any>?
-
-
typealias Document = ↓Dictionary<String, T?>
-
-
func x(_ y: inout ↓Array<T>)
-
-
let x:↓Dictionary<String, ↓Dictionary<Int, Int>>
-
-
func x() -> Any { return ↓Dictionary<Int, String>()}
-
-
let x = ↓Array<String>.array(of: object)
-
-
let x = ↓Swift.Array<String>.array(of: object)
-
-
@_specialize(where S == ↓Array<Character>)
-public init<S: Sequence>(_ elements: S)
-
-
let dict: [String: Any] = [:]
-_ = dict["key"] as? ↓Optional<String?> ?? Optional<String?>.none
-
- -
-
- - -
-
- - - diff --git a/test_case_accessibility.html b/test_case_accessibility.html deleted file mode 100644 index 160ba6e97..000000000 --- a/test_case_accessibility.html +++ /dev/null @@ -1,496 +0,0 @@ - - - - test_case_accessibility Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Test Case Accessibility

- -

Test cases should only contain private non-test members

- -
    -
  • Identifier: test_case_accessibility
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -allowed_prefixes - -[] -
    -test_parent_classes - -[“QuickSpec”, “XCTestCase”] -
  • -
-

Non Triggering Examples

-
let foo: String?
-
-
let foo: String?
-
-class FooTests: XCTestCase {
-    static let allTests: [String] = []
-
-    private let foo: String {
-        let nestedMember = "hi"
-        return nestedMember
-    }
-
-    override static func setUp() {}
-
-    override func setUp() {}
-
-    override func setUpWithError() throws {}
-
-    override static func tearDown() {}
-
-    override func tearDown() {}
-
-    override func tearDownWithError() {}
-
-    override func someFutureXCTestFunction() {
-        super.someFutureXCTestFunction()
-    }
-
-    func testFoo() {
-        XCTAssertTrue(true)
-    }
-
-    func testBar() {
-        func nestedFunc() {}
-    }
-
-    private someFunc(hasParam: Bool) {}
-}
-
-
class FooTests: XCTestCase {
-    private struct MockSomething: Something {}
-}
-
-
class FooTests: XCTestCase {
-    override init() {
-        super.init()
-        let foo = 1
-        var bar = 2
-    }
-}
-
-
class FooTests: XCTestCase {
-    func allowedPrefixTestFoo() {}
-}
-
-
class Foobar {
-    func setUp() {}
-
-    func tearDown() {}
-
-    func testFoo() {}
-}
-
-

Triggering Examples

-
class FooTests: XCTestCase {
-    ↓typealias Bar = Foo.Bar
-
-    ↓var foo: String?
-    ↓let bar: String?
-
-    ↓static func foo() {}
-
-    ↓func setUp(withParam: String) {}
-
-    ↓func foobar() {}
-
-    ↓func not_testBar() {}
-
-    ↓enum Nested {}
-
-    ↓static func testFoo() {}
-
-    ↓static func allTests() {}
-
-    ↓func testFoo(hasParam: Bool) {}
-}
-
-final class BarTests: XCTestCase {
-    ↓class Nested {}
-}
-
- -
-
- - -
-
- - - diff --git a/todo.html b/todo.html deleted file mode 100644 index 5237277e9..000000000 --- a/todo.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - todo Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Todo

- -

TODOs and FIXMEs should be resolved.

- -
    -
  • Identifier: todo
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only - -[TODO, FIXME] -
  • -
-

Non Triggering Examples

-
// notaTODO:
-
-
// notaFIXME:
-
-

Triggering Examples

-
// ↓TODO:
-
-
// ↓FIXME:
-
-
// ↓TODO(note)
-
-
// ↓FIXME(note)
-
-
/* ↓FIXME: */
-
-
/* ↓TODO: */
-
-
/** ↓FIXME: */
-
-
/** ↓TODO: */
-
- -
-
- - -
-
- - - diff --git a/toggle_bool.html b/toggle_bool.html deleted file mode 100644 index b08812fb2..000000000 --- a/toggle_bool.html +++ /dev/null @@ -1,408 +0,0 @@ - - - - toggle_bool Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Toggle Bool

- -

Prefer someBool.toggle() over someBool = !someBool

- -
    -
  • Identifier: toggle_bool
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
isHidden.toggle()
-
-
view.clipsToBounds.toggle()
-
-
func foo() { abc.toggle() }
-
-
view.clipsToBounds = !clipsToBounds
-
-
disconnected = !connected
-
-
result = !result.toggle()
-
-

Triggering Examples

-
↓isHidden = !isHidden
-
-
↓view.clipsToBounds = !view.clipsToBounds
-
-
func foo() { ↓abc = !abc }
-
- -
-
- - -
-
- - - diff --git a/trailing_closure.html b/trailing_closure.html deleted file mode 100644 index 30ca698bf..000000000 --- a/trailing_closure.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - trailing_closure Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Closure

- -

Trailing closure syntax should be used whenever possible

- -
    -
  • Identifier: trailing_closure
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_single_muted_parameter - -false -
  • -
-

Non Triggering Examples

-
foo.map { $0 + 1 }
-
-
foo.bar()
-
-
foo.reduce(0) { $0 + 1 }
-
-
if let foo = bar.map({ $0 + 1 }) { }
-
-
foo.something(param1: { $0 }, param2: { $0 + 1 })
-
-
offsets.sorted { $0.offset < $1.offset }
-
-
foo.something({ return 1 }())
-
-
foo.something({ return $0 }(1))
-
-
foo.something(0, { return 1 }())
-
-
for x in list.filter({ $0.isValid }) {}
-
-
if list.allSatisfy({ $0.isValid }) {}
-
-
foo(param1: 1, param2: { _ in true }, param3: 0)
-
-
foo(param1: 1, param2: { _ in true }) { $0 + 1 }
-
-
foo(param1: { _ in false }, param2: { _ in true })
-
-
foo(param1: { _ in false }, param2: { _ in true }, param3: { _ in false })
-
-
if f({ true }), g({ true }) {
-    print("Hello")
-}
-
-
for i in h({ [1,2,3] }) {
-    print(i)
-}
-
-

Triggering Examples

-
foo.map(↓{ $0 + 1 })
-
-
foo.reduce(0, combine: ↓{ $0 + 1 })
-
-
offsets.sorted(by: ↓{ $0.offset < $1.offset })
-
-
foo.something(0, ↓{ $0 + 1 })
-
-
foo.something(param1: { _ in true }, param2: 0, param3: ↓{ _ in false })
-
- -
-
- - -
-
- - - diff --git a/trailing_comma.html b/trailing_comma.html deleted file mode 100644 index 2d1607c91..000000000 --- a/trailing_comma.html +++ /dev/null @@ -1,448 +0,0 @@ - - - - trailing_comma Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Comma

- -

Trailing commas in arrays and dictionaries should be avoided/enforced.

- -
    -
  • Identifier: trailing_comma
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -mandatory_comma - -false -
  • -
-

Non Triggering Examples

-
let foo = [1, 2, 3]
-
-
let foo = []
-
-
let foo = [:]
-
-
let foo = [1: 2, 2: 3]
-
-
let foo = [Void]()
-
-
let example = [ 1,
- 2
- // 3,
-]
-
-
foo([1: "\(error)"])
-
-
let foo = [Int]()
-
-

Triggering Examples

-
let foo = [1, 2, 3↓,]
-
-
let foo = [1, 2, 3↓, ]
-
-
let foo = [1, 2, 3   ↓,]
-
-
let foo = [1: 2, 2: 3↓, ]
-
-
struct Bar {
- let foo = [1: 2, 2: 3↓, ]
-}
-
-
let foo = [1, 2, 3↓,] + [4, 5, 6↓,]
-
-
let example = [ 1,
-2↓,
- // 3,
-]
-
-
let foo = ["אבג", "αβγ", "🇺🇸"↓,]
-
-
class C {
- #if true
- func f() {
- let foo = [1, 2, 3↓,]
- }
- #endif
-}
-
-
foo([1: "\(error)"↓,])
-
- -
-
- - -
-
- - - diff --git a/trailing_newline.html b/trailing_newline.html deleted file mode 100644 index 8c568ac5f..000000000 --- a/trailing_newline.html +++ /dev/null @@ -1,399 +0,0 @@ - - - - trailing_newline Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Newline

- -

Files should have a single trailing newline

- -
    -
  • Identifier: trailing_newline
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let a = 0
-
-
-

Triggering Examples

-
let a = 0
-
-
let a = 0
-
-
-
- -
-
- - -
-
- - - diff --git a/trailing_semicolon.html b/trailing_semicolon.html deleted file mode 100644 index b97852c88..000000000 --- a/trailing_semicolon.html +++ /dev/null @@ -1,403 +0,0 @@ - - - - trailing_semicolon Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Semicolon

- -

Lines should not have trailing semicolons

- -
    -
  • Identifier: trailing_semicolon
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let a = 0
-
-
let a = 0; let b = 0
-
-

Triggering Examples

-
let a = 0↓;
-
-
-
let a = 0↓;
-let b = 1
-
-
let a = 0↓; // a comment
-
-
- -
-
- - -
-
- - - diff --git a/trailing_whitespace.html b/trailing_whitespace.html deleted file mode 100644 index cdf6f8d57..000000000 --- a/trailing_whitespace.html +++ /dev/null @@ -1,427 +0,0 @@ - - - - trailing_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Trailing Whitespace

- -

Lines should not have trailing whitespace

- -
    -
  • Identifier: trailing_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignores_empty_lines - -false -
    -ignores_comments - -true -
  • -
-

Non Triggering Examples

-
let name: String
-
-
-
//
-
-
-
// 
-
-
-
let name: String //
-
-
-
let name: String // 
-
-
-

Triggering Examples

-
let name: String 
-
-
-
/* */ let name: String 
-
-
- -
-
- - -
-
- - - diff --git a/type_body_length.html b/type_body_length.html deleted file mode 100644 index e79a77f3e..000000000 --- a/type_body_length.html +++ /dev/null @@ -1,5494 +0,0 @@ - - - - type_body_length Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Body Length

- -

Type bodies should not span too many lines

- -
    -
  • Identifier: type_body_length
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: metrics
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -warning - -250 -
    -error - -350 -
  • -
-

Non Triggering Examples

-
class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
class Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
class Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
struct Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
struct Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
enum Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
enum Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-
actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
actor Abc {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-
-
actor Abc {
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-// this is a comment
-}
-
-
-
actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-
-/* this is
-a multiline comment
-*/}
-
-
-

Triggering Examples

-
↓class Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓struct Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓enum Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
-
↓actor Abc {
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-let abc = 0
-}
-
-
- -
-
- - -
-
- - - diff --git a/type_contents_order.html b/type_contents_order.html deleted file mode 100644 index f67320658..000000000 --- a/type_contents_order.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - type_contents_order Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Contents Order

- -

Specifies the order of subtypes, properties, methods & more within a type.

- -
    -
  • Identifier: type_contents_order
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -order - -[[case], [type_alias, associated_type], [subtype], [type_property], [instance_property], [ib_inspectable], [ib_outlet], [initializer], [type_method], [view_life_cycle_method], [ib_action], [other_method], [subscript], [deinitializer]] -
  • -
-

Non Triggering Examples

-
class TestViewController: UIViewController {
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-
-    struct TestStruct {
-        // 3 lines
-    }
-
-    enum TestEnum {
-        // 5 lines
-    }
-
-    // Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-
-    // Instance Properties
-    var shouldLayoutView1: Bool!
-    weak var delegate: TestViewControllerDelegate?
-    private var hasLayoutedView1: Bool = false
-    private var hasLayoutedView2: Bool = false
-
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-
-    // Initializers
-    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-
-    // View Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-
-    override func willMove(toParent parent: UIViewController?) {
-        super.willMove(toParent: parent)
-        if parent == nil {
-            viewModel.willMoveToParent()
-        }
-    }
-
-    override func viewDidLayoutSubviews() {
-        super.viewDidLayoutSubviews()
-
-        view2.setNeedsLayout()
-        view2.layoutIfNeeded()
-        hasLayoutedView2 = true
-    }
-
-    override func viewIsAppearing(_ animated: Bool) {
-        super.viewIsAppearing(animated)
-    }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    // Other Methods
-    func goToNextVc() { /* TODO */ }
-
-    func goToInfoVc() { /* TODO */ }
-
-    func goToRandomVc() {
-        let viewCtrl = getRandomVc()
-        present(viewCtrl, animated: true)
-    }
-
-    private func getRandomVc() -> UIViewController { return UIViewController() }
-
-    // Subscripts
-    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-
-    deinit {
-        log.debug("deinit")
-    },
-}
-
-

Triggering Examples

-
class TestViewController: UIViewController {
-    // Subtypes
-    ↓class TestClass {
-        // 10 lines
-    }
-
-    // Type Aliases
-    typealias CompletionHandler = ((TestEnum) -> Void)
-}
-
-
class TestViewController: UIViewController {
-    // Stored Type Properties
-    ↓static let cellIdentifier: String = "AmazingCell"
-
-    // Subtypes
-    class TestClass {
-        // 10 lines
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Stored Instance Properties
-    ↓var shouldLayoutView1: Bool!
-
-    // Stored Type Properties
-    static let cellIdentifier: String = "AmazingCell"
-}
-
-
class TestViewController: UIViewController {
-    // IBOutlets
-    @IBOutlet private ↓var view1: UIView!
-
-    // Computed Instance Properties
-    private var hasAnyLayoutedView: Bool {
-         return hasLayoutedView1 || hasLayoutedView2
-    }
-}
-
-
class TestViewController: UIViewController {
-
-    // deinitializer
-    ↓deinit {
-        log.debug("deinit")
-    }
-
-    // Initializers
-    override ↓init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
-        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-    }
-
-    // IBOutlets
-    @IBOutlet private var view1: UIView!
-    @IBOutlet private var view2: UIView!
-}
-
-
class TestViewController: UIViewController {
-    // View Life-Cycle Methods
-    override ↓func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-
-    // Type Methods
-    static func makeViewController() -> TestViewController {
-        // some code
-    }
-}
-
-
class TestViewController: UIViewController {
-    // IBActions
-    @IBAction ↓func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-
-    // View Life-Cycle Methods
-    override func viewDidLoad() {
-        super.viewDidLoad()
-
-        view1.setNeedsLayout()
-        view1.layoutIfNeeded()
-        hasLayoutedView1 = true
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Other Methods
-    ↓func goToNextVc() { /* TODO */ }
-
-    // IBActions
-    @IBAction func goNextButtonPressed() {
-        goToNextVc()
-        delegate?.didPressTrackedButton()
-    }
-}
-
-
class TestViewController: UIViewController {
-    // Subscripts
-    ↓subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
-        get {
-            return "This is just a test"
-        }
-
-        set {
-            log.warning("Just a test", newValue)
-        }
-    }
-
-    // MARK: Other Methods
-    func goToNextVc() { /* TODO */ }
-}
-
- -
-
- - -
-
- - - diff --git a/type_name.html b/type_name.html deleted file mode 100644 index cf1d701b8..000000000 --- a/type_name.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - type_name Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type Name

- -

Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length. -Private types may start with an underscore.

- -
    -
  • Identifier: type_name
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -min_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -3 -
    -error - -0 -
    -
    -max_length - - - - - - - - - - - - - - - -
    KeyValue
    -warning - -40 -
    -error - -1000 -
    -
    -excluded - -[] -
    -allowed_symbols - -[] -
    -unallowed_symbols_severity - -error -
    -validates_start_with_lowercase - -error -
    -validate_protocols - -true -
  • -
-

Non Triggering Examples

-
class MyType {}
-
-
private struct _MyType {}
-
-
enum AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
-
-
typealias Foo = Void
-
-
private typealias Foo = Void
-
-
protocol Foo {
-  associatedtype Bar
-}
-
-
protocol Foo {
-  associatedtype Bar: Equatable
-}
-
-
enum MyType {
-case value
-}
-
-
protocol P {}
-
-
struct SomeStruct {
-  enum `Type` {
-    case x, y, z
-  }
-}
-
-

Triggering Examples

-
class ↓myType {}
-
-
enum ↓_MyType {}
-
-
private struct ↓MyType_ {}
-
-
struct ↓My {}
-
-
struct ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
-
-
class ↓MyView_Previews
-
-
private struct ↓_MyView_Previews
-
-
typealias ↓X = Void
-
-
private typealias ↓Foo_Bar = Void
-
-
private typealias ↓foo = Void
-
-
typealias ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = Void
-
-
protocol Foo {
-  associatedtype ↓X
-}
-
-
protocol Foo {
-  associatedtype ↓Foo_Bar: Equatable
-}
-
-
protocol Foo {
-  associatedtype ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-}
-
-
protocol ↓X {}
-
- -
-
- - -
-
- - - diff --git a/typesafe_array_init.html b/typesafe_array_init.html deleted file mode 100644 index b8cf6d9ca..000000000 --- a/typesafe_array_init.html +++ /dev/null @@ -1,418 +0,0 @@ - - - - typesafe_array_init Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Type-safe Array Init

- -

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array

- -
    -
  • Identifier: typesafe_array_init
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    enum MyError: Error {}
-    let myResult: Result<String, MyError> = .success("")
-    let result: Result<Any, MyError> = myResult.map { $0 }
-
-
    struct IntArray {
-        let elements = [1, 2, 3]
-        func map<T>(_ transformer: (Int) throws -> T) rethrows -> [T] {
-            try elements.map(transformer)
-        }
-    }
-    let ints = IntArray()
-    let intsCopy = ints.map { $0 }
-
-

Triggering Examples

-
    func f<Seq: Sequence>(s: Seq) -> [Seq.Element] {
-        s.↓map({ $0 })
-    }
-
-
    func f(array: [Int]) -> [Int] {
-        array.↓map { $0 }
-    }
-
-
    let myInts = [1, 2, 3].↓map { return $0 }
-
-
    struct Generator: Sequence, IteratorProtocol {
-        func next() -> Int? { nil }
-    }
-    let array = Generator().↓map { i in i }
-
- -
-
- - -
-
- - - diff --git a/unavailable_condition.html b/unavailable_condition.html deleted file mode 100644 index d95a25723..000000000 --- a/unavailable_condition.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - unavailable_condition Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unavailable Condition

- -

Use #unavailable/#available instead of #available/#unavailable with an empty body.

- -
    -
  • Identifier: unavailable_condition
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.6.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if #unavailable(iOS 13) {
-  loadMainWindow()
-}
-
-
if #available(iOS 9.0, *) {
-  doSomething()
-} else {
-  legacyDoSomething()
-}
-
-
if #available(macOS 11.0, *) {
-   // Do nothing
-} else if #available(macOS 10.15, *) {
-   print("do some stuff")
-}
-
-

Triggering Examples

-
if ↓#available(iOS 14.0) {
-
-} else {
-  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
-}
-
-
if ↓#available(iOS 14.0) {
-  // we don't need to do anything here
-} else {
-  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
-}
-
-
if ↓#available(iOS 13, *) {} else {
-  loadMainWindow()
-}
-
-
if ↓#unavailable(iOS 13) {
-  // Do nothing
-} else if i < 2 {
-  loadMainWindow()
-}
-
- -
-
- - -
-
- - - diff --git a/unavailable_function.html b/unavailable_function.html deleted file mode 100644 index 211627cda..000000000 --- a/unavailable_function.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - unavailable_function Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unavailable Function

- -

Unimplemented functions should be marked as unavailable

- -
    -
  • Identifier: unavailable_function
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class ViewController: UIViewController {
-  @available(*, unavailable)
-  public required init?(coder aDecoder: NSCoder) {
-    preconditionFailure("init(coder:) has not been implemented")
-  }
-}
-
-
func jsonValue(_ jsonString: String) -> NSObject {
-   let data = jsonString.data(using: .utf8)!
-   let result = try! JSONSerialization.jsonObject(with: data, options: [])
-   if let dict = (result as? [String: Any])?.bridge() {
-    return dict
-   } else if let array = (result as? [Any])?.bridge() {
-    return array
-   }
-   fatalError()
-}
-
-
func resetOnboardingStateAndCrash() -> Never {
-    resetUserDefaults()
-    // Crash the app to re-start the onboarding flow.
-    fatalError("Onboarding re-start crash.")
-}
-
-

Triggering Examples

-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    fatalError("init(coder:) has not been implemented")
-  }
-}
-
-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    let reason = "init(coder:) has not been implemented"
-    fatalError(reason)
-  }
-}
-
-
class ViewController: UIViewController {
-  public required ↓init?(coder aDecoder: NSCoder) {
-    preconditionFailure("init(coder:) has not been implemented")
-  }
-}
-
-
↓func resetOnboardingStateAndCrash() {
-    resetUserDefaults()
-    // Crash the app to re-start the onboarding flow.
-    fatalError("Onboarding re-start crash.")
-}
-
- -
-
- - -
-
- - - diff --git a/undocumented.json b/undocumented.json deleted file mode 100644 index ec7e65616..000000000 --- a/undocumented.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "warnings": [ - - ], - "source_directory": "/Users/runner/work/1/s" -} \ No newline at end of file diff --git a/unhandled_throwing_task.html b/unhandled_throwing_task.html deleted file mode 100644 index 3368765dd..000000000 --- a/unhandled_throwing_task.html +++ /dev/null @@ -1,530 +0,0 @@ - - - - unhandled_throwing_task Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unhandled Throwing Task

- -

Errors thrown inside this task are not handled, which may be unexpected. Handle errors inside the task, or use try await to access the Tasks value and handle errors. See this forum thread for more details: https://forums.swift.org/t/task-initializer-with-throwing-closure-swallows-error/56066

- -
    -
  • Identifier: unhandled_throwing_task
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -error -
  • -
-

Non Triggering Examples

-
Task<Void, Never> {
-  try await myThrowingFunction()
-}
-
-
Task {
-  try? await myThrowingFunction()
-}
-
-
Task {
-  try! await myThrowingFunction()
-}
-
-
Task<Void, String> {
-  let text = try myThrowingFunction()
-  return text
-}
-
-
Task {
-  do {
-    try myThrowingFunction()
-  } catch let e {
-    print(e)
-  }
-}
-
-
func someFunction() throws {
-  Task {
-    anotherFunction()
-    do {
-      try myThrowingFunction()
-    } catch {
-      print(error)
-    }
-  }
-
-  try something()
-}
-
-
let task = Task {
-  try await myThrowingFunction()
-}
-
-
var task = Task {
-  try await myThrowingFunction()
-}
-
-
try await Task {
-  try await myThrowingFunction()
-}.value
-
-
executor.task = Task {
-  try await isolatedOpen(.init(executor.asUnownedSerialExecutor()))
-}
-
-
let result = await Task {
-  throw CancellationError()
-}.result
-
-
func makeTask() -> Task<String, Error> {
-  return Task {
-    try await someThrowingFunction()
-  }
-}
-
-
func makeTask() -> Task<String, Error> {
-  // Implicit return
-  Task {
-    try await someThrowingFunction()
-  }
-}
-
-
Task {
-  return Result {
-      try someThrowingFunc()
-  }
-}
-
-

Triggering Examples

-
↓Task {
-  try await myThrowingFunction()
-}
-
-
↓Task {
-  let text = try myThrowingFunction()
-  return text
-}
-
-
↓Task {
-  do {
-    try myThrowingFunction()
-  }
-}
-
-
↓Task {
-  do {
-    try myThrowingFunction()
-  } catch let e as FooError {
-    print(e)
-  }
-}
-
-
↓Task {
-  do {
-    throw FooError.bar
-  }
-}
-
-
↓Task {
-  throw FooError.bar
-}
-
-
↓Task<_, _> {
-  throw FooError.bar
-}
-
-
↓Task<Void,_> {
-  throw FooError.bar
-}
-
-
↓Task {
-  do {
-    try foo()
-  } catch {
-    try bar()
-  }
-}
-
-
↓Task {
-  do {
-    try foo()
-  } catch {
-    throw BarError()
-  }
-}
-
-
func doTask() {
-  ↓Task {
-    try await someThrowingFunction()
-  }
-}
-
- -
-
- - -
-
- - - diff --git a/unneeded_break_in_switch.html b/unneeded_break_in_switch.html deleted file mode 100644 index 70ac25e97..000000000 --- a/unneeded_break_in_switch.html +++ /dev/null @@ -1,451 +0,0 @@ - - - - unneeded_break_in_switch Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Break in Switch

- -

Avoid using unneeded break statements

- -
    -
  • Identifier: unneeded_break_in_switch
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
switch foo {
-case .bar:
-    break
-}
-
-
switch foo {
-default:
-    break
-}
-
-
switch foo {
-case .bar:
-    for i in [0, 1, 2] { break }
-}
-
-
switch foo {
-case .bar:
-    if true { break }
-}
-
-
switch foo {
-case .bar:
-    something()
-}
-
-
let items = [Int]()
-for item in items {
-    if bar() {
-        do {
-            try foo()
-        } catch {
-            bar()
-            break
-        }
-    }
-}
-
-

Triggering Examples

-
switch foo {
-case .bar:
-    something()
-    ↓break
-}
-
-
switch foo {
-case .bar:
-    something()
-    ↓break // comment
-}
-
-
switch foo {
-default:
-    something()
-    ↓break
-}
-
-
switch foo {
-case .foo, .foo2 where condition:
-    something()
-    ↓break
-}
-
- -
-
- - -
-
- - - diff --git a/unneeded_override.html b/unneeded_override.html deleted file mode 100644 index eb18caf49..000000000 --- a/unneeded_override.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - unneeded_override Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Overridden Functions

- -

Remove overridden functions that don’t do anything except call their super

- -
    -
  • Identifier: unneeded_override
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -affect_initializers - -false -
  • -
-

Non Triggering Examples

-
class Foo {
-    override func bar() {
-        super.bar()
-        print("hi")
-    }
-}
-
-
class Foo {
-    @available(*, unavailable)
-    override func bar() {
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() {
-        super.bar()
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() throws {
-        // Doing a different variation of 'try' changes behavior
-        try! super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() throws {
-        // Doing a different variation of 'try' changes behavior
-        try? super.bar()
-    }
-}
-
-
class Foo {
-    override func bar() async throws {
-        // Doing a different variation of 'try' changes behavior
-        await try! super.bar()
-    }
-}
-
-
class Foo {
-    override func bar(arg: Bool) {
-        // Flipping the argument changes behavior
-        super.bar(arg: !arg)
-    }
-}
-
-
class Foo {
-    override func bar(_ arg: Int) {
-        // Changing the argument changes behavior
-        super.bar(arg + 1)
-    }
-}
-
-
class Foo {
-    override func bar(arg: Int) {
-        // Changing the argument changes behavior
-        super.bar(arg: arg.var)
-    }
-}
-
-
class Foo {
-    override func bar(_ arg: Int) {
-        // Not passing arguments because they have default values changes behavior
-        super.bar()
-    }
-}
-
-
class Foo {
-    override func bar(arg: Int, _ arg3: Bool) {
-        // Calling a super function with different argument labels changes behavior
-        super.bar(arg2: arg, arg3: arg3)
-    }
-}
-
-
class Foo {
-    override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated) {
-            // This likely changes behavior
-        }
-    }
-}
-
-
class Foo {
-    override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated, completion: {
-            // This likely changes behavior
-        })
-    }
-}
-
-
class Baz: Foo {
-    // A default argument might be a change
-    override func bar(value: String = "Hello") {
-        super.bar(value: value)
-    }
-}
-
-

Triggering Examples

-
class Foo {
-    ↓override func bar() {
-        super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() {
-        return super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() {
-        super.bar()
-        // comments don't affect this
-    }
-}
-
-
class Foo {
-    ↓override func bar() async {
-        await super.bar()
-    }
-}
-
-
class Foo {
-    ↓override func bar() throws {
-        try super.bar()
-        // comments don't affect this
-    }
-}
-
-
class Foo {
-    ↓override func bar(arg: Bool) throws {
-        try super.bar(arg: arg)
-    }
-}
-
-
class Foo {
-    ↓override func bar(animated: Bool, completion: () -> Void) {
-        super.bar(animated: animated, completion: completion)
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/unneeded_parentheses_in_closure_argument.html b/unneeded_parentheses_in_closure_argument.html deleted file mode 100644 index ee66ed862..000000000 --- a/unneeded_parentheses_in_closure_argument.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - unneeded_parentheses_in_closure_argument Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Parentheses in Closure Argument

- -

Parentheses are not needed when declaring closure arguments

- -
    -
  • Identifier: unneeded_parentheses_in_closure_argument
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let foo = { (bar: Int) in }
-
-
let foo = { bar, _  in }
-
-
let foo = { bar in }
-
-
let foo = { bar -> Bool in return true }
-
-
DispatchQueue.main.async { () -> Void in
-    doSomething()
-}
-
-

Triggering Examples

-
call(arg: { ↓(bar) in })
-
-
call(arg: { ↓(bar, _) in })
-
-
let foo = { ↓(bar) -> Bool in return true }
-
-
foo.map { ($0, $0) }.forEach { ↓(x, y) in }
-
-
foo.bar { [weak self] ↓(x, y) in }
-
-
[].first { ↓(temp) in
-    [].first { ↓(temp) in
-        [].first { ↓(temp) in
-            _ = temp
-            return false
-        }
-        return false
-    }
-    return false
-}
-
-
[].first { temp in
-    [].first { ↓(temp) in
-        [].first { ↓(temp) in
-            _ = temp
-            return false
-        }
-        return false
-    }
-    return false
-}
-
- -
-
- - -
-
- - - diff --git a/unneeded_synthesized_initializer.html b/unneeded_synthesized_initializer.html deleted file mode 100644 index 5c476e031..000000000 --- a/unneeded_synthesized_initializer.html +++ /dev/null @@ -1,683 +0,0 @@ - - - - unneeded_synthesized_initializer Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unneeded Synthesized Initializer

- -

Default or memberwise initializers that will be automatically synthesized do not need to be manually defined.

- -
    -
  • Identifier: unneeded_synthesized_initializer
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not be private.
-    private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String
-
-    // Synthesized initializer would not be private.
-    private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not be fileprivate.
-    fileprivate init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    let bar: String
-
-    // Synthesized initializer would not prepend "foo".
-    init(bar: String) {
-        self.bar = "foo" + bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Failable initializer
-    init?(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Initializer throws
-    init(bar: String) throws {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    let bar: String
-
-    // Different argument labels
-    init(_ bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    var bar: String = "foo"
-
-    // Different default values
-    init(bar: String = "bar") {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private static var bar: String
-
-    // var is static
-    init(bar: String) {
-        Self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private var bar: String
-
-    // var is private
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    fileprivate var bar: String
-
-    // var is fileprivate
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // init has no body
-    init(foo: String, bar: String) {
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // foo is not initialized
-    init(foo: String, bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-    // Ordering of args is different from properties.
-    init(bar: String, foo: String) {
-        self.foo = foo
-        self.bar = bar
-    }
-}
-
-
@frozen
-public struct Field {
-    @usableFromInline
-    let index: Int
-
-    @usableFromInline
-    let parent: Metadata
-
-    @inlinable // inlinable
-    init(index: Int, parent: Metadata) {
-       self.index = index
-       self.parent = parent
-    }
-}
-
-
internal struct Foo {
-    var bar: String = ""
-    var baz: Int = 0
-
-    // These initializers must be declared.
-    init() { }
-
-    init(bar: String = "", baz: Int = 0) {
-        self.bar = bar
-        self.baz = baz
-    }
-
-    // Because manually declared initializers block
-    // synthesization.
-    init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    init() {
-        print("perform side effect")
-    }
-}
-
-
struct Foo {
-    var bar: Int = 0
-
-    init(bar: Int = 0) {
-        self.bar = bar
-        print("perform side effect")
-    }
-}
-
-

Triggering Examples

-
struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
private struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
fileprivate struct Foo {
-    let bar: String
-
-   ↓init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    fileprivate var bar: String
-
-   ↓fileprivate init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    private var bar: String
-
-   ↓private init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var foo: String
-    var bar: String
-
-   ↓init(foo: String, bar: String) {
-        self.foo = foo
-        self.bar = bar
-    }
-}
-
-
internal struct Foo {
-    var bar: String
-
-   ↓internal init(bar: String) {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar: String = ""
-
-   ↓init() {
-        // Empty initializer will be generated automatically
-        // when all vars have default values.
-    }
-}
-
-
struct Foo {
-    var bar: String = ""
-
-   ↓init() {
-        // Empty initializer
-    }
-
-   ↓init(bar: String = "") {
-        self.bar = bar
-    }
-}
-
-
struct Foo {
-    var bar = ""
-
-   ↓init(bar: String = "") {
-        self.bar = bar
-    }
-}
-
-
struct Outer {
-    struct Inner {
-        let prop: Int
-
-       ↓init(prop: Int) {
-            self.prop = prop
-        }
-    }
-}
-
-
class Foo {
-    struct Bar {
-        let baz: Int
-
-       ↓init(baz: Int) {
-            self.baz = baz
-        }
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/unowned_variable_capture.html b/unowned_variable_capture.html deleted file mode 100644 index f55ee8a3f..000000000 --- a/unowned_variable_capture.html +++ /dev/null @@ -1,416 +0,0 @@ - - - - unowned_variable_capture Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unowned Variable Capture

- -

Prefer capturing references as weak to avoid potential crashes

- -
    -
  • Identifier: unowned_variable_capture
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo { [weak self] in _ }
-
-
foo { [weak self] param in _ }
-
-
foo { [weak bar] in _ }
-
-
foo { [weak bar] param in _ }
-
-
foo { bar in _ }
-
-
foo { $0 }
-
-
final class First {}
-final class Second {
-  unowned var value: First
-  init(value: First) {
-    self.value = value
-  }
-}
-
-

Triggering Examples

-
foo { [↓unowned self] in _ }
-
-
foo { [↓unowned bar] in _ }
-
-
foo { [bar, ↓unowned self] in _ }
-
- -
-
- - -
-
- - - diff --git a/untyped_error_in_catch.html b/untyped_error_in_catch.html deleted file mode 100644 index 122b21a45..000000000 --- a/untyped_error_in_catch.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - untyped_error_in_catch Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Untyped Error in Catch

- -

Catch statements should not declare error variables without type casting

- -
    -
  • Identifier: untyped_error_in_catch
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
do {
-  try foo()
-} catch {}
-
-
do {
-  try foo()
-} catch Error.invalidOperation {
-} catch {}
-
-
do {
-  try foo()
-} catch let error as MyError {
-} catch {}
-
-
do {
-  try foo()
-} catch var error as MyError {
-} catch {}
-
-
do {
-    try something()
-} catch let e where e.code == .fileError {
-    // can be ignored
-} catch {
-    print(error)
-}
-
-

Triggering Examples

-
do {
-  try foo()
-} ↓catch var error {}
-
-
do {
-  try foo()
-} ↓catch let error {}
-
-
do {
-  try foo()
-} ↓catch let someError {}
-
-
do {
-  try foo()
-} ↓catch var someError {}
-
-
do {
-  try foo()
-} ↓catch let e {}
-
-
do {
-  try foo()
-} ↓catch(let error) {}
-
-
do {
-  try foo()
-} ↓catch (let error) {}
-
- -
-
- - -
-
- - - diff --git a/unused_capture_list.html b/unused_capture_list.html deleted file mode 100644 index 180c2f4b5..000000000 --- a/unused_capture_list.html +++ /dev/null @@ -1,495 +0,0 @@ - - - - unused_capture_list Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Capture List

- -

Unused reference in a capture list should be removed

- -
    -
  • Identifier: unused_capture_list
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map {
-    [ weak
-      delegate,
-      unowned
-      self
-    ] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map { [weak self] num in
-    self?.handle(num)
-}
-
-
let failure: Failure = { [weak self, unowned delegate = self.delegate!] foo in
-    delegate.handle(foo, self)
-}
-
-
numbers.forEach({
-    [weak handler] in
-    handler?.handle($0)
-})
-
-
withEnvironment(apiService: MockService(fetchProjectResponse: project)) {
-    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
-        device.handle()
-    }
-}
-
-
{ [foo] _ in foo.bar() }()
-
-
sizes.max().flatMap { [(offset: offset, size: $0)] } ?? []
-
-
[1, 2].map { [self] num in
-    handle(num)
-}
-
-
[1, 2].map { [unowned self] num in
-    handle(num)
-}
-
-
[1, 2].map { [self, unowned delegate = self.delegate!] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map { [unowned self, unowned delegate = self.delegate!] num in
-    delegate.handle(num)
-}
-
-
[1, 2].map {
-    [ weak
-      delegate,
-      self
-    ] num in
-    delegate.handle(num)
-}
-
-
rx.onViewDidAppear.subscribe(onNext: { [unowned self] in
-      doSomething()
-}).disposed(by: disposeBag)
-
-
let closure = { [weak self] in
-    guard let self else {
-        return
-    }
-    someInstanceFunction()
-}
-
-

Triggering Examples

-
[1, 2].map { [↓weak self] num in
-    print(num)
-}
-
-
let failure: Failure = { [weak self, ↓unowned delegate = self.delegate!] foo in
-    self?.handle(foo)
-}
-
-
let failure: Failure = { [↓weak self, ↓unowned delegate = self.delegate!] foo in
-    print(foo)
-}
-
-
numbers.forEach({
-    [weak handler] in
-    print($0)
-})
-
-
numbers.forEach({
-    [self, ↓weak handler] in
-    print($0)
-})
-
-
withEnvironment(apiService: MockService(fetchProjectResponse: project)) { [↓foo] in
-    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
-        device.handle()
-    }
-}
-
-
{ [↓foo] in _ }()
-
-
let closure = { [↓weak a] in
-    // The new `a` immediately shadows the captured `a` which thus isn't needed.
-    guard let a = getOptionalValue() else {
-        return
-    }
-    someInstanceFunction()
-}
-
- -
-
- - -
-
- - - diff --git a/unused_closure_parameter.html b/unused_closure_parameter.html deleted file mode 100644 index e310d51b7..000000000 --- a/unused_closure_parameter.html +++ /dev/null @@ -1,503 +0,0 @@ - - - - unused_closure_parameter Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Closure Parameter

- -

Unused parameter in a closure should be replaced with _

- -
    -
  • Identifier: unused_closure_parameter
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
[1, 2].map { $0 + 1 }
-
-
[1, 2].map({ $0 + 1 })
-
-
[1, 2].map { number in
- number + 1 
-}
-
-
[1, 2].map { _ in
- 3 
-}
-
-
[1, 2].something { number, idx in
- return number * idx
-}
-
-
let isEmpty = [1, 2].isEmpty()
-
-
violations.sorted(by: { lhs, rhs in 
- return lhs.location > rhs.location
-})
-
-
rlmConfiguration.migrationBlock.map { rlmMigration in
-    return { migration, schemaVersion in
-        rlmMigration(migration.rlmMigration, schemaVersion)
-    }
-}
-
-
genericsFunc { (a: Type, b) in
-    a + b
-}
-
-
var label: UILabel = { (lbl: UILabel) -> UILabel in
-    lbl.backgroundColor = .red
-    return lbl
-}(UILabel())
-
-
hoge(arg: num) { num in
-    return num
-}
-
-
({ (manager: FileManager) in
-  print(manager)
-})(FileManager.default)
-
-
withPostSideEffect { input in
-    if true { print("\(input)") }
-}
-
-
viewModel?.profileImage.didSet(weak: self) { (self, profileImage) in
-    self.profileImageView.image = profileImage
-}
-
-
let failure: Failure = { task, error in
-    observer.sendFailed(error, task)
-}
-
-
List($names) { $name in
-    Text(name)
-}
-
-
List($names) { $name in
-    TextField($name)
-}
-
-
_ = ["a"].filter { `class` in `class`.hasPrefix("a") }
-
-
let closure: (Int) -> Void = { `foo` in _ = foo }
-
-
let closure: (Int) -> Void = { foo in _ = `foo` }
-
-

Triggering Examples

-
[1, 2].map { ↓number in
- return 3 }
-
-
[1, 2].map { ↓number in
- return numberWithSuffix }
-
-
[1, 2].map { ↓number in
- return 3 // number }
-
-
[1, 2].map { ↓number in
- return 3 "number" }
-
-
[1, 2].something { number, ↓idx in
- return number }
-
-
genericsFunc { (↓number: TypeA, idx: TypeB) in return idx }
-
-
let c: (Int) -> Void = { foo in _ = .foo }
-
-
hoge(arg: num) { ↓num in
-}
-
-
fooFunc { ↓아 in }
-
-
func foo () {
- bar { ↓number in return 3 }
-
-
viewModel?.profileImage.didSet(weak: self) { (↓self, profileImage) in
-    profileImageView.image = profileImage
-}
-
-
let failure: Failure = { ↓task, error in
-    observer.sendFailed(error)
-}
-
-
List($names) { ↓$name in
-    Text("Foo")
-}
-
-
let class1 = "a"
-_ = ["a"].filter { ↓`class` in `class1`.hasPrefix("a") }
-
- -
-
- - -
-
- - - diff --git a/unused_control_flow_label.html b/unused_control_flow_label.html deleted file mode 100644 index 067d16a60..000000000 --- a/unused_control_flow_label.html +++ /dev/null @@ -1,433 +0,0 @@ - - - - unused_control_flow_label Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Control Flow Label

- -

Unused control flow label should be removed

- -
    -
  • Identifier: unused_control_flow_label
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
loop: while true { break loop }
-
-
loop: while true { continue loop }
-
-
loop:
-    while true { break loop }
-
-
while true { break }
-
-
loop: for x in array { break loop }
-
-
label: switch number {
-case 1: print("1")
-case 2: print("2")
-default: break label
-}
-
-
loop: repeat {
-    if x == 10 {
-        break loop
-    }
-} while true
-
-

Triggering Examples

-
↓loop: while true { break }
-
-
↓loop: while true { break loop1 }
-
-
↓loop: while true { break outerLoop }
-
-
↓loop: for x in array { break }
-
-
↓label: switch number {
-case 1: print("1")
-case 2: print("2")
-default: break
-}
-
-
↓loop: repeat {
-    if x == 10 {
-        break
-    }
-} while true
-
- -
-
- - -
-
- - - diff --git a/unused_declaration.html b/unused_declaration.html deleted file mode 100644 index a8e82ad3f..000000000 --- a/unused_declaration.html +++ /dev/null @@ -1,680 +0,0 @@ - - - - unused_declaration Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Declaration

- -

Declarations should be referenced at least once within all files linted

- -
    -
  • Identifier: unused_declaration
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -error -
    -include_public_and_open - -false -
    -related_usrs_to_skip - -[“s:7SwiftUI15PreviewProviderP”] -
  • -
-

Non Triggering Examples

-
let kConstant = 0
-_ = kConstant
-
-
enum Change<T> {
-  case insert(T)
-  case delete(T)
-}
-
-extension Sequence {
-  func deletes<T>() -> [T] where Element == Change<T> {
-    return compactMap { operation in
-      if case .delete(let value) = operation {
-        return value
-      } else {
-        return nil
-      }
-    }
-  }
-}
-
-let changes = [Change.insert(0), .delete(0)]
-_ = changes.deletes()
-
-
struct Item: Codable {}
-struct ResponseModel: Codable {
-    let items: [Item]
-
-    enum CodingKeys: String, CodingKey {
-        case items = "ResponseItems"
-    }
-}
-
-_ = ResponseModel(items: [Item()]).items
-
-
class ResponseModel {
-    @objc func foo() {
-    }
-}
-_ = ResponseModel()
-
-
public func foo() {}
-
-
protocol Foo {}
-
-extension Foo {
-    func bar() {}
-}
-
-struct MyStruct: Foo {}
-MyStruct().bar()
-
-
import XCTest
-class MyTests: XCTestCase {
-    func testExample() {}
-}
-
-
import XCTest
-open class BestTestCase: XCTestCase {}
-class MyTests: BestTestCase {
-    func testExample() {}
-}
-
-
    struct S {
-        var i: Int? = nil
-        func f() {
-            if let i { print(i) }
-        }
-    }
-    S().f()
-
-
enum Component {
-  case string(StaticString)
-  indirect case array([Component])
-  indirect case optional(Component?)
-}
-
-@resultBuilder
-struct ComponentBuilder {
-  static func buildBlock(_ components: Component...) -> Component {
-    return .array(components)
-  }
-
-  static func buildExpression(_ string: StaticString) -> Component {
-    return .string(string)
-  }
-
-  static func buildOptional(_ component: Component?) -> Component {
-    return .optional(component)
-  }
-
-  static func buildEither(first component: Component) -> Component {
-    return component
-  }
-
-  static func buildEither(second component: Component) -> Component {
-    return component
-  }
-
-  static func buildArray(_ components: [Component]) -> Component {
-    return .array(components)
-  }
-
-  static func buildLimitedAvailability(_ component: Component) -> Component {
-    return component
-  }
-
-  static func buildFinalResult(_ component: Component) -> Component {
-    return component
-  }
-
-  static func buildPartialBlock(first component: Component) -> Component {
-    return component
-  }
-
-  static func buildPartialBlock(accumulated component: Component, next: Component) -> Component {
-    return component
-  }
-}
-
-func acceptComponentBuilder(@ComponentBuilder _ body: () -> Component) {
-  print(body())
-}
-
-acceptComponentBuilder {
-  "hello"
-}
-
-
import Cocoa
-
-@NSApplicationMain
-final class AppDelegate: NSObject, NSApplicationDelegate {
-    func applicationWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBAction private func foo() {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @objc func foo() {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBInspectable private var innerPaddingWidth: Int {
-        set { self.backgroundView.innerPaddingWidth = newValue }
-        get { return self.backgroundView.innerPaddingWidth }
-    }
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBOutlet private var bar: NSObject! {
-        set { fatalError() }
-        get { fatalError() }
-    }
-
-    @IBOutlet private var baz: NSObject! {
-        willSet { print("willSet") }
-    }
-
-    @IBOutlet private var buzz: NSObject! {
-        didSet { print("didSet") }
-    }
-}
-
-

Triggering Examples

-
let ↓kConstant = 0
-
-
struct Item {}
-struct ↓ResponseModel: Codable {
-    let ↓items: [Item]
-
-    enum ↓CodingKeys: String {
-        case items = "ResponseItems"
-    }
-}
-
-
class ↓ResponseModel {
-    func ↓foo() {
-    }
-}
-
-
public func ↓foo() {}
-
-
protocol Foo {
-    func ↓bar1()
-}
-
-extension Foo {
-    func bar1() {}
-    func ↓bar2() {}
-}
-
-struct MyStruct: Foo {}
-_ = MyStruct()
-
-
import XCTest
-class ↓MyTests: NSObject {
-    func ↓testExample() {}
-}
-
-
enum Component {
-  case string(StaticString)
-  indirect case array([Component])
-  indirect case optional(Component?)
-}
-
-struct ComponentBuilder {
-  func ↓buildExpression(_ string: StaticString) -> Component {
-    return .string(string)
-  }
-
-  func ↓buildBlock(_ components: Component...) -> Component {
-    return .array(components)
-  }
-
-  func ↓buildIf(_ value: Component?) -> Component {
-    return .optional(value)
-  }
-
-  static func ↓buildABear(_ components: Component...) -> Component {
-    return .array(components)
-  }
-}
-
-_ = ComponentBuilder()
-
-
protocol ↓Foo {}
-extension Foo {}
-
-
class ↓C<T> {}
-extension C<Int> {}
-
-
import Cocoa
-
-@NSApplicationMain
-final class AppDelegate: NSObject, NSApplicationDelegate {
-    func ↓appWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Cocoa
-
-final class ↓AppDelegate: NSObject, NSApplicationDelegate {
-    func applicationWillFinishLaunching(_ notification: Notification) {}
-    func applicationWillBecomeActive(_ notification: Notification) {}
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBOutlet var ↓bar: NSObject!
-}
-
-
import Foundation
-
-public final class Foo: NSObject {
-    @IBInspectable var ↓bar: String!
-}
-
-
import Foundation
-
-final class Foo: NSObject {}
-final class ↓Bar {
-    var ↓foo = Foo()
-}
-
- -
-
- - -
-
- - - diff --git a/unused_enumerated.html b/unused_enumerated.html deleted file mode 100644 index 3a009cec5..000000000 --- a/unused_enumerated.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - unused_enumerated Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Enumerated

- -

When the index or the item is not used, .enumerated() can be removed.

- -
    -
  • Identifier: unused_enumerated
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
for (idx, foo) in bar.enumerated() { }
-
-
for (_, foo) in bar.enumerated().something() { }
-
-
for (_, foo) in bar.something() { }
-
-
for foo in bar.enumerated() { }
-
-
for foo in bar { }
-
-
for (idx, _) in bar.enumerated().something() { }
-
-
for (idx, _) in bar.something() { }
-
-
for idx in bar.indices { }
-
-
for (section, (event, _)) in data.enumerated() {}
-
-
list.enumerated().map { idx, elem in "\(idx): \(elem)" }
-
-
list.enumerated().map { $0 + $1 }
-
-
list.enumerated().something().map { _, elem in elem }
-
-
list.enumerated().map { ($0.offset, $0.element) }
-
-
list.enumerated().map { ($0.0, $0.1) }
-
-
list.enumerated().map {
-    $1.enumerated().forEach { print($0, $1) }
-    return $0
-}
-
-

Triggering Examples

-
for (↓_, foo) in bar.enumerated() { }
-
-
for (↓_, foo) in abc.bar.enumerated() { }
-
-
for (↓_, foo) in abc.something().enumerated() { }
-
-
for (idx, ↓_) in bar.enumerated() { }
-
-
list.enumerated().map { idx, ↓_ in idx }
-
-
list.enumerated().map { ↓_, elem in elem }
-
-
list.↓enumerated().forEach { print($0) }
-
-
list.↓enumerated().map { $1 }
-
-
list.enumerated().map {
-    $1.↓enumerated().forEach { print($1) }
-    return $0
-}
-
-
list.↓enumerated().map {
-    $1.enumerated().forEach { print($0, $1) }
-    return 1
-}
-
- -
-
- - -
-
- - - diff --git a/unused_import.html b/unused_import.html deleted file mode 100644 index ea88a9c22..000000000 --- a/unused_import.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - unused_import Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Import

- -

All imported modules should be required to make the file compile

- -
    -
  • Identifier: unused_import
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: lint
  • -
  • Analyzer rule: Yes
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -require_explicit_imports - -false -
    -allowed_transitive_imports - -[] -
    -always_keep_imports - -[] -
  • -
-

Non Triggering Examples

-
import Dispatch // This is used
-dispatchMain()
-
-
@testable import Dispatch
-dispatchMain()
-
-
import Foundation
-@objc
-class A {}
-
-
import UnknownModule
-func foo(error: Swift.Error) {}
-
-
@_exported import UnknownModule
-
-
import Foundation
-let 👨‍👩‍👧‍👦 = #selector(NSArray.contains(_:))
-👨‍👩‍👧‍👦 == 👨‍👩‍👧‍👦
-
-

Triggering Examples

-
↓import Dispatch
-struct A {
-  static func dispatchMain() {}
-}
-A.dispatchMain()
-
-
↓import Foundation // This is unused
-struct A {
-  static func dispatchMain() {}
-}
-A.dispatchMain()
-↓import Dispatch
-
-
-
↓import Foundation
-dispatchMain()
-
-
↓import Foundation
-// @objc
-class A {}
-
-
↓import Foundation
-import UnknownModule
-func foo(error: Swift.Error) {}
-
-
↓import Swift
-↓import SwiftShims
-func foo(error: Swift.Error) {}
-
- -
-
- - -
-
- - - diff --git a/unused_optional_binding.html b/unused_optional_binding.html deleted file mode 100644 index 29fce5968..000000000 --- a/unused_optional_binding.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - unused_optional_binding Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Optional Binding

- -

Prefer != nil over let _ =

- -
    -
  • Identifier: unused_optional_binding
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -ignore_optional_try - -false -
  • -
-

Non Triggering Examples

-
if let bar = Foo.optionalValue {}
-
-
if let (_, second) = getOptionalTuple() {}
-
-
if let (_, asd, _) = getOptionalTuple(), let bar = Foo.optionalValue {}
-
-
if foo() { let _ = bar() }
-
-
if foo() { _ = bar() }
-
-
if case .some(_) = self {}
-
-
if let point = state.find({ _ in true }) {}
-
-

Triggering Examples

-
if let ↓_ = Foo.optionalValue {}
-
-
if let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {}
-
-
guard let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {}
-
-
if let (first, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let (first, _) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let (_, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {}
-
-
if let ↓(_, _, _) = getOptionalTuple(), let bar = Foo.optionalValue {}
-
-
func foo() { if let ↓_ = bar {} }
-
- -
-
- - -
-
- - - diff --git a/unused_setter_value.html b/unused_setter_value.html deleted file mode 100644 index a1b80df69..000000000 --- a/unused_setter_value.html +++ /dev/null @@ -1,479 +0,0 @@ - - - - unused_setter_value Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Unused Setter Value

- -

Setter value is not used

- -
    -
  • Identifier: unused_setter_value
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    set {
-        Persister.shared.aValue = newValue
-    }
-}
-
-
var aValue: String {
-    set {
-        Persister.shared.aValue = newValue
-    }
-    get {
-        return Persister.shared.aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    set(value) {
-        Persister.shared.aValue = value
-    }
-}
-
-
override var aValue: String {
- get {
-     return Persister.shared.aValue
- }
- set { }
-}
-
-

Triggering Examples

-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-    get {
-        return Persister.shared.aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        let newValue = Persister.shared.aValue
-        return newValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set(value) {
-        Persister.shared.aValue = aValue
-    }
-}
-
-
override var aValue: String {
-    get {
-        return Persister.shared.aValue
-    }
-    ↓set {
-        Persister.shared.aValue = aValue
-    }
-}
-
- -
-
- - -
-
- - - diff --git a/valid_ibinspectable.html b/valid_ibinspectable.html deleted file mode 100644 index c7fce5e1e..000000000 --- a/valid_ibinspectable.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - valid_ibinspectable Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Valid IBInspectable

- -

@IBInspectable should be applied to variables only, have its type explicit and be of a supported type

- -
    -
  • Identifier: valid_ibinspectable
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  @IBInspectable private var x: Int
-}
-
-
class Foo {
-  @IBInspectable private var x: String?
-}
-
-
class Foo {
-  @IBInspectable private var x: String!
-}
-
-
class Foo {
-  @IBInspectable private var count: Int = 0
-}
-
-
class Foo {
-  private var notInspectable = 0
-}
-
-
class Foo {
-  private let notInspectable: Int
-}
-
-
class Foo {
-  private let notInspectable: UInt8
-}
-
-
extension Foo {
-    @IBInspectable var color: UIColor {
-        set {
-            self.bar.textColor = newValue
-        }
-
-        get {
-            return self.bar.textColor
-        }
-    }
-}
-
-
class Foo {
-    @IBInspectable var borderColor: UIColor? = nil {
-        didSet {
-            updateAppearance()
-        }
-    }
-}
-
-

Triggering Examples

-
class Foo {
-  @IBInspectable private ↓let count: Int
-}
-
-
class Foo {
-  @IBInspectable private ↓var insets: UIEdgeInsets
-}
-
-
class Foo {
-  @IBInspectable private ↓var count = 0
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Int?
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Int!
-}
-
-
class Foo {
-  @IBInspectable private ↓var count: Optional<Int>
-}
-
-
class Foo {
-  @IBInspectable private ↓var x: Optional<String>
-}
-
- -
-
- - -
-
- - - diff --git a/vertical_parameter_alignment.html b/vertical_parameter_alignment.html deleted file mode 100644 index ac73069c2..000000000 --- a/vertical_parameter_alignment.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - vertical_parameter_alignment Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Parameter Alignment

- -

Function parameters should be aligned vertically if they’re in multiple lines in a declaration

- -
    -
  • Identifier: vertical_parameter_alignment
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary) -> [StyleViolation]
-
-
func foo(bar: Int)
-
-
func foo(bar: Int) -> String
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                      dictionary: SourceKittenDictionary)
-                      -> [StyleViolation]
-
-
func validateFunction(
-   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
-   dictionary: SourceKittenDictionary) -> [StyleViolation]
-
-
func validateFunction(
-   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
-   dictionary: SourceKittenDictionary
-) -> [StyleViolation]
-
-
func regex(_ pattern: String,
-           options: NSRegularExpression.Options = [.anchorsMatchLines,
-                                                   .dotMatchesLineSeparators]) -> NSRegularExpression
-
-
func foo(a: Void,
-         b: [String: String] =
-         [:]) {
-}
-
-
func foo(data: (size: CGSize,
-                identifier: String)) {}
-
-
func foo(data: Data,
-         @ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-
-
class A {
-    init(bar: Int)
-}
-
-
class A {
-    init(foo: Int,
-         bar: String)
-}
-
-

Triggering Examples

-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                  ↓dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
-                       ↓dictionary: SourceKittenDictionary) { }
-
-
func validateFunction(_ file: SwiftLintFile,
-                  ↓kind: SwiftDeclarationKind,
-                  ↓dictionary: SourceKittenDictionary) { }
-
-
func foo(data: Data,
-            ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-
-
class A {
-    init(data: Data,
-                ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
-}
-
- -
-
- - -
-
- - - diff --git a/vertical_parameter_alignment_on_call.html b/vertical_parameter_alignment_on_call.html deleted file mode 100644 index 164096b70..000000000 --- a/vertical_parameter_alignment_on_call.html +++ /dev/null @@ -1,478 +0,0 @@ - - - - vertical_parameter_alignment_on_call Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Parameter Alignment on Call

- -

Function parameters should be aligned vertically if they’re in multiple lines in a method call

- -
    -
  • Identifier: vertical_parameter_alignment_on_call
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
foo(param1: 1, param2: bar
-    param3: false, param4: true)
-
-
foo(param1: 1, param2: bar)
-
-
foo(param1: 1, param2: bar
-    param3: false,
-    param4: true)
-
-
foo(
-   param1: 1
-) { _ in }
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-}, completion: { _ in
-    self.hideLoading()
-})
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-},
-completion: { _ in
-    self.hideLoading()
-})
-
-
UIView.animate(withDuration: 0.4, animations: {
-    blurredImageView.alpha = 1
-} { _ in
-    self.hideLoading()
-}
-
-
foo(param1: 1, param2: { _ in },
-    param3: false, param4: true)
-
-
foo({ _ in
-       bar()
-   },
-   completion: { _ in
-       baz()
-   }
-)
-
-
foo(param1: 1, param2: [
-   0,
-   1
-], param3: 0)
-
-
myFunc(foo: 0,
-       bar: baz == 0)
-
-
UIViewPropertyAnimator.runningPropertyAnimator(
-    withDuration: 2.0,
-    delay: 0.0,
-    options: [.curveEaseIn]
-) {
-    // animations
-} completion: { _ in
-    // completion
-}
-
-

Triggering Examples

-
foo(param1: 1, param2: bar,
-                ↓param3: false, param4: true)
-
-
foo(param1: 1, param2: bar,
- ↓param3: false, param4: true)
-
-
foo(param1: 1, param2: bar,
-       ↓param3: false,
-       ↓param4: true)
-
-
foo(param1: 1,
-       ↓param2: { _ in })
-
-
foo(param1: 1,
-    param2: { _ in
-}, param3: 2,
- ↓param4: 0)
-
-
foo(param1: 1, param2: { _ in },
-       ↓param3: false, param4: true)
-
-
myFunc(foo: 0,
-        ↓bar: baz == 0)
-
-
myFunc(foo: 0, bar:
-        baz == 0, ↓baz: true)
-
- -
-
- - -
-
- - - diff --git a/vertical_whitespace.html b/vertical_whitespace.html deleted file mode 100644 index 31134489a..000000000 --- a/vertical_whitespace.html +++ /dev/null @@ -1,431 +0,0 @@ - - - - vertical_whitespace Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace

- -

Limit vertical whitespace to a single empty line.

- -
    -
  • Identifier: vertical_whitespace
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -max_empty_lines - -1 -
  • -
-

Non Triggering Examples

-
let abc = 0
-
-
-
let abc = 0
-
-
-
-
/* bcs 
-
-
-
-*/
-
-
// bca 
-
-
-
-

Triggering Examples

-
let aaaa = 0
-
-
-
-
-
struct AAAA {}
-
-
-
-
-
-
class BBBB {}
-
-
-
-
- -
-
- - -
-
- - - diff --git a/vertical_whitespace_between_cases.html b/vertical_whitespace_between_cases.html deleted file mode 100644 index 82e73d19a..000000000 --- a/vertical_whitespace_between_cases.html +++ /dev/null @@ -1,477 +0,0 @@ - - - - vertical_whitespace_between_cases Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace between Cases

- -

Include a single empty line between switch cases

- -
    -
  • Identifier: vertical_whitespace_between_cases
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
    switch x {
-    case .valid:
-        print("multiple ...")
-        print("... lines")
-
-    case .invalid:
-        print("multiple ...")
-        print("... lines")
-    }
-
-
    switch x {
-    case .valid:
-        print("x is valid")
-
-    case .invalid:
-        print("x is invalid")
-    }
-
-
    switch x {
-    case 0..<5:
-        print("x is valid")
-
-    default:
-        print("x is invalid")
-    }
-
-
switch x {
-
-case 0..<5:
-    print("x is low")
-
-case 5..<10:
-    print("x is high")
-
-default:
-    print("x is invalid")
-
-}
-
-
switch x {
-case 0..<5:
-    print("x is low")
-
-case 5..<10:
-    print("x is high")
-
-default:
-    print("x is invalid")
-}
-
-
switch x {
-case 0..<5: print("x is low")
-case 5..<10: print("x is high")
-default: print("x is invalid")
-}
-
-
switch x {    
-case 1:    
-    print("one")    
-
-default:    
-    print("not one")    
-}    
-
-

Triggering Examples

-
    switch x {
-    case .valid:
-        print("multiple ...")
-        print("... lines")
-↓    case .invalid:
-        print("multiple ...")
-        print("... lines")
-    }
-
-
    switch x {
-    case .valid:
-        print("x is valid")
-↓    case .invalid:
-        print("x is invalid")
-    }
-
-
    switch x {
-    case 0..<5:
-        print("x is valid")
-↓    default:
-        print("x is invalid")
-    }
-
- -
-
- - -
-
- - - diff --git a/vertical_whitespace_closing_braces.html b/vertical_whitespace_closing_braces.html deleted file mode 100644 index d49c02405..000000000 --- a/vertical_whitespace_closing_braces.html +++ /dev/null @@ -1,508 +0,0 @@ - - - - vertical_whitespace_closing_braces Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace before Closing Braces

- -

Don’t include vertical whitespace (empty line) before closing braces

- -
    -
  • Identifier: vertical_whitespace_closing_braces
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -only_enforce_before_trivial_lines - -false -
  • -
-

Non Triggering Examples

-
[
-1,
-2,
-3
-]
-
-
do {
-  print("x is 5")
-}
-
-
do {
-  print("x is 5")
-}
-
-
do {
-  print("x is 5")
-}
-
-
foo(
-    x: 5,
-    y:6
-)
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-}
-
-
print([
-  1
-])
-
-
print([foo {
-  var sum = 0
-  for i in 1...5 { sum += i }
-  return sum
-
-}, foo {
-  var mul = 1
-  for i in 1...5 { mul *= i }
-  return mul
-}])
-
-
[1, 2].map { $0 }.filter { true }
-
-
[1, 2].map { $0 }.filter { num in true }
-
-
/*
-    class X {
-
-        let x = 5
-
-    }
-*/
-
-

Triggering Examples

-
[
-1,
-2,
-3
-↓
-]
-
-
do {
-  print("x is 5")
-↓
-
-}
-
-
do {
-  print("x is 5")
-↓
-
-}
-
-
do {
-  print("x is 5")
-↓
-}
-
-
foo(
-    x: 5,
-    y:6
-↓
-)
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-↓
-}
-
-
print([
-  1
-↓
-])
-
-
print([foo {
-  var sum = 0
-  for i in 1...5 { sum += i }
-  return sum
-
-}, foo {
-  var mul = 1
-  for i in 1...5 { mul *= i }
-  return mul
-↓
-}])
-
- -
-
- - -
-
- - - diff --git a/vertical_whitespace_opening_braces.html b/vertical_whitespace_opening_braces.html deleted file mode 100644 index 261c44d5d..000000000 --- a/vertical_whitespace_opening_braces.html +++ /dev/null @@ -1,504 +0,0 @@ - - - - vertical_whitespace_opening_braces Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Vertical Whitespace after Opening Braces

- -

Don’t include vertical whitespace (empty line) after opening braces

- -
    -
  • Identifier: vertical_whitespace_opening_braces
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
/*
-    class X {
-
-        let x = 5
-
-    }
-*/
-
-
// [1, 2].map { $0 }.filter { num in true }
-
-
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
-    guard let img = image else { return }
-}
-
-
[
-1,
-2,
-3
-]
-
-
[1, 2].map { $0 }.filter { num in true }
-
-
[1, 2].map { $0 }.foo()
-
-
class X {
-  struct Y {
-    class Z {
-    }
-  }
-}
-
-
foo(
-  x: 5,
-  y:6
-)
-
-
foo({ }) { _ in
-  self.dismiss(animated: false, completion: {
-  })
-}
-
-
func foo() {
-  run(5) { x in
-    print(x)
-  }
-}
-
-
if x == 5 {
-  print("x is 5")
-}
-
-
if x == 5 {
-  print("x is 5")
-}
-
-
struct MyStruct {
-  let x = 5
-}
-
-

Triggering Examples

-
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
-↓
-    guard let img = image else { return }
-}
-
-
[
-↓
-1,
-2,
-3
-]
-
-
class X {
-  struct Y {
-↓
-    class Z {
-    }
-  }
-}
-
-
foo(
-↓
-  x: 5,
-  y:6
-)
-
-
foo({ }) { _ in
-↓
-  self.dismiss(animated: false, completion: {
-  })
-}
-
-
func foo() {
-↓
-  run(5) { x in
-    print(x)
-  }
-}
-
-
if x == 5 {
-↓
-
-  print("x is 5")
-}
-
-
if x == 5 {
-↓
-  print("x is 5")
-}
-
-
struct MyStruct {
-↓
-  let x = 5
-}
-
- -
-
- - -
-
- - - diff --git a/void_function_in_ternary.html b/void_function_in_ternary.html deleted file mode 100644 index c3b204713..000000000 --- a/void_function_in_ternary.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - void_function_in_ternary Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Void Function in Ternary

- -

Using ternary to call Void functions should be avoided

- -
    -
  • Identifier: void_function_in_ternary
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.1.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let result = success ? foo() : bar()
-
-
if success {
-    askQuestion()
-} else {
-    exit()
-}
-
-
var price: Double {
-    return hasDiscount ? calculatePriceWithDiscount() : calculateRegularPrice()
-}
-
-
foo(x == 2 ? a() : b())
-
-
chevronView.image = collapsed ? .icon(.mediumChevronDown) : .icon(.mediumChevronUp)
-
-
array.map { elem in
-    elem.isEmpty() ? .emptyValue() : .number(elem)
-}
-
-
func compute(data: [Int]) -> Int {
-    data.isEmpty ? 0 : expensiveComputation(data)
-}
-
-
var value: Int {
-    mode == .fast ? fastComputation() : expensiveComputation()
-}
-
-
var value: Int {
-    get {
-        mode == .fast ? fastComputation() : expensiveComputation()
-    }
-}
-
-
subscript(index: Int) -> Int {
-    get {
-        index == 0 ? defaultValue() : compute(index)
-    }
-
-
subscript(index: Int) -> Int {
-    index == 0 ? defaultValue() : compute(index)
-
-

Triggering Examples

-
success ↓? askQuestion() : exit()
-
-
perform { elem in
-    elem.isEmpty() ↓? .emptyValue() : .number(elem)
-    return 1
-}
-
-
DispatchQueue.main.async {
-    self.sectionViewModels[section].collapsed.toggle()
-    self.sectionViewModels[section].collapsed
-        ↓? self.tableView.deleteRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
-        : self.tableView.insertRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
-    self.tableView.scrollToRow(at: IndexPath(row: NSNotFound, section: section), at: .top, animated: true)
-}
-
-
subscript(index: Int) -> Int {
-    index == 0 ↓? something() : somethingElse(index)
-    return index
-
-
var value: Int {
-    mode == .fast ↓? something() : somethingElse()
-    return 0
-}
-
-
var value: Int {
-    get {
-        mode == .fast ↓? something() : somethingElse()
-        return 0
-    }
-}
-
-
subscript(index: Int) -> Int {
-    get {
-        index == 0 ↓? something() : somethingElse(index)
-        return index
-    }
-
- -
-
- - -
-
- - - diff --git a/void_return.html b/void_return.html deleted file mode 100644 index 41f5963ba..000000000 --- a/void_return.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - void_return Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Void Return

- -

Prefer -> Void over -> ()

- -
    -
  • Identifier: void_return
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: Yes
  • -
  • Kind: style
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
let abc: () -> Void = {}
-
-
let abc: () -> (VoidVoid) = {}
-
-
func foo(completion: () -> Void)
-
-
let foo: (ConfigurationTests) -> () throws -> Void
-
-
let foo: (ConfigurationTests) ->   () throws -> Void
-
-
let foo: (ConfigurationTests) ->() throws -> Void
-
-
let foo: (ConfigurationTests) -> () -> Void
-
-
let foo: () -> () async -> Void
-
-
let foo: () -> () async throws -> Void
-
-
let foo: () -> () async -> Void
-
-
func foo() -> () async throws -> Void {}
-
-
func foo() async throws -> () async -> Void { return {} }
-
-
func foo() -> () async -> Int { 1 }
-
-

Triggering Examples

-
let abc: () -> ↓() = {}
-
-
let abc: () -> ↓(Void) = {}
-
-
let abc: () -> ↓(   Void ) = {}
-
-
func foo(completion: () -> ↓())
-
-
func foo(completion: () -> ↓(   ))
-
-
func foo(completion: () -> ↓(Void))
-
-
let foo: (ConfigurationTests) -> () throws -> ↓()
-
-
func foo() async -> ↓()
-
-
func foo() async throws -> ↓()
-
- -
-
- - -
-
- - - diff --git a/weak_delegate.html b/weak_delegate.html deleted file mode 100644 index beed920d7..000000000 --- a/weak_delegate.html +++ /dev/null @@ -1,471 +0,0 @@ - - - - weak_delegate Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Weak Delegate

- -

Delegates should be weak to avoid reference cycles

- -
    -
  • Identifier: weak_delegate
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
class Foo {
-  weak var delegate: SomeProtocol?
-}
-
-
class Foo {
-  weak var someDelegate: SomeDelegateProtocol?
-}
-
-
class Foo {
-  weak var delegateScroll: ScrollDelegate?
-}
-
-
class Foo {
-  var scrollHandler: ScrollDelegate?
-}
-
-
func foo() {
-  var delegate: SomeDelegate
-}
-
-
class Foo {
-  var delegateNotified: Bool?
-}
-
-
protocol P {
- var delegate: AnyObject? { get set }
-}
-
-
class Foo {
- protocol P {
- var delegate: AnyObject? { get set }
-}
-}
-
-
class Foo {
- var computedDelegate: ComputedDelegate {
- return bar() 
-} 
-}
-
-
class Foo {
-    var computedDelegate: ComputedDelegate {
-        get {
-            return bar()
-        }
-   }
-
-
struct Foo {
- @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
-}
-
-
struct Foo {
- @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
-}
-
-
struct Foo {
- @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var extensionDelegate 
-}
-
-
class Foo {
-    func makeDelegate() -> SomeDelegate {
-        let delegate = SomeDelegate()
-        return delegate
-    }
-}
-
-

Triggering Examples

-
class Foo {
-  ↓var delegate: SomeProtocol?
-}
-
-
class Foo {
-  ↓var scrollDelegate: ScrollDelegate?
-}
-
-
class Foo {
-    ↓var delegate: SomeProtocol? {
-        didSet {
-            print("Updated delegate")
-        }
-   }
-
- -
-
- - -
-
- - - diff --git a/xct_specific_matcher.html b/xct_specific_matcher.html deleted file mode 100644 index daf18ef25..000000000 --- a/xct_specific_matcher.html +++ /dev/null @@ -1,578 +0,0 @@ - - - - xct_specific_matcher Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

XCTest Specific Matcher

- -

Prefer specific XCTest matchers over XCTAssertEqual and XCTAssertNotEqual.

- -
    -
  • Identifier: xct_specific_matcher
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - - - - - -
    KeyValue
    -severity - -warning -
    -matchers - -[one-argument-asserts, two-argument-asserts] -
  • -
-

Non Triggering Examples

-
XCTAssert(foo
-
-
XCTAssertFalse(foo)
-
-
XCTAssertTrue(foo)
-
-
XCTAssertNil(foo)
-
-
XCTAssertNotNil(foo)
-
-
XCTAssertEqual(foo, 2)
-
-
XCTAssertNotEqual(foo, "false")
-
-
XCTAssertEqual(foo, [1, 2, 3, true])
-
-
XCTAssertEqual(foo, [1, 2, 3, false])
-
-
XCTAssertEqual(foo, [1, 2, 3, nil])
-
-
XCTAssertEqual(foo, [true, nil, true, nil])
-
-
XCTAssertEqual([1, 2, 3, true], foo)
-
-
XCTAssertEqual([1, 2, 3, false], foo)
-
-
XCTAssertEqual([1, 2, 3, nil], foo)
-
-
XCTAssertEqual([true, nil, true, nil], foo)
-
-
XCTAssertEqual(2, foo)
-
-
XCTAssertNotEqual("false"), foo)
-
-
XCTAssertEqual(false, foo?.bar)
-
-
XCTAssertEqual(true, foo?.bar)
-
-
XCTAssert(    foo  )
-
-
XCTAssertFalse(  foo  )
-
-
XCTAssertTrue(  foo  )
-
-
XCTAssertNil(  foo  )
-
-
XCTAssertNotNil(  foo  )
-
-
XCTAssertEqual(  foo  , 2  )
-
-
XCTAssertNotEqual(  foo, "false")
-
-
XCTAssertEqual(foo?.bar, false)
-
-
XCTAssertEqual(foo?.bar, true)
-
-
XCTAssertNil(foo?.bar)
-
-
XCTAssertNotNil(foo?.bar)
-
-
XCTAssertEqual(foo?.bar, 2)
-
-
XCTAssertNotEqual(foo?.bar, "false")
-
-
XCTAssertEqual(foo?.bar, toto())
-
-
XCTAssertEqual(foo?.bar, .toto(.zoo))
-
-
XCTAssertEqual(toto(), foo?.bar)
-
-
XCTAssertEqual(.toto(.zoo), foo?.bar)
-
-
XCTAssert(foo.self == bar)
-
-
XCTAssertTrue(type(of: foo) != Int.self)
-
-
XCTAssertTrue(a == (1, 3, 5)
-
-

Triggering Examples

-
↓XCTAssertEqual(foo, true)
-
-
↓XCTAssertEqual(foo, false)
-
-
↓XCTAssertEqual(foo, nil)
-
-
↓XCTAssertNotEqual(foo, true)
-
-
↓XCTAssertNotEqual(foo, false)
-
-
↓XCTAssertNotEqual(foo, nil)
-
-
↓XCTAssertEqual(true, foo)
-
-
↓XCTAssertEqual(false, foo)
-
-
↓XCTAssertEqual(nil, foo)
-
-
↓XCTAssertNotEqual(true, foo)
-
-
↓XCTAssertNotEqual(false, foo)
-
-
↓XCTAssertNotEqual(nil, foo)
-
-
↓XCTAssertEqual(foo, true, "toto")
-
-
↓XCTAssertEqual(foo, false, "toto")
-
-
↓XCTAssertEqual(foo, nil, "toto")
-
-
↓XCTAssertNotEqual(foo, true, "toto")
-
-
↓XCTAssertNotEqual(foo, false, "toto")
-
-
↓XCTAssertNotEqual(foo, nil, "toto")
-
-
↓XCTAssertEqual(true, foo, "toto")
-
-
↓XCTAssertEqual(false, foo, "toto")
-
-
↓XCTAssertEqual(nil, foo, "toto")
-
-
↓XCTAssertNotEqual(true, foo, "toto")
-
-
↓XCTAssertNotEqual(false, foo, "toto")
-
-
↓XCTAssertNotEqual(nil, foo, "toto")
-
-
↓XCTAssertEqual(foo,true)
-
-
↓XCTAssertEqual( foo , false )
-
-
↓XCTAssertEqual(  foo  ,  nil  )
-
-
↓XCTAssertEqual(true, [1, 2, 3, true].hasNumbers())
-
-
↓XCTAssertEqual([1, 2, 3, true].hasNumbers(), true)
-
-
↓XCTAssertEqual(foo?.bar, nil)
-
-
↓XCTAssertNotEqual(foo?.bar, nil)
-
-
↓XCTAssertEqual(nil, true)
-
-
↓XCTAssertEqual(nil, false)
-
-
↓XCTAssertEqual(true, nil)
-
-
↓XCTAssertEqual(false, nil)
-
-
↓XCTAssertEqual(nil, nil)
-
-
↓XCTAssertEqual(true, true)
-
-
↓XCTAssertEqual(false, false)
-
-
↓XCTAssert(foo == bar)
-
-
↓XCTAssertTrue(   foo  ==   bar  )
-
-
↓XCTAssertFalse(1 == foo)
-
-
↓XCTAssert(foo == bar, "toto")
-
-
↓XCTAssert(foo != bar)
-
-
↓XCTAssertTrue(   foo  !=   bar  )
-
-
↓XCTAssertFalse(1 != foo)
-
-
↓XCTAssert(foo != bar, "toto")
-
-
↓XCTAssert(  foo   ==  nil)
-
-
↓XCTAssert(nil == foo
-
-
↓XCTAssertTrue(  foo   !=  nil)
-
-
↓XCTAssertFalse(nil != foo
-
-
↓XCTAssert(foo == nil, "toto")
-
- -
-
- - -
-
- - - diff --git a/xctfail_message.html b/xctfail_message.html deleted file mode 100644 index 735f6f746..000000000 --- a/xctfail_message.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - xctfail_message Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

XCTFail Message

- -

An XCTFail call should include a description of the assertion

- -
    -
  • Identifier: xctfail_message
  • -
  • Enabled by default: Yes
  • -
  • Supports autocorrection: No
  • -
  • Kind: idiomatic
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
func testFoo() {
-  XCTFail("bar")
-}
-
-
func testFoo() {
-  XCTFail(bar)
-}
-
-

Triggering Examples

-
func testFoo() {
-  ↓XCTFail()
-}
-
-
func testFoo() {
-  ↓XCTFail("")
-}
-
- -
-
- - -
-
- - - diff --git a/yoda_condition.html b/yoda_condition.html deleted file mode 100644 index df6eec425..000000000 --- a/yoda_condition.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - yoda_condition Reference - - - - - - - - - - - - - - - -
-

- - SwiftLintCore 0.54.0 Docs - - (100% documented) -

- -
-
- -
-
- -

- - GitHub - View on GitHub - -

- -

- - Dash - Install in Dash - -

-
- - - -
- -
- -
-
- -

Yoda Condition

- -

The constant literal should be placed on the right-hand side of the comparison operator

- -
    -
  • Identifier: yoda_condition
  • -
  • Enabled by default: No
  • -
  • Supports autocorrection: No
  • -
  • Kind: lint
  • -
  • Analyzer rule: No
  • -
  • Minimum Swift compiler version: 5.0.0
  • -
  • Default configuration: - - - - - - - - - - -
    KeyValue
    -severity - -warning -
  • -
-

Non Triggering Examples

-
if foo == 42 {}
-
-
if foo <= 42.42 {}
-
-
guard foo >= 42 else { return }
-
-
guard foo != "str str" else { return }
-
-
while foo < 10 { }
-
-
while foo > 1 { }
-
-
while foo + 1 == 2 {}
-
-
if optionalValue?.property ?? 0 == 2 {}
-
-
if foo == nil {}
-
-
if flags & 1 == 1 {}
-
-

Triggering Examples

-
if ↓42 == foo {}
-
-
if ↓42.42 >= foo {}
-
-
guard ↓42 <= foo else { return }
-
-
guard ↓"str str" != foo else { return }
-
-
while ↓10 > foo { }
-
-
while ↓1 < foo { }
-
-
if ↓nil == foo {}
-
-
while ↓1 > i + 5 {}
-
-
if ↓200 <= i && i <= 299 || ↓600 <= i {}
-
- -
-
- - -
-
- - -