mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
859 lines
46 KiB
HTML
859 lines
46 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<title>ConfigurationElement Structure Reference</title>
|
||
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
|
||
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
|
||
<meta charset="utf-8">
|
||
<script src="../js/jquery.min.js" defer></script>
|
||
<script src="../js/jazzy.js" defer></script>
|
||
|
||
<script src="../js/lunr.min.js" defer></script>
|
||
<script src="../js/typeahead.jquery.js" defer></script>
|
||
<script src="../js/jazzy.search.js" defer></script>
|
||
</head>
|
||
<body>
|
||
|
||
<a name="//apple_ref/swift/Struct/ConfigurationElement" class="dashAnchor"></a>
|
||
|
||
<a title="ConfigurationElement Structure Reference"></a>
|
||
|
||
<header class="header">
|
||
<p class="header-col header-col--primary">
|
||
<a class="header-link" href="../index.html">
|
||
SwiftLintCore 0.57.1 Docs
|
||
</a>
|
||
(100% documented)
|
||
</p>
|
||
|
||
<div class="header-col--secondary">
|
||
<form role="search" action="../search.json">
|
||
<input type="text" placeholder="Search documentation" data-typeahead>
|
||
</form>
|
||
</div>
|
||
|
||
<p class="header-col header-col--secondary">
|
||
<a class="header-link" href="https://github.com/realm/SwiftLint">
|
||
<img class="header-icon" src="../img/gh.png" alt="GitHub"/>
|
||
View on GitHub
|
||
</a>
|
||
</p>
|
||
|
||
<p class="header-col header-col--secondary">
|
||
<a class="header-link" href="dash-feed://https%3A%2F%2Frealm.github.io%2FSwiftLint%2Fdocsets%2FSwiftLintCore.xml">
|
||
<img class="header-icon" src="../img/dash.png" alt="Dash"/>
|
||
Install in Dash
|
||
</a>
|
||
</p>
|
||
</header>
|
||
|
||
<p class="breadcrumbs">
|
||
<a class="breadcrumb" href="../index.html">SwiftLintCore</a>
|
||
<img class="carat" src="../img/carat.png" alt=""/>
|
||
<a class="breadcrumb" href="../Structs.html">Structures</a>
|
||
<img class="carat" src="../img/carat.png" alt=""/>
|
||
ConfigurationElement Structure Reference
|
||
</p>
|
||
|
||
<div class="content-wrapper">
|
||
<nav class="navigation">
|
||
<ul class="nav-groups">
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Rules.html">Rules</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../rule-directory.html">Rule Directory</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Classes.html">Classes</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/BodyLengthRuleVisitor.html">BodyLengthRuleVisitor</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/BodyLengthRuleVisitor/Kind.html">– Kind</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/CodeBlockVisitor.html">CodeBlockVisitor</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/CodeIndentingRewriter.html">CodeIndentingRewriter</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/CodeIndentingRewriter/IndentationStyle.html">– IndentationStyle</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/DeclaredIdentifiersTrackingVisitor.html">DeclaredIdentifiersTrackingVisitor</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/RuleRegistry.html">RuleRegistry</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/RuleStorage.html">RuleStorage</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/SwiftLintFile.html">SwiftLintFile</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/ViolationsSyntaxRewriter.html">ViolationsSyntaxRewriter</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Classes/ViolationsSyntaxVisitor.html">ViolationsSyntaxVisitor</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/AccessControlLevel.html">AccessControlLevel</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/IdentifierDeclaration.html">IdentifierDeclaration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/Issue.html">Issue</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/OptionType.html">OptionType</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/RuleIdentifier.html">RuleIdentifier</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/RuleKind.html">RuleKind</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/RuleListError.html">RuleListError</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/SwiftExpressionKind.html">SwiftExpressionKind</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Enums/ViolationSeverity.html">ViolationSeverity</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Array.html">Array</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Bool.html">Bool</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Double.html">Double</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Int.html">Int</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Optional.html">Optional</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/Set.html">Set</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Extensions/String.html">String</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/ASTRule.html">ASTRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/AcceptableByConfigurationElement.html">AcceptableByConfigurationElement</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/AnalyzerRule.html">AnalyzerRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols.html#/s:13SwiftLintCore17AnyCollectingRuleP">AnyCollectingRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/CacheDescriptionProvider.html">CacheDescriptionProvider</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/CollectingRule.html">CollectingRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/CorrectableRule.html">CorrectableRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/Documentable.html">Documentable</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols.html#/s:13SwiftLintCore9OptInRuleP">OptInRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/Rule.html">Rule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/RuleConfiguration.html">RuleConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/SeverityBasedRuleConfiguration.html">SeverityBasedRuleConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols.html#/s:13SwiftLintCore17SourceKitFreeRuleP">SourceKitFreeRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/SubstitutionCorrectableRule.html">SubstitutionCorrectableRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/SwiftSyntaxCorrectableRule.html">SwiftSyntaxCorrectableRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/SwiftSyntaxRule.html">SwiftSyntaxRule</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Protocols/VersionComparable.html">VersionComparable</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Structs.html">Structures</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Baseline.html">Baseline</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/ChildOptionSeverityConfiguration.html">ChildOptionSeverityConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Command.html">Command</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Command/Action.html">– Action</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Command/Modifier.html">– Modifier</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/ConfigurationElement.html">ConfigurationElement</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/ConfigurationElement/DeprecationNotice.html">– DeprecationNotice</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Correction.html">Correction</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Example.html">Example</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Location.html">Location</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/ReasonedRuleViolation.html">ReasonedRuleViolation</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/ReasonedRuleViolation/ViolationCorrection.html">– ViolationCorrection</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RegexConfiguration.html">RegexConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Region.html">Region</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RuleConfigurationDescription.html">RuleConfigurationDescription</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs.html#/s:13SwiftLintCore35RuleConfigurationDescriptionBuilderV">RuleConfigurationDescriptionBuilder</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RuleConfigurationOption.html">RuleConfigurationOption</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RuleDescription.html">RuleDescription</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RuleList.html">RuleList</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/RuleParameter.html">RuleParameter</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/SeverityConfiguration.html">SeverityConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/SeverityLevelsConfiguration.html">SeverityLevelsConfiguration</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/Stack.html">Stack</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/StyleViolation.html">StyleViolation</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/SwiftLintSyntaxMap.html">SwiftLintSyntaxMap</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/SwiftLintSyntaxToken.html">SwiftLintSyntaxToken</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Structs/SwiftVersion.html">SwiftVersion</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="nav-group-name">
|
||
<a class="nav-group-name-link" href="../Macros.html">Macros</a>
|
||
<ul class="nav-group-tasks">
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Macros.html#/s:13SwiftLintCore32AcceptableByConfigurationElementyycfm">AcceptableByConfigurationElement()</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Macros.html#/s:13SwiftLintCore16AutoConfigParseryycfm">AutoConfigParser()</a>
|
||
</li>
|
||
<li class="nav-group-task">
|
||
<a class="nav-group-task-link" href="../Macros.html#/s:13SwiftLintCore0A10SyntaxRule15foldExpressions16explicitRewriterySb_Sbtcfm">SwiftSyntaxRule(foldExpressions:explicitRewriter:)</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
<article class="main-content">
|
||
|
||
<section class="section">
|
||
<div class="section-content top-matter">
|
||
<h1>ConfigurationElement</h1>
|
||
<div class="declaration">
|
||
<div class="language">
|
||
|
||
<pre class="highlight swift"><code><span class="kd">@propertyWrapper</span>
|
||
<span class="kd">public</span> <span class="kd">struct</span> <span class="kt">ConfigurationElement</span><span class="o"><</span><span class="kt">T</span><span class="o">></span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">Sendable</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">Sendable</span><span class="p">,</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/AcceptableByConfigurationElement.html">AcceptableByConfigurationElement</a></span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<p>A single parameter of a rule configuration.</p>
|
||
|
||
<p>Apply it to a simple (e.g. boolean) property like</p>
|
||
<pre class="highlight swift"><code><span class="kd">@ConfigurationElement</span>
|
||
<span class="k">var</span> <span class="nv">property</span> <span class="o">=</span> <span class="kc">true</span>
|
||
</code></pre>
|
||
|
||
<p>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 <code>property</code>. CamelCase names will translated into snake_case, i.e. <code>myOption</code> is going to be
|
||
translated into <code>my_option</code> in the <code>.swiftlint.yml</code> configuration file.</p>
|
||
|
||
<p>This mechanism may be overwritten with an explicitly set key:</p>
|
||
<pre class="highlight swift"><code><span class="kd">@ConfigurationElement</span><span class="p">(</span><span class="nv">key</span><span class="p">:</span> <span class="s">"foo_bar"</span><span class="p">)</span>
|
||
<span class="k">var</span> <span class="nv">property</span> <span class="o">=</span> <span class="kc">true</span>
|
||
</code></pre>
|
||
|
||
<p>If the wrapped element is an <code><a href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a></code>, there are three ways to represent it in the documentation:</p>
|
||
|
||
<ol>
|
||
<li>It can be inlined into the parent configuration. For that, add the parameter <code>inline: true</code>. E.g.
|
||
<code>swift
|
||
@ConfigurationElement(inline: true)
|
||
var levels = SeverityLevelsConfiguration(warning: 1, error: 2)
|
||
</code>
|
||
will be documented as a linear list:
|
||
<code>
|
||
warning: 1
|
||
error: 2
|
||
</code></li>
|
||
<li>It can be represented as a separate nested configuration. In this case, it must not have set the <code>inline</code> flag to
|
||
<code>true</code>. E.g.
|
||
<code>swift
|
||
@ConfigurationElement
|
||
var levels = SeverityLevelsConfiguration(warning: 1, error: 2)
|
||
</code>
|
||
will have a nested configuration section:
|
||
<code>
|
||
levels: warning: 1
|
||
error: 2
|
||
</code></li>
|
||
<li>As mentioned in the beginning, the implicit key inference mechanism can be overruled by specifying a <code>key</code> as in:
|
||
<code>swift
|
||
@ConfigurationElement(key: "foo")
|
||
var levels = SeverityLevelsConfiguration(warning: 1, error: 2)
|
||
</code>
|
||
It will appear in the documentation as:
|
||
<code>
|
||
foo: warning: 1
|
||
error: 2
|
||
</code></li>
|
||
</ol>
|
||
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L418-L525">Show on GitHub</a>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
<section class="section">
|
||
<div class="section-content">
|
||
<div class="task-group">
|
||
<ul class="item-container">
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV17DeprecationNoticeO"></a>
|
||
<a name="//apple_ref/swift/Enum/DeprecationNotice" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV17DeprecationNoticeO">DeprecationNotice</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>A deprecation notice.</p>
|
||
|
||
<a href="../Structs/ConfigurationElement/DeprecationNotice.html" class="slightly-smaller">See more</a>
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">DeprecationNotice</span> <span class="p">:</span> <span class="kt">Sendable</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L420-L423">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp"></a>
|
||
<a name="//apple_ref/swift/Property/wrappedValue" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp">wrappedValue</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Wrapped option value.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">wrappedValue</span><span class="p">:</span> <span class="kt">T</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L426-L435">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV14projectedValueACyxGvp"></a>
|
||
<a name="//apple_ref/swift/Property/projectedValue" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV14projectedValueACyxGvp">projectedValue</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>The wrapper itself providing access to all its data. This field can only be accessed by the
|
||
element’s name prefixed with a <code>$</code>.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">projectedValue</span><span class="p">:</span> <span class="p">`</span><span class="nv">Self</span><span class="p">`</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L439-L442">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV3keySSvp"></a>
|
||
<a name="//apple_ref/swift/Property/key" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV3keySSvp">key</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Name of this configuration entry.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">key</span><span class="p">:</span> <span class="kt">String</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L445">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV6inlineSbvp"></a>
|
||
<a name="//apple_ref/swift/Property/inline" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV6inlineSbvp">inline</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Whether this configuration element will be inlined into its description.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L448">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3key17deprecationNotice13postprocessorACyxGx_SSAC011DeprecationJ0Oyx_GSgyxzYbctcfc"></a>
|
||
<a name="//apple_ref/swift/Method/init(wrappedValue:key:deprecationNotice:postprocessor:)" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3key17deprecationNotice13postprocessorACyxGx_SSAC011DeprecationJ0Oyx_GSgyxzYbctcfc">init(wrappedValue:<wbr>key:<wbr>deprecationNotice:<wbr>postprocessor:<wbr>)</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Default constructor.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n"><a href="../Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp">wrappedValue</a></span> <span class="nv">value</span><span class="p">:</span> <span class="kt">T</span><span class="p">,</span>
|
||
<span class="nv">key</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span>
|
||
<span class="nv">deprecationNotice</span><span class="p">:</span> <span class="kt"><a href="../Structs/ConfigurationElement/DeprecationNotice.html">DeprecationNotice</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
|
||
<span class="nv">postprocessor</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="kd">@Sendable</span> <span class="p">(</span><span class="k">inout</span> <span class="kt">T</span><span class="p">)</span> <span class="o">-></span> <span class="kt">Void</span> <span class="o">=</span> <span class="p">{</span> <span class="n">_</span> <span class="k">in</span> <span class="p">})</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<h4>Parameters</h4>
|
||
<table class="graybox">
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>value</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Value to be wrapped.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>key</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Optional name of the option. If not specified, it will be inferred from the attributed property.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>deprecationNotice</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>An optional deprecation notice in case an option is outdated and/or has been replaced by
|
||
an alternative.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>postprocessor</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Function to be applied to the wrapped value after parsing to validate and modify it.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L461-L476">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV3keyACyqd__SgGSS_tcAERszSQRd__s8SendableRd__AA012AcceptableBydE0Rd__lufc"></a>
|
||
<a name="//apple_ref/swift/Method/init(key:)" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV3keyACyqd__SgGSS_tcAERszSQRd__s8SendableRd__AA012AcceptableBydE0Rd__lufc">init(key:<wbr>)</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Constructor for optional values.</p>
|
||
|
||
<p>It allows to skip explicit initialization of the property with <code>nil</code>.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o"><</span><span class="kt">Wrapped</span><span class="o">></span><span class="p">(</span><span class="nv">key</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="o">==</span> <span class="kt">Wrapped</span><span class="p">?,</span> <span class="kt">Wrapped</span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">Wrapped</span> <span class="p">:</span> <span class="kt">Sendable</span><span class="p">,</span> <span class="kt">Wrapped</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/AcceptableByConfigurationElement.html">AcceptableByConfigurationElement</a></span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<h4>Parameters</h4>
|
||
<table class="graybox">
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>key</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Optional name of the option. If not specified, it will be inferred from the attributed property.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L484-L486">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV12wrappedValue6inlineACyxGx_SbtcAA19InlinableOptionTypeRzrlufc"></a>
|
||
<a name="//apple_ref/swift/Method/init(wrappedValue:inline:)" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue6inlineACyxGx_SbtcAA19InlinableOptionTypeRzrlufc">init(wrappedValue:<wbr>inline:<wbr>)</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Constructor for an <code><a href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a></code> without a key.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n"><a href="../Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp">wrappedValue</a></span> <span class="nv">value</span><span class="p">:</span> <span class="kt">T</span><span class="p">,</span> <span class="nv">inline</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt"><a href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a></span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<h4>Parameters</h4>
|
||
<table class="graybox">
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>value</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Value to be wrapped.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>inline</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>If <code>true</code>, 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.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L495-L498">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3keyACyxGx_SStcAA19InlinableOptionTypeRzrlufc"></a>
|
||
<a name="//apple_ref/swift/Method/init(wrappedValue:key:)" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:13SwiftLintCore20ConfigurationElementV12wrappedValue3keyACyxGx_SStcAA19InlinableOptionTypeRzrlufc">init(wrappedValue:<wbr>key:<wbr>)</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
<p>Constructor for an <code><a href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a></code> with a name. The configuration will explicitly not be inlined.</p>
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n"><a href="../Structs/ConfigurationElement.html#/s:13SwiftLintCore20ConfigurationElementV12wrappedValuexvp">wrappedValue</a></span> <span class="nv">value</span><span class="p">:</span> <span class="kt">T</span><span class="p">,</span> <span class="nv">key</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt"><a href="../Protocols.html#/s:13SwiftLintCore19InlinableOptionTypeP">InlinableOptionType</a></span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<h4>Parameters</h4>
|
||
<table class="graybox">
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>value</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Value to be wrapped.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<code>
|
||
<em>key</em>
|
||
</code>
|
||
</td>
|
||
<td>
|
||
<div>
|
||
<p>Name of the option.</p>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L505-L507">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
<li class="item">
|
||
<div>
|
||
<code>
|
||
<a name="/s:SQ2eeoiySbx_xtFZ"></a>
|
||
<a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
|
||
<a class="token" href="#/s:SQ2eeoiySbx_xtFZ">==(_:<wbr>_:<wbr>)</a>
|
||
</code>
|
||
</div>
|
||
<div class="height-container">
|
||
<div class="pointer-container"></div>
|
||
<section class="section">
|
||
<div class="pointer"></div>
|
||
<div class="abstract">
|
||
|
||
</div>
|
||
<div class="declaration">
|
||
<h4>Declaration</h4>
|
||
<div class="language">
|
||
<p class="aside-title">Swift</p>
|
||
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="p">`</span><span class="nv">Self</span><span class="p">`,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="p">`</span><span class="nv">Self</span><span class="p">`)</span> <span class="o">-></span> <span class="kt">Bool</span></code></pre>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="slightly-smaller">
|
||
<a href="https://github.com/realm/SwiftLint/tree/main/Source/SwiftLintCore/Models/RuleConfigurationDescription.swift#L522-L524">Show on GitHub</a>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
</article>
|
||
</div>
|
||
<section class="footer">
|
||
<p>© 2023 <a class="link" href="https://jpsim.com" target="_blank" rel="external noopener">JP Simard</a> under MIT.</p>
|
||
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.15.1</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
|
||
</section>
|
||
</body>
|
||
</html>
|