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,19 +646,14 @@
<p>A rule that disallows useless conditional statements that contain a literal
in place of a variable or predicate function.</p>
<p>This is because a conditional construct with a literal predicate will
always result in the same behaviour at run time, meaning it can be
replaced with either the body of the construct, or deleted entirely.</p>
<p>This is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">if</span> <span class="s">&quot;something&quot;</span>
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/LiteralInCondition:
Enabled: true</code></pre>
@ -698,7 +698,7 @@ replaced with either the body of the construct, or deleted entirely.</p>
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L22" target="_blank">
<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L22" target="_blank">
ameba/rule/lint/literal_in_condition.cr
</a>
@ -739,12 +739,12 @@ replaced with either the body of the construct, or deleted entirely.</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>A rule that disallows useless conditional statements that contain a literal in place of a variable or predicate function.</p></div>
@ -767,62 +767,62 @@ replaced with either the body of the construct, or deleted entirely.</p>
<ul class="list-summary">
<li class="entry-summary">
<a href="#check_node(source,node)-instance-method" class="signature"><strong>#check_node</strong>(source, node)</a>
<a href="#check_node%28source%2Cnode%29-instance-method" class="signature"><strong>#check_node</strong>(source, node)</a>
</li>
<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="#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="#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::If)-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::If)</a>
<a href="#test%28source%2Cnode%3ACrystal%3A%3AIf%29-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::If)</a>
</li>
<li class="entry-summary">
<a href="#test(source,node:Crystal::Unless)-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Unless)</a>
<a href="#test%28source%2Cnode%3ACrystal%3A%3AUnless%29-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Unless)</a>
</li>
<li class="entry-summary">
<a href="#test(source,node:Crystal::Case)-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Case)</a>
<a href="#test%28source%2Cnode%3ACrystal%3A%3ACase%29-instance-method" class="signature"><strong>#test</strong>(source, node : Crystal::Case)</a>
</li>
@ -839,44 +839,49 @@ replaced with either the body of the construct, or deleted entirely.</p>
<h3>Instance methods inherited from module <code><a href="../../../Ameba/AST/Util.html">Ameba::AST::Util</a></code></h3>
<a href="../../../Ameba/AST/Util.html#abort?(node)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#abort%3F%28node%29-instance-method" class="tooltip">
<span>abort?(node)</span>
abort?</a>,
<a href="../../../Ameba/AST/Util.html#exit?(node)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#exit%3F%28node%29-instance-method" class="tooltip">
<span>exit?(node)</span>
exit?</a>,
<a href="../../../Ameba/AST/Util.html#flow_command?(node,in_loop)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#flow_command%3F%28node%2Cin_loop%29-instance-method" class="tooltip">
<span>flow_command?(node, in_loop)</span>
flow_command?</a>,
<a href="../../../Ameba/AST/Util.html#flow_expression?(node,in_loop=false)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#flow_expression%3F%28node%2Cin_loop%3Dfalse%29-instance-method" class="tooltip">
<span>flow_expression?(node, in_loop = <span class="n">false</span>)</span>
flow_expression?</a>,
<a href="../../../Ameba/AST/Util.html#literal?(node)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#literal%3F%28node%29-instance-method" class="tooltip">
<span>literal?(node)</span>
literal?</a>,
<a href="../../../Ameba/AST/Util.html#loop?(node)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#loop%3F%28node%29-instance-method" class="tooltip">
<span>loop?(node)</span>
loop?</a>,
<a href="../../../Ameba/AST/Util.html#node_source(node,code_lines)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#node_source%28node%2Ccode_lines%29-instance-method" class="tooltip">
<span>node_source(node, code_lines)</span>
node_source</a>,
<a href="../../../Ameba/AST/Util.html#raise?(node)-instance-method" class="tooltip">
<a href="../../../Ameba/AST/Util.html#raise%3F%28node%29-instance-method" class="tooltip">
<span>raise?(node)</span>
raise?</a>
raise?</a>,
<a href="../../../Ameba/AST/Util.html#source_between%28loc%2Cend_loc%2Ccode_lines%29%3AString%3F-instance-method" class="tooltip">
<span>source_between(loc, end_loc, code_lines) : String?</span>
source_between</a>
@ -913,17 +918,17 @@ replaced with either the body of the construct, or deleted entirely.</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>,
@ -943,12 +948,12 @@ replaced with either the body of the construct, or deleted entirely.</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>
@ -1018,7 +1023,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1032,26 +1037,21 @@ replaced with either the body of the construct, or deleted entirely.</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>A rule that disallows useless conditional statements that contain a literal
in place of a variable or predicate function.</p>
<p>This is because a conditional construct with a literal predicate will
always result in the same behaviour at run time, meaning it can be
replaced with either the body of the construct, or deleted entirely.</p>
<p>This is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">if</span> <span class="s">&quot;something&quot;</span>
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/LiteralInCondition:
Enabled: true</code></pre>
</div>
@ -1059,7 +1059,7 @@ replaced with either the body of the construct, or deleted entirely.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L22" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L22" target="_blank">View source</a>]
</div>
</div>
@ -1083,13 +1083,13 @@ replaced with either the body of the construct, or deleted entirely.</p>
def <strong>check_node</strong>(source, node)
<a class="method-permalink" href="#check_node(source,node)-instance-method">#</a>
<a class="method-permalink" href="#check_node%28source%2Cnode%29-instance-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L32" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L32" target="_blank">View source</a>]
</div>
</div>
@ -1099,7 +1099,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1113,7 +1113,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1127,7 +1127,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1141,7 +1141,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1155,7 +1155,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1169,7 +1169,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1183,7 +1183,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1197,7 +1197,7 @@ replaced with either the body of the construct, or deleted entirely.</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/>
@ -1211,13 +1211,13 @@ replaced with either the body of the construct, or deleted entirely.</p>
def <strong>test</strong>(source, node : Crystal::If)
<a class="method-permalink" href="#test(source,node:Crystal::If)-instance-method">#</a>
<a class="method-permalink" href="#test%28source%2Cnode%3ACrystal%3A%3AIf%29-instance-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L36" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L36" target="_blank">View source</a>]
</div>
</div>
@ -1227,13 +1227,13 @@ replaced with either the body of the construct, or deleted entirely.</p>
def <strong>test</strong>(source, node : Crystal::Unless)
<a class="method-permalink" href="#test(source,node:Crystal::Unless)-instance-method">#</a>
<a class="method-permalink" href="#test%28source%2Cnode%3ACrystal%3A%3AUnless%29-instance-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L40" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L40" target="_blank">View source</a>]
</div>
</div>
@ -1243,13 +1243,13 @@ replaced with either the body of the construct, or deleted entirely.</p>
def <strong>test</strong>(source, node : Crystal::Case)
<a class="method-permalink" href="#test(source,node:Crystal::Case)-instance-method">#</a>
<a class="method-permalink" href="#test%28source%2Cnode%3ACrystal%3A%3ACase%29-instance-method">#</a>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/9a91e42b/src/ameba/rule/lint/literal_in_condition.cr#L44" target="_blank">View source</a>]
[<a href="https://github.com/crystal-ameba/ameba/blob/48b15b9b/src/ameba/rule/lint/literal_in_condition.cr#L44" target="_blank">View source</a>]
</div>
</div>