Structures
The following structures are available globally.
-
A basic stack type implementing the LIFO principle - only the last inserted element can be accessed and removed.
See moreDeclaration
Swift
public struct Stack<Element>extension Stack: Sequenceextension Stack: CustomDebugStringConvertible where Element: CustomDebugStringConvertible -
A set of violations that can be used to filter newly detected violations.
See moreDeclaration
Swift
public struct Baseline : Equatable -
A rule configuration that allows to disable (
See moreoff) an option of a rule or specify its severity level in which case it’s active.Declaration
Swift
public struct ChildOptionSeverityConfiguration<Parent: Rule>: RuleConfiguration, AcceptableByConfigurationElement, Sendable -
A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.
See moreDeclaration
Swift
public struct Command : Equatable -
A value describing a SwiftLint violation that was corrected.
See moreDeclaration
Swift
public struct Correction : Equatable, Sendable -
Captures code and context information for an example of a triggering or non-triggering style
See moreDeclaration
Swift
public struct Example : Sendableextension Example: Hashableextension Example: Comparable -
The placement of a segment of Swift in a collection of source files.
See moreDeclaration
Swift
public struct Location : CustomStringConvertible, Comparable, Codable, Sendable -
A contiguous region of Swift source code.
See moreDeclaration
Swift
public struct Region : Equatable, Sendable -
Description of a rule configuration.
See moreDeclaration
Swift
public struct RuleConfigurationDescription : Equatable, Sendableextension RuleConfigurationDescription: Documentable -
A single option of a
See moreRuleConfigurationDescription.Declaration
Swift
public struct RuleConfigurationOption : Equatable, Sendableextension RuleConfigurationOption: Documentable
-
A result builder creating configuration descriptions.
Declaration
Swift
@resultBuilder public struct RuleConfigurationDescriptionBuilder
-
A single parameter of a rule configuration.
Apply it to a simple (e.g. boolean) property like
@ConfigurationElement var property = trueto 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.myOptionis going to be translated intomy_optionin the.swiftlint.ymlconfiguration file.This mechanism may be overwritten with an explicitly set key:
@ConfigurationElement(key: "foo_bar") var property = trueIf the wrapped element is an
InlinableOptionType, there are three ways to represent it in the documentation:- 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 - It can be represented as a separate nested configuration. In this case, it must not have set the
inlineflag totrue. E.g.swift @ConfigurationElement var levels = SeverityLevelsConfiguration(warning: 1, error: 2)will have a nested configuration section:levels: warning: 1 error: 2 - As mentioned in the beginning, the implicit key inference mechanism can be overruled by specifying a
keyas in:swift @ConfigurationElement(key: "foo") var levels = SeverityLevelsConfiguration(warning: 1, error: 2)It will appear in the documentation as:foo: warning: 1 error: 2
Declaration
Swift
@propertyWrapper public struct ConfigurationElement<T> : Equatable, Sendable where T : Equatable, T : Sendable, T : AcceptableByConfigurationElement - It can be inlined into the parent configuration. For that, add the parameter
-
A rule configuration that allows specifying the desired severity level for violations.
See moreDeclaration
Swift
public struct SeverityConfiguration<Parent> : SeverityBasedRuleConfiguration, InlinableOptionType, Sendable where Parent : Rule -
A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.
See moreDeclaration
Swift
public struct RuleDescription : Equatable, Sendable -
A list of available SwiftLint rules.
See moreDeclaration
Swift
public struct RuleListextension RuleList: Equatable -
A configuration parameter for rules.
See moreDeclaration
Swift
@preconcurrency public struct RuleParameter<T> : Equatable, Sendable where T : Equatable, T : Sendable -
A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.
See moreDeclaration
Swift
public struct StyleViolation : CustomStringConvertible, Codable, Hashable -
Represents a Swift file’s syntax information.
See moreDeclaration
Swift
public struct SwiftLintSyntaxMap -
A SwiftLint-aware Swift syntax token.
See moreDeclaration
Swift
public struct SwiftLintSyntaxToken -
A value describing the version of the Swift compiler.
See moreDeclaration
Swift
public struct SwiftVersion : RawRepresentable, Codable, VersionComparable, Sendable -
A violation produced by
See moreViolationsSyntaxVisitors.Declaration
Swift
public struct ReasonedRuleViolation : Comparable, Hashable -
A rule configuration used for defining custom rules in yaml.
See moreDeclaration
Swift
public struct RegexConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration, Hashable, CacheDescriptionProvider, InlinableOptionType -
A rule configuration that allows specifying thresholds for
See morewarninganderrorseverities.Declaration
Swift
public struct SeverityLevelsConfiguration<Parent> : RuleConfiguration, InlinableOptionType, Sendable where Parent : Ruleextension SeverityLevelsConfiguration: SeverityLevelsBasedRuleConfiguration
View on GitHub
Install in Dash
Structures Reference