Deploying to gh-pages from @ 48b15b9bf8 🚀

This commit is contained in:
Sija 2021-10-19 09:45:33 +00:00
parent 42809c9681
commit f760465482
106 changed files with 5612 additions and 4623 deletions

View file

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.36.1">
<meta name="generator" content="Crystal Docs 1.1.1">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
@ -286,6 +286,11 @@
<ul>
<li class=" " data-id="ameba/Ameba/Rule/Lint/AmbiguousAssignment" data-name="ameba::rule::lint::ambiguousassignment">
<a href="../../../Ameba/Rule/Lint/AmbiguousAssignment.html">AmbiguousAssignment</a>
</li>
<li class=" " data-id="ameba/Ameba/Rule/Lint/BadDirective" data-name="ameba::rule::lint::baddirective">
<a href="../../../Ameba/Rule/Lint/BadDirective.html">BadDirective</a>
@ -641,17 +646,11 @@
<p>This rule is used to identify usage of single expression blocks with
argument as a receiver, that can be collapsed into a short form.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).any? { <span class="o">|</span>i<span class="o">|</span> i.odd? }</code></pre>
<p>And it should be written as this:</p>
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).any?(<span class="o">&amp;</span>.odd?)</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/VerboseBlock:
Enabled: true
ExcludeMultipleLineBlocks: true
@ -701,7 +700,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/style/verbose_block.cr#L30" target="_blank">
<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/style/verbose_block.cr#L30" target="_blank">
ameba/rule/style/verbose_block.cr
</a>
@ -747,12 +746,12 @@ argument as a receiver, that can be collapsed into a short form.</p>
<ul class="list-summary">
<li class="entry-summary">
<a href="#new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method" class="signature"><strong>.new</strong>(ctx : YAML::ParseContext, node : YAML::Nodes::Node)</a>
<a href="#new%28ctx%3AYAML%3A%3AParseContext%2Cnode%3AYAML%3A%3ANodes%3A%3ANode%29-class-method" class="signature"><strong>.new</strong>(ctx : YAML::ParseContext, node : YAML::Nodes::Node)</a>
</li>
<li class="entry-summary">
<a href="#new(config=nil)-class-method" class="signature"><strong>.new</strong>(config = <span class="n">nil</span>)</a>
<a href="#new%28config%3Dnil%29-class-method" class="signature"><strong>.new</strong>(config = <span class="n">nil</span>)</a>
<div class="summary"><p>This rule is used to identify usage of single expression blocks with argument as a receiver, that can be collapsed into a short form.</p></div>
@ -775,117 +774,117 @@ argument as a receiver, that can be collapsed into a short form.</p>
<ul class="list-summary">
<li class="entry-summary">
<a href="#description:String-instance-method" class="signature"><strong>#description</strong> : String</a>
<a href="#description%3AString-instance-method" class="signature"><strong>#description</strong> : String</a>
</li>
<li class="entry-summary">
<a href="#description=(description:String)-instance-method" class="signature"><strong>#description=</strong>(description : String)</a>
<a href="#description%3D%28description%3AString%29-instance-method" class="signature"><strong>#description=</strong>(description : String)</a>
</li>
<li class="entry-summary">
<a href="#enabled:Bool-instance-method" class="signature"><strong>#enabled</strong> : Bool</a>
<a href="#enabled%3ABool-instance-method" class="signature"><strong>#enabled</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#enabled=(enabled)-instance-method" class="signature"><strong>#enabled=</strong>(enabled)</a>
<a href="#enabled%3D%28enabled%29-instance-method" class="signature"><strong>#enabled=</strong>(enabled)</a>
</li>
<li class="entry-summary">
<a href="#exclude_calls_with_block:Bool-instance-method" class="signature"><strong>#exclude_calls_with_block</strong> : Bool</a>
<a href="#exclude_calls_with_block%3ABool-instance-method" class="signature"><strong>#exclude_calls_with_block</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#exclude_calls_with_block=(exclude_calls_with_block:Bool)-instance-method" class="signature"><strong>#exclude_calls_with_block=</strong>(exclude_calls_with_block : Bool)</a>
<a href="#exclude_calls_with_block%3D%28exclude_calls_with_block%3ABool%29-instance-method" class="signature"><strong>#exclude_calls_with_block=</strong>(exclude_calls_with_block : Bool)</a>
</li>
<li class="entry-summary">
<a href="#exclude_multiple_line_blocks:Bool-instance-method" class="signature"><strong>#exclude_multiple_line_blocks</strong> : Bool</a>
<a href="#exclude_multiple_line_blocks%3ABool-instance-method" class="signature"><strong>#exclude_multiple_line_blocks</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#exclude_multiple_line_blocks=(exclude_multiple_line_blocks:Bool)-instance-method" class="signature"><strong>#exclude_multiple_line_blocks=</strong>(exclude_multiple_line_blocks : Bool)</a>
<a href="#exclude_multiple_line_blocks%3D%28exclude_multiple_line_blocks%3ABool%29-instance-method" class="signature"><strong>#exclude_multiple_line_blocks=</strong>(exclude_multiple_line_blocks : Bool)</a>
</li>
<li class="entry-summary">
<a href="#exclude_operators:Bool-instance-method" class="signature"><strong>#exclude_operators</strong> : Bool</a>
<a href="#exclude_operators%3ABool-instance-method" class="signature"><strong>#exclude_operators</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#exclude_operators=(exclude_operators:Bool)-instance-method" class="signature"><strong>#exclude_operators=</strong>(exclude_operators : Bool)</a>
<a href="#exclude_operators%3D%28exclude_operators%3ABool%29-instance-method" class="signature"><strong>#exclude_operators=</strong>(exclude_operators : Bool)</a>
</li>
<li class="entry-summary">
<a href="#exclude_prefix_operators:Bool-instance-method" class="signature"><strong>#exclude_prefix_operators</strong> : Bool</a>
<a href="#exclude_prefix_operators%3ABool-instance-method" class="signature"><strong>#exclude_prefix_operators</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#exclude_prefix_operators=(exclude_prefix_operators:Bool)-instance-method" class="signature"><strong>#exclude_prefix_operators=</strong>(exclude_prefix_operators : Bool)</a>
<a href="#exclude_prefix_operators%3D%28exclude_prefix_operators%3ABool%29-instance-method" class="signature"><strong>#exclude_prefix_operators=</strong>(exclude_prefix_operators : Bool)</a>
</li>
<li class="entry-summary">
<a href="#exclude_setters:Bool-instance-method" class="signature"><strong>#exclude_setters</strong> : Bool</a>
<a href="#exclude_setters%3ABool-instance-method" class="signature"><strong>#exclude_setters</strong> : Bool</a>
</li>
<li class="entry-summary">
<a href="#exclude_setters=(exclude_setters:Bool)-instance-method" class="signature"><strong>#exclude_setters=</strong>(exclude_setters : Bool)</a>
<a href="#exclude_setters%3D%28exclude_setters%3ABool%29-instance-method" class="signature"><strong>#exclude_setters=</strong>(exclude_setters : Bool)</a>
</li>
<li class="entry-summary">
<a href="#excluded:Array(String)?-instance-method" class="signature"><strong>#excluded</strong> : Array(String)?</a>
<a href="#excluded%3AArray%28String%29%3F-instance-method" class="signature"><strong>#excluded</strong> : Array(String)?</a>
</li>
<li class="entry-summary">
<a href="#excluded=(excluded:Array(String)?)-instance-method" class="signature"><strong>#excluded=</strong>(excluded : Array(String)?)</a>
<a href="#excluded%3D%28excluded%3AArray%28String%29%3F%29-instance-method" class="signature"><strong>#excluded=</strong>(excluded : Array(String)?)</a>
</li>
<li class="entry-summary">
<a href="#max_length:Int32?-instance-method" class="signature"><strong>#max_length</strong> : Int32?</a>
<a href="#max_length%3AInt32%3F-instance-method" class="signature"><strong>#max_length</strong> : Int32?</a>
</li>
<li class="entry-summary">
<a href="#max_length=(max_length:Int32?)-instance-method" class="signature"><strong>#max_length=</strong>(max_length : Int32?)</a>
<a href="#max_length%3D%28max_length%3AInt32%3F%29-instance-method" class="signature"><strong>#max_length=</strong>(max_length : Int32?)</a>
</li>
<li class="entry-summary">
<a href="#max_line_length:Int32?-instance-method" class="signature"><strong>#max_line_length</strong> : Int32?</a>
<a href="#max_line_length%3AInt32%3F-instance-method" class="signature"><strong>#max_line_length</strong> : Int32?</a>
</li>
<li class="entry-summary">
<a href="#max_line_length=(max_line_length:Int32?)-instance-method" class="signature"><strong>#max_line_length=</strong>(max_line_length : Int32?)</a>
<a href="#max_line_length%3D%28max_line_length%3AInt32%3F%29-instance-method" class="signature"><strong>#max_line_length=</strong>(max_line_length : Int32?)</a>
</li>
<li class="entry-summary">
<a href="#severity:Ameba::Severity-instance-method" class="signature"><strong>#severity</strong> : Ameba::Severity</a>
<a href="#severity%3AAmeba%3A%3ASeverity-instance-method" class="signature"><strong>#severity</strong> : Ameba::Severity</a>
</li>
<li class="entry-summary">
<a href="#severity=(severity)-instance-method" class="signature"><strong>#severity=</strong>(severity)</a>
<a href="#severity%3D%28severity%29-instance-method" class="signature"><strong>#severity=</strong>(severity)</a>
</li>
<li class="entry-summary">
<a href="#test(source,node:Crystal::Call)-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Call)</a>
<a href="#test%28source%2Cnode%3ACrystal%3A%3ACall%29-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Call)</a>
</li>
@ -922,17 +921,17 @@ argument as a receiver, that can be collapsed into a short form.</p>
<h3>Instance methods inherited from class <code><a href="../../../Ameba/Rule/Base.html">Ameba::Rule::Base</a></code></h3>
<a href="../../../Ameba/Rule/Base.html#==(other)-instance-method" class="tooltip">
<a href="../../../Ameba/Rule/Base.html#%3D%3D%28other%29-instance-method" class="tooltip">
<span>==(other)</span>
==</a>,
<a href="../../../Ameba/Rule/Base.html#catch(source:Source)-instance-method" class="tooltip">
<a href="../../../Ameba/Rule/Base.html#catch%28source%3ASource%29-instance-method" class="tooltip">
<span>catch(source : Source)</span>
catch</a>,
<a href="../../../Ameba/Rule/Base.html#excluded?(source)-instance-method" class="tooltip">
<a href="../../../Ameba/Rule/Base.html#excluded%3F%28source%29-instance-method" class="tooltip">
<span>excluded?(source)</span>
excluded?</a>,
@ -952,12 +951,12 @@ argument as a receiver, that can be collapsed into a short form.</p>
name</a>,
<a href="../../../Ameba/Rule/Base.html#special?-instance-method" class="tooltip">
<a href="../../../Ameba/Rule/Base.html#special%3F-instance-method" class="tooltip">
<span>special?</span>
special?</a>,
<a href="../../../Ameba/Rule/Base.html#test(source:Source,node:Crystal::ASTNode,*opts)-instance-method" class="tooltip">
<a href="../../../Ameba/Rule/Base.html#test%28source%3ASource%2Cnode%3ACrystal%3A%3AASTNode%2C%2Aopts%29-instance-method" class="tooltip">
<span>test(source : Source, node : Crystal::ASTNode, *opts)<br/>test(source : Source)</span>
test</a>
@ -1027,7 +1026,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def self.<strong>new</strong>(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
<a class="method-permalink" href="#new(ctx:YAML::ParseContext,node:YAML::Nodes::Node)-class-method">#</a>
<a class="method-permalink" href="#new%28ctx%3AYAML%3A%3AParseContext%2Cnode%3AYAML%3A%3ANodes%3A%3ANode%29-class-method">#</a>
</div>
<br/>
@ -1041,24 +1040,18 @@ argument as a receiver, that can be collapsed into a short form.</p>
def self.<strong>new</strong>(config = <span class="n">nil</span>)
<a class="method-permalink" href="#new(config=nil)-class-method">#</a>
<a class="method-permalink" href="#new%28config%3Dnil%29-class-method">#</a>
</div>
<div class="doc">
<p>This rule is used to identify usage of single expression blocks with
argument as a receiver, that can be collapsed into a short form.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).any? { <span class="o">|</span>i<span class="o">|</span> i.odd? }</code></pre>
<p>And it should be written as this:</p>
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).any?(<span class="o">&amp;</span>.odd?)</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/VerboseBlock:
Enabled: true
ExcludeMultipleLineBlocks: true
@ -1073,7 +1066,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/style/verbose_block.cr#L30" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/style/verbose_block.cr#L30" target="_blank">View source</a>]
</div>
</div>
@ -1097,7 +1090,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>description</strong> : String
<a class="method-permalink" href="#description:String-instance-method">#</a>
<a class="method-permalink" href="#description%3AString-instance-method">#</a>
</div>
<br/>
@ -1111,7 +1104,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>description=</strong>(description : String)
<a class="method-permalink" href="#description=(description:String)-instance-method">#</a>
<a class="method-permalink" href="#description%3D%28description%3AString%29-instance-method">#</a>
</div>
<br/>
@ -1125,7 +1118,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>enabled</strong> : Bool
<a class="method-permalink" href="#enabled:Bool-instance-method">#</a>
<a class="method-permalink" href="#enabled%3ABool-instance-method">#</a>
</div>
<br/>
@ -1139,7 +1132,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>enabled=</strong>(enabled)
<a class="method-permalink" href="#enabled=(enabled)-instance-method">#</a>
<a class="method-permalink" href="#enabled%3D%28enabled%29-instance-method">#</a>
</div>
<br/>
@ -1153,7 +1146,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_calls_with_block</strong> : Bool
<a class="method-permalink" href="#exclude_calls_with_block:Bool-instance-method">#</a>
<a class="method-permalink" href="#exclude_calls_with_block%3ABool-instance-method">#</a>
</div>
<br/>
@ -1167,7 +1160,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_calls_with_block=</strong>(exclude_calls_with_block : Bool)
<a class="method-permalink" href="#exclude_calls_with_block=(exclude_calls_with_block:Bool)-instance-method">#</a>
<a class="method-permalink" href="#exclude_calls_with_block%3D%28exclude_calls_with_block%3ABool%29-instance-method">#</a>
</div>
<br/>
@ -1181,7 +1174,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_multiple_line_blocks</strong> : Bool
<a class="method-permalink" href="#exclude_multiple_line_blocks:Bool-instance-method">#</a>
<a class="method-permalink" href="#exclude_multiple_line_blocks%3ABool-instance-method">#</a>
</div>
<br/>
@ -1195,7 +1188,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_multiple_line_blocks=</strong>(exclude_multiple_line_blocks : Bool)
<a class="method-permalink" href="#exclude_multiple_line_blocks=(exclude_multiple_line_blocks:Bool)-instance-method">#</a>
<a class="method-permalink" href="#exclude_multiple_line_blocks%3D%28exclude_multiple_line_blocks%3ABool%29-instance-method">#</a>
</div>
<br/>
@ -1209,7 +1202,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_operators</strong> : Bool
<a class="method-permalink" href="#exclude_operators:Bool-instance-method">#</a>
<a class="method-permalink" href="#exclude_operators%3ABool-instance-method">#</a>
</div>
<br/>
@ -1223,7 +1216,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_operators=</strong>(exclude_operators : Bool)
<a class="method-permalink" href="#exclude_operators=(exclude_operators:Bool)-instance-method">#</a>
<a class="method-permalink" href="#exclude_operators%3D%28exclude_operators%3ABool%29-instance-method">#</a>
</div>
<br/>
@ -1237,7 +1230,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_prefix_operators</strong> : Bool
<a class="method-permalink" href="#exclude_prefix_operators:Bool-instance-method">#</a>
<a class="method-permalink" href="#exclude_prefix_operators%3ABool-instance-method">#</a>
</div>
<br/>
@ -1251,7 +1244,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_prefix_operators=</strong>(exclude_prefix_operators : Bool)
<a class="method-permalink" href="#exclude_prefix_operators=(exclude_prefix_operators:Bool)-instance-method">#</a>
<a class="method-permalink" href="#exclude_prefix_operators%3D%28exclude_prefix_operators%3ABool%29-instance-method">#</a>
</div>
<br/>
@ -1265,7 +1258,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_setters</strong> : Bool
<a class="method-permalink" href="#exclude_setters:Bool-instance-method">#</a>
<a class="method-permalink" href="#exclude_setters%3ABool-instance-method">#</a>
</div>
<br/>
@ -1279,7 +1272,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>exclude_setters=</strong>(exclude_setters : Bool)
<a class="method-permalink" href="#exclude_setters=(exclude_setters:Bool)-instance-method">#</a>
<a class="method-permalink" href="#exclude_setters%3D%28exclude_setters%3ABool%29-instance-method">#</a>
</div>
<br/>
@ -1293,7 +1286,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>excluded</strong> : Array(String)?
<a class="method-permalink" href="#excluded:Array(String)?-instance-method">#</a>
<a class="method-permalink" href="#excluded%3AArray%28String%29%3F-instance-method">#</a>
</div>
<br/>
@ -1307,7 +1300,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>excluded=</strong>(excluded : Array(String)?)
<a class="method-permalink" href="#excluded=(excluded:Array(String)?)-instance-method">#</a>
<a class="method-permalink" href="#excluded%3D%28excluded%3AArray%28String%29%3F%29-instance-method">#</a>
</div>
<br/>
@ -1321,7 +1314,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>max_length</strong> : Int32?
<a class="method-permalink" href="#max_length:Int32?-instance-method">#</a>
<a class="method-permalink" href="#max_length%3AInt32%3F-instance-method">#</a>
</div>
<br/>
@ -1335,7 +1328,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>max_length=</strong>(max_length : Int32?)
<a class="method-permalink" href="#max_length=(max_length:Int32?)-instance-method">#</a>
<a class="method-permalink" href="#max_length%3D%28max_length%3AInt32%3F%29-instance-method">#</a>
</div>
<br/>
@ -1349,7 +1342,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>max_line_length</strong> : Int32?
<a class="method-permalink" href="#max_line_length:Int32?-instance-method">#</a>
<a class="method-permalink" href="#max_line_length%3AInt32%3F-instance-method">#</a>
</div>
<br/>
@ -1363,7 +1356,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>max_line_length=</strong>(max_line_length : Int32?)
<a class="method-permalink" href="#max_line_length=(max_line_length:Int32?)-instance-method">#</a>
<a class="method-permalink" href="#max_line_length%3D%28max_line_length%3AInt32%3F%29-instance-method">#</a>
</div>
<br/>
@ -1377,7 +1370,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>severity</strong> : <a href="../../../Ameba/Severity.html">Ameba::Severity</a>
<a class="method-permalink" href="#severity:Ameba::Severity-instance-method">#</a>
<a class="method-permalink" href="#severity%3AAmeba%3A%3ASeverity-instance-method">#</a>
</div>
<br/>
@ -1391,7 +1384,7 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>severity=</strong>(severity)
<a class="method-permalink" href="#severity=(severity)-instance-method">#</a>
<a class="method-permalink" href="#severity%3D%28severity%29-instance-method">#</a>
</div>
<br/>
@ -1405,13 +1398,13 @@ argument as a receiver, that can be collapsed into a short form.</p>
def <strong>test</strong>(source, node : Crystal::Call)
<a class="method-permalink" href="#test(source,node:Crystal::Call)-instance-method">#</a>
<a class="method-permalink" href="#test%28source%2Cnode%3ACrystal%3A%3ACall%29-instance-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/style/verbose_block.cr#L189" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/style/verbose_block.cr#L189" target="_blank">View source</a>]
</div>
</div>