Deploying to gh-pages from @ bedf3a68d7 🚀

This commit is contained in:
veelenga 2021-01-12 10:04:15 +00:00
parent 783b1f1658
commit edc349b964
93 changed files with 3493 additions and 1634 deletions

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Base - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Base - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -577,7 +577,7 @@
<p>Represents a base of all rules. In other words, all rules
inherits from this struct:</p>
<pre><code class="language-crystal"><span class="k">struct</span> <span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<pre><code><span class="k">struct</span> <span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<span class="k">def</span> <span class="m">test</span>(source)
<span class="k">if</span> invalid?(source)
issue_for line, column, <span class="s">&quot;Something wrong.&quot;</span>
@ -729,6 +729,13 @@ that are tested by this rule, it should add an issue.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L30" target="_blank">
ameba/rule/base.cr
</a>
<br/>
@ -933,6 +940,8 @@ that are tested by this rule, it should add an issue.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L30" target="_blank">View source</a>]
</div>
</div>
@ -960,7 +969,7 @@ that are tested by this rule, it should add an issue.</p>
<p>Returns documentation for this rule if any.</p>
<pre><code class="language-crystal"><span class="k">module</span> <span class="t">Ameba</span>
<pre><code><span class="k">module</span> <span class="t">Ameba</span>
<span class="c"># This is a test rule.</span>
<span class="c"># Does nothing.</span>
<span class="k">struct</span> <span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
@ -975,6 +984,8 @@ that are tested by this rule, it should add an issue.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L157" target="_blank">View source</a>]
</div>
</div>
@ -1006,12 +1017,12 @@ that are tested by this rule, it should add an issue.</p>
<p>Returns <code>true</code> if this struct is equal to <em>other</em>.</p>
<p>Both structs' instance vars are compared to each other. Thus, two
<p>Both structs's instance vars are compared to each other. Thus, two
structs are considered equal if each of their instance variables are
equal. Subclasses should override this method to provide specific
equality semantics.</p>
<pre><code class="language-crystal"><span class="k">struct</span> <span class="t">Point</span>
<pre><code><span class="k">struct</span> <span class="t">Point</span>
<span class="k">def</span> <span class="m">initialize</span>(@x : <span class="t">Int32</span>, @y : <span class="t">Int32</span>)
<span class="k">end</span>
<span class="k">end</span>
@ -1027,6 +1038,8 @@ p1 <span class="o">==</span> p3 <span class="c"># =&gt; false</span></code></pre
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L113" target="_blank">View source</a>]
</div>
</div>
@ -1043,13 +1056,15 @@ p1 <span class="o">==</span> p3 <span class="c"># =&gt; false</span></code></pre
<p>A convenient addition to <code><a href="../../Ameba/Rule/Base.html#test(source:Source,node:Crystal::ASTNode,*opts)-instance-method">#test</a></code> method that does the same
but returns a passed in <code>source</code> as an addition.</p>
<pre><code class="language-crystal">source <span class="o">=</span> <span class="t">MyRule</span>.<span class="k">new</span>.catch(source)
<pre><code>source <span class="o">=</span> <span class="t">MyRule</span>.<span class="k">new</span>.catch(source)
source.valid?</code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L54" target="_blank">View source</a>]
</div>
</div>
@ -1067,12 +1082,14 @@ source.valid?</code></pre>
It searches for a path in <code>excluded</code> property which matches
the one of the given source.</p>
<pre><code class="language-crystal">my_rule.excluded?(source) <span class="c"># =&gt; true or false</span></code></pre>
<pre><code>my_rule.excluded?(source) <span class="c"># =&gt; true or false</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L95" target="_blank">View source</a>]
</div>
</div>
@ -1088,7 +1105,7 @@ the one of the given source.</p>
<p>Returns a group this rule belong to.</p>
<pre><code class="language-crystal"><span class="k">struct</span> <span class="t">MyGroup</span><span class="t">::</span><span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<pre><code><span class="k">struct</span> <span class="t">MyGroup</span><span class="t">::</span><span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<span class="c"># ...</span>
<span class="k">end</span>
@ -1098,6 +1115,8 @@ the one of the given source.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L83" target="_blank">View source</a>]
</div>
</div>
@ -1117,7 +1136,7 @@ the one of the given source.</p>
<p>Generates an <code>UInt64</code> hash value for this object.</p>
<p>This method must have the property that <code>a == b</code> implies <code>a.hash == b.hash</code>.</p>
<p>This method must have the property that <code>a == b</code> implies <code>a<a href="../../Ameba/Rule/Base.html#hash-instance-method">.hash</a> == b<a href="../../Ameba/Rule/Base.html#hash-instance-method">.hash</a></code>.</p>
<p>The hash value is used along with <code><a href="../../Ameba/Rule/Base.html#==(other)-instance-method">#==</a></code> by the <code>Hash</code> class to determine if two objects
reference the same hash key.</p>
@ -1129,6 +1148,8 @@ though usually the macro <code>def_hash</code> can be used to generate this meth
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L117" target="_blank">View source</a>]
</div>
</div>
@ -1144,7 +1165,7 @@ though usually the macro <code>def_hash</code> can be used to generate this meth
<p>Returns a name of this rule, which is basically a class name.</p>
<pre><code class="language-crystal"><span class="k">struct</span> <span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<pre><code><span class="k">struct</span> <span class="t">MyRule</span> <span class="o">&lt;</span> <span class="t">Ameba</span><span class="t">::</span><span class="t">Rule</span><span class="t">::</span><span class="t">Base</span>
<span class="k">def</span> <span class="m">test</span>(source)
<span class="k">end</span>
<span class="k">end</span>
@ -1155,6 +1176,8 @@ though usually the macro <code>def_hash</code> can be used to generate this meth
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L69" target="_blank">View source</a>]
</div>
</div>
@ -1171,12 +1194,14 @@ though usually the macro <code>def_hash</code> can be used to generate this meth
<p>Returns true if this rule is special and behaves differently than
usual rules.</p>
<pre><code class="language-crystal">my_rule.special? <span class="c"># =&gt; true or false</span></code></pre>
<pre><code>my_rule.special? <span class="c"># =&gt; true or false</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L109" target="_blank">View source</a>]
</div>
</div>
@ -1191,6 +1216,8 @@ usual rules.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L42" target="_blank">View source</a>]
</div>
</div>
@ -1214,6 +1241,8 @@ Must be overriten for other type of rules.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L38" target="_blank">View source</a>]
</div>
</div>
@ -1240,6 +1269,8 @@ Must be overriten for other type of rules.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/base.cr#L121" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Layout - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Layout - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -585,6 +585,27 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/line_length.cr#L1" target="_blank">
ameba/rule/layout/line_length.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_blank_lines.cr#L1" target="_blank">
ameba/rule/layout/trailing_blank_lines.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_whitespace.cr#L1" target="_blank">
ameba/rule/layout/trailing_whitespace.cr
</a>
<br/>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Layout::LineLength - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Layout::LineLength - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,9 +578,9 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/LineLength:
<pre><code><span class="t">Layout</span><span class="s">/LineLength:
Enabled: true
MaxLength: 100</code></pre>
MaxLength: 100</span></code></pre>
@ -620,6 +620,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/line_length.cr#L12" target="_blank">
ameba/rule/layout/line_length.cr
</a>
<br/>
@ -917,14 +924,16 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/LineLength:
<pre><code><span class="t">Layout</span><span class="s">/LineLength:
Enabled: true
MaxLength: 100</code></pre>
MaxLength: 100</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/line_length.cr#L12" target="_blank">View source</a>]
</div>
</div>
@ -1093,6 +1102,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/line_length.cr#L21" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Layout::TrailingBlankLines - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Layout::TrailingBlankLines - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,8 +578,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/TrailingBlankLines:
Enabled: true</code></pre>
<pre><code><span class="t">Layout</span><span class="s">/TrailingBlankLines:
Enabled: true</span></code></pre>
@ -619,6 +619,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_blank_lines.cr#L11" target="_blank">
ameba/rule/layout/trailing_blank_lines.cr
</a>
<br/>
@ -911,13 +918,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/TrailingBlankLines:
Enabled: true</code></pre>
<pre><code><span class="t">Layout</span><span class="s">/TrailingBlankLines:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_blank_lines.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -1058,6 +1067,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_blank_lines.cr#L19" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Layout::TrailingWhitespace - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Layout::TrailingWhitespace - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,8 +578,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/TrailingWhitespace:
Enabled: true</code></pre>
<pre><code><span class="t">Layout</span><span class="s">/TrailingWhitespace:
Enabled: true</span></code></pre>
@ -619,6 +619,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_whitespace.cr#L11" target="_blank">
ameba/rule/layout/trailing_whitespace.cr
</a>
<br/>
@ -906,13 +913,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Layout/TrailingWhitespace:
Enabled: true</code></pre>
<pre><code><span class="t">Layout</span><span class="s">/TrailingWhitespace:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_whitespace.cr#L11" target="_blank">View source</a>]
</div>
</div>
@ -1053,6 +1062,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/layout/trailing_whitespace.cr#L18" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -585,6 +585,174 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/bad_directive.cr#L1" target="_blank">
ameba/rule/lint/bad_directive.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/comparison_to_boolean.cr#L1" target="_blank">
ameba/rule/lint/comparison_to_boolean.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/debugger_statement.cr#L1" target="_blank">
ameba/rule/lint/debugger_statement.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_ensure.cr#L1" target="_blank">
ameba/rule/lint/empty_ensure.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_expression.cr#L1" target="_blank">
ameba/rule/lint/empty_expression.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L1" target="_blank">
ameba/rule/lint/empty_loop.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/hash_duplicated_key.cr#L1" target="_blank">
ameba/rule/lint/hash_duplicated_key.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L1" target="_blank">
ameba/rule/lint/literal_in_condition.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_interpolation.cr#L1" target="_blank">
ameba/rule/lint/literal_in_interpolation.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/percent_array.cr#L1" target="_blank">
ameba/rule/lint/percent_array.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/rand_zero.cr#L1" target="_blank">
ameba/rule/lint/rand_zero.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_string_coercion.cr#L1" target="_blank">
ameba/rule/lint/redundant_string_coercion.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_index.cr#L1" target="_blank">
ameba/rule/lint/redundant_with_index.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_object.cr#L1" target="_blank">
ameba/rule/lint/redundant_with_object.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_argument.cr#L1" target="_blank">
ameba/rule/lint/shadowed_argument.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_exception.cr#L1" target="_blank">
ameba/rule/lint/shadowed_exception.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L1" target="_blank">
ameba/rule/lint/shadowing_local_outer_var.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shared_var_in_fiber.cr#L1" target="_blank">
ameba/rule/lint/shared_var_in_fiber.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/syntax.cr#L1" target="_blank">
ameba/rule/lint/syntax.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unneeded_disable_directive.cr#L1" target="_blank">
ameba/rule/lint/unneeded_disable_directive.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unreachable_code.cr#L1" target="_blank">
ameba/rule/lint/unreachable_code.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L1" target="_blank">
ameba/rule/lint/unused_argument.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_assign.cr#L1" target="_blank">
ameba/rule/lint/useless_assign.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_condition_in_when.cr#L1" target="_blank">
ameba/rule/lint/useless_condition_in_when.cr
</a>
<br/>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::BadDirective - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::BadDirective - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,15 +579,15 @@
<p>For example, the user can mistakenly add a directive
to disable a rule that even doesn't exist:</p>
<pre><code class="language-crystal"><span class="c"># ameba:disable BadRuleName</span>
<pre><code><span class="c"># ameba:disable BadRuleName</span>
<span class="k">def</span> <span class="m">foo</span>
<span class="n">:bar</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/BadDirective:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/BadDirective:
Enabled: true</span></code></pre>
@ -627,6 +627,13 @@ to disable a rule that even doesn't exist:</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/bad_directive.cr#L21" target="_blank">
ameba/rule/lint/bad_directive.cr
</a>
<br/>
@ -925,20 +932,22 @@ to disable a rule that even doesn't exist:</p>
<p>For example, the user can mistakenly add a directive
to disable a rule that even doesn't exist:</p>
<pre><code class="language-crystal"><span class="c"># ameba:disable BadRuleName</span>
<pre><code><span class="c"># ameba:disable BadRuleName</span>
<span class="k">def</span> <span class="m">foo</span>
<span class="n">:bar</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/BadDirective:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/BadDirective:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/bad_directive.cr#L21" target="_blank">View source</a>]
</div>
</div>
@ -1079,6 +1088,8 @@ to disable a rule that even doesn't exist:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/bad_directive.cr#L30" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ComparisonToBoolean - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ComparisonToBoolean - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, these are considered invalid:</p>
<pre><code class="language-crystal">foo <span class="o">==</span> <span class="n">true</span>
<pre><code>foo <span class="o">==</span> <span class="n">true</span>
bar <span class="o">!=</span> <span class="n">false</span>
<span class="n">false</span> <span class="o">===</span> baz</code></pre>
@ -588,8 +588,8 @@ or negating the variable.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ComparisonToBoolean:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ComparisonToBoolean:
Enabled: true</span></code></pre>
@ -629,6 +629,13 @@ or negating the variable.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/comparison_to_boolean.cr#L23" target="_blank">
ameba/rule/lint/comparison_to_boolean.cr
</a>
<br/>
@ -916,7 +923,7 @@ or negating the variable.</p>
<p>For example, these are considered invalid:</p>
<pre><code class="language-crystal">foo <span class="o">==</span> <span class="n">true</span>
<pre><code>foo <span class="o">==</span> <span class="n">true</span>
bar <span class="o">!=</span> <span class="n">false</span>
<span class="n">false</span> <span class="o">===</span> baz</code></pre>
@ -926,13 +933,15 @@ or negating the variable.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ComparisonToBoolean:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ComparisonToBoolean:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/comparison_to_boolean.cr#L23" target="_blank">View source</a>]
</div>
</div>
@ -1073,6 +1082,8 @@ or negating the variable.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/comparison_to_boolean.cr#L31" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::DebuggerStatement - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::DebuggerStatement - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -581,8 +581,8 @@ committed into our codebase.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/DebuggerStatement:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/DebuggerStatement:
Enabled: true</span></code></pre>
@ -622,6 +622,13 @@ committed into our codebase.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/debugger_statement.cr#L14" target="_blank">
ameba/rule/lint/debugger_statement.cr
</a>
<br/>
@ -912,13 +919,15 @@ committed into our codebase.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/DebuggerStatement:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/DebuggerStatement:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/debugger_statement.cr#L14" target="_blank">View source</a>]
</div>
</div>
@ -1059,6 +1068,8 @@ committed into our codebase.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/debugger_statement.cr#L21" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyEnsure - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyEnsure - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
do_some_stuff
<span class="k">ensure</span>
<span class="k">end</span>
@ -590,7 +590,7 @@
<p>And it should be written as this:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
do_some_stuff
<span class="k">ensure</span>
do_something_else
@ -604,8 +604,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyEnsure
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyEnsure
Enabled: true</span></code></pre>
@ -645,6 +645,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_ensure.cr#L42" target="_blank">
ameba/rule/lint/empty_ensure.cr
</a>
<br/>
@ -932,7 +939,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
do_some_stuff
<span class="k">ensure</span>
<span class="k">end</span>
@ -944,7 +951,7 @@
<p>And it should be written as this:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
do_some_stuff
<span class="k">ensure</span>
do_something_else
@ -958,13 +965,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyEnsure
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyEnsure
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_ensure.cr#L42" target="_blank">View source</a>]
</div>
</div>
@ -1105,6 +1114,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_ensure.cr#L49" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyExpression - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyExpression - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>This is considered invalid:</p>
<pre><code class="language-crystal">foo <span class="o">=</span> ()
<pre><code>foo <span class="o">=</span> ()
<span class="k">if</span> ()
bar
@ -586,7 +586,7 @@
<p>And this is valid:</p>
<pre><code class="language-crystal">foo <span class="o">=</span> (some_expression)
<pre><code>foo <span class="o">=</span> (some_expression)
<span class="k">if</span> (some_expression)
bar
@ -594,8 +594,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyExpression:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyExpression:
Enabled: true</span></code></pre>
@ -637,6 +637,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_expression.cr#L31" target="_blank">
ameba/rule/lint/empty_expression.cr
</a>
<br/>
@ -988,7 +995,7 @@
<p>This is considered invalid:</p>
<pre><code class="language-crystal">foo <span class="o">=</span> ()
<pre><code>foo <span class="o">=</span> ()
<span class="k">if</span> ()
bar
@ -996,7 +1003,7 @@
<p>And this is valid:</p>
<pre><code class="language-crystal">foo <span class="o">=</span> (some_expression)
<pre><code>foo <span class="o">=</span> (some_expression)
<span class="k">if</span> (some_expression)
bar
@ -1004,13 +1011,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyExpression:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyExpression:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_expression.cr#L31" target="_blank">View source</a>]
</div>
</div>
@ -1151,6 +1160,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_expression.cr#L42" target="_blank">View source</a>]
</div>
</div>
@ -1165,6 +1176,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_expression.cr#L50" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyLoop - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::EmptyLoop - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>This is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">while</span> <span class="n">false</span>
<pre><code><span class="k">while</span> <span class="n">false</span>
<span class="k">end</span>
<span class="k">until</span> <span class="n">10</span>
@ -590,7 +590,7 @@ loop <span class="k">do</span>
<p>And this is valid:</p>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
<span class="k">while</span> a <span class="o">&lt;</span> <span class="n">10</span>
a += <span class="n">1</span>
<span class="k">end</span>
@ -604,8 +604,8 @@ loop <span class="k">do</span>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyLoop:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyLoop:
Enabled: true</span></code></pre>
@ -647,6 +647,13 @@ loop <span class="k">do</span>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L40" target="_blank">
ameba/rule/lint/empty_loop.cr
</a>
<br/>
@ -998,7 +1005,7 @@ loop <span class="k">do</span>
<p>This is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">while</span> <span class="n">false</span>
<pre><code><span class="k">while</span> <span class="n">false</span>
<span class="k">end</span>
<span class="k">until</span> <span class="n">10</span>
@ -1010,7 +1017,7 @@ loop <span class="k">do</span>
<p>And this is valid:</p>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
<span class="k">while</span> a <span class="o">&lt;</span> <span class="n">10</span>
a += <span class="n">1</span>
<span class="k">end</span>
@ -1024,13 +1031,15 @@ loop <span class="k">do</span>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/EmptyLoop:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/EmptyLoop:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L40" target="_blank">View source</a>]
</div>
</div>
@ -1171,6 +1180,8 @@ loop <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L49" target="_blank">View source</a>]
</div>
</div>
@ -1185,6 +1196,8 @@ loop <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L55" target="_blank">View source</a>]
</div>
</div>
@ -1199,6 +1212,8 @@ loop <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/empty_loop.cr#L59" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::HashDuplicatedKey - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::HashDuplicatedKey - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,16 +578,16 @@
<p>This is considered invalid:</p>
<pre><code class="language-crystal">h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>, <span class="s">&quot;foo&quot;</span> => <span class="n">3</span>}</code></pre>
<pre><code>h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>, <span class="s">&quot;foo&quot;</span> => <span class="n">3</span>}</code></pre>
<p>And it has to written as this instead:</p>
<pre><code class="language-crystal">h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>}</code></pre>
<pre><code>h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>}</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/HashDuplicatedKey:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/HashDuplicatedKey:
Enabled: true</span></code></pre>
@ -627,6 +627,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/hash_duplicated_key.cr#L23" target="_blank">
ameba/rule/lint/hash_duplicated_key.cr
</a>
<br/>
@ -914,21 +921,23 @@
<p>This is considered invalid:</p>
<pre><code class="language-crystal">h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>, <span class="s">&quot;foo&quot;</span> => <span class="n">3</span>}</code></pre>
<pre><code>h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>, <span class="s">&quot;foo&quot;</span> => <span class="n">3</span>}</code></pre>
<p>And it has to written as this instead:</p>
<pre><code class="language-crystal">h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>}</code></pre>
<pre><code>h <span class="o">=</span> {<span class="s">&quot;foo&quot;</span> => <span class="n">1</span>, <span class="s">&quot;bar&quot;</span> => <span class="n">2</span>}</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/HashDuplicatedKey:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/HashDuplicatedKey:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/hash_duplicated_key.cr#L23" target="_blank">View source</a>]
</div>
</div>
@ -1069,6 +1078,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/hash_duplicated_key.cr#L30" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::LiteralInCondition - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::LiteralInCondition - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -583,14 +583,14 @@ 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>
<pre><code><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>
<pre><code><span class="t">Lint</span><span class="s">/LiteralInCondition:
Enabled: true</span></code></pre>
@ -632,6 +632,13 @@ replaced with either the body of the construct, or deleted entirely.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L23" target="_blank">
ameba/rule/lint/literal_in_condition.cr
</a>
<br/>
@ -993,19 +1000,21 @@ 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>
<pre><code><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>
<pre><code><span class="t">Lint</span><span class="s">/LiteralInCondition:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L23" target="_blank">View source</a>]
</div>
</div>
@ -1034,6 +1043,8 @@ replaced with either the body of the construct, or deleted entirely.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L33" target="_blank">View source</a>]
</div>
</div>
@ -1160,6 +1171,8 @@ replaced with either the body of the construct, or deleted entirely.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L38" target="_blank">View source</a>]
</div>
</div>
@ -1174,6 +1187,8 @@ replaced with either the body of the construct, or deleted entirely.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L42" target="_blank">View source</a>]
</div>
</div>
@ -1188,6 +1203,8 @@ replaced with either the body of the construct, or deleted entirely.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_condition.cr#L46" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::LiteralInInterpolation - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::LiteralInInterpolation - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,13 +579,13 @@ that contain a literal value instead of a variable or function.</p>
<p>For example:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span><span class="n">:Ary</span><span class="i">}</span><span class="s">&quot;</span>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span><span class="n">:Ary</span><span class="i">}</span><span class="s">&quot;</span>
<span class="s">&quot;There are </span><span class="i">#{</span><span class="n">4</span><span class="i">}</span><span class="s"> cats&quot;</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/LiteralInInterpolation
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/LiteralInInterpolation
Enabled: true</span></code></pre>
@ -627,6 +627,13 @@ that contain a literal value instead of a variable or function.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_interpolation.cr#L19" target="_blank">
ameba/rule/lint/literal_in_interpolation.cr
</a>
<br/>
@ -969,18 +976,20 @@ that contain a literal value instead of a variable or function.</p>
<p>For example:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span><span class="n">:Ary</span><span class="i">}</span><span class="s">&quot;</span>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span><span class="n">:Ary</span><span class="i">}</span><span class="s">&quot;</span>
<span class="s">&quot;There are </span><span class="i">#{</span><span class="n">4</span><span class="i">}</span><span class="s"> cats&quot;</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/LiteralInInterpolation
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/LiteralInInterpolation
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_interpolation.cr#L19" target="_blank">View source</a>]
</div>
</div>
@ -1121,6 +1130,8 @@ that contain a literal value instead of a variable or function.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/literal_in_interpolation.cr#L28" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::PercentArrays - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::PercentArrays - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,20 +578,20 @@
<p>For example, this is usually written by mistake:</p>
<pre><code class="language-crystal"><span class="s">%i(:one, :two)</span>
<pre><code><span class="s">%i(:one, :two)</span>
<span class="s">%w(&quot;one&quot;, &quot;two&quot;)</span></code></pre>
<p>And the expected example is:</p>
<pre><code class="language-crystal"><span class="s">%i(one two)</span>
<pre><code><span class="s">%i(one two)</span>
<span class="s">%w(one two)</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/PercentArrays:
<pre><code><span class="t">Lint</span><span class="s">/PercentArrays:
Enabled: true
StringArrayUnwantedSymbols: ',"'
SymbolArrayUnwantedSymbols: ',:'</code></pre>
StringArrayUnwantedSymbols: &#39;,&quot;&#39;
SymbolArrayUnwantedSymbols: &#39;,:&#39;</span></code></pre>
@ -631,6 +631,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/percent_array.cr#L27" target="_blank">
ameba/rule/lint/percent_array.cr
</a>
<br/>
@ -938,25 +945,27 @@
<p>For example, this is usually written by mistake:</p>
<pre><code class="language-crystal"><span class="s">%i(:one, :two)</span>
<pre><code><span class="s">%i(:one, :two)</span>
<span class="s">%w(&quot;one&quot;, &quot;two&quot;)</span></code></pre>
<p>And the expected example is:</p>
<pre><code class="language-crystal"><span class="s">%i(one two)</span>
<pre><code><span class="s">%i(one two)</span>
<span class="s">%w(one two)</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/PercentArrays:
<pre><code><span class="t">Lint</span><span class="s">/PercentArrays:
Enabled: true
StringArrayUnwantedSymbols: ',"'
SymbolArrayUnwantedSymbols: ',:'</code></pre>
StringArrayUnwantedSymbols: &#39;,&quot;&#39;
SymbolArrayUnwantedSymbols: &#39;,:&#39;</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/percent_array.cr#L27" target="_blank">View source</a>]
</div>
</div>
@ -1153,6 +1162,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/percent_array.cr#L36" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RandZero - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RandZero - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,18 +579,18 @@ Such calls always return <code>0</code>.</p>
<p>For example:</p>
<pre><code class="language-crystal">rand(<span class="n">1</span>)</code></pre>
<pre><code>rand(<span class="n">1</span>)</code></pre>
<p>Should be written as:</p>
<pre><code class="language-crystal">rand
<pre><code>rand
<span class="c"># or</span>
rand(<span class="n">2</span>)</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RandZero:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RandZero:
Enabled: true</span></code></pre>
@ -630,6 +630,13 @@ rand(<span class="n">2</span>)</code></pre>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/rand_zero.cr#L26" target="_blank">
ameba/rule/lint/rand_zero.cr
</a>
<br/>
@ -918,23 +925,25 @@ Such calls always return <code>0</code>.</p>
<p>For example:</p>
<pre><code class="language-crystal">rand(<span class="n">1</span>)</code></pre>
<pre><code>rand(<span class="n">1</span>)</code></pre>
<p>Should be written as:</p>
<pre><code class="language-crystal">rand
<pre><code>rand
<span class="c"># or</span>
rand(<span class="n">2</span>)</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RandZero:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RandZero:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/rand_zero.cr#L26" target="_blank">View source</a>]
</div>
</div>
@ -1075,6 +1084,8 @@ rand(<span class="n">2</span>)</code></pre>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/rand_zero.cr#L33" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantStringCoercion - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantStringCoercion - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,16 +579,16 @@ which is redundant.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span>name.to_s<span class="i">}</span><span class="s">&quot;</span></code></pre>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span>name.to_s<span class="i">}</span><span class="s">&quot;</span></code></pre>
<p>And this is valid:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span>name<span class="i">}</span><span class="s">&quot;</span></code></pre>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span>name<span class="i">}</span><span class="s">&quot;</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantStringCoersion
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantStringCoersion
Enabled: true</span></code></pre>
@ -630,6 +630,13 @@ which is redundant.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_string_coercion.cr#L24" target="_blank">
ameba/rule/lint/redundant_string_coercion.cr
</a>
<br/>
@ -972,21 +979,23 @@ which is redundant.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span>name.to_s<span class="i">}</span><span class="s">&quot;</span></code></pre>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span>name.to_s<span class="i">}</span><span class="s">&quot;</span></code></pre>
<p>And this is valid:</p>
<pre><code class="language-crystal"><span class="s">&quot;Hello, </span><span class="i">#{</span>name<span class="i">}</span><span class="s">&quot;</span></code></pre>
<pre><code><span class="s">&quot;Hello, </span><span class="i">#{</span>name<span class="i">}</span><span class="s">&quot;</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantStringCoersion
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantStringCoersion
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_string_coercion.cr#L24" target="_blank">View source</a>]
</div>
</div>
@ -1127,6 +1136,8 @@ which is redundant.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_string_coercion.cr#L33" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantWithIndex - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantWithIndex - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,24 +578,24 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">collection.each.with_index <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each.with_index <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span>
collection.each_with_index <span class="k">do</span> <span class="o">|</span>e, _<span class="o">|</span>
collection.each_with_index <span class="k">do</span> <span class="o">|</span>e, UNDERSCORE<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantWithIndex:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantWithIndex:
Enabled: true</span></code></pre>
@ -635,6 +635,13 @@ collection.each_with_index <span class="k">do</span> <span class="o">|</span>e,
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_index.cr#L30" target="_blank">
ameba/rule/lint/redundant_with_index.cr
</a>
<br/>
@ -903,29 +910,31 @@ collection.each_with_index <span class="k">do</span> <span class="o">|</span>e,
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">collection.each.with_index <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each.with_index <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span>
collection.each_with_index <span class="k">do</span> <span class="o">|</span>e, _<span class="o">|</span>
collection.each_with_index <span class="k">do</span> <span class="o">|</span>e, UNDERSCORE<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantWithIndex:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantWithIndex:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_index.cr#L30" target="_blank">View source</a>]
</div>
</div>
@ -1066,6 +1075,8 @@ collection.each_with_index <span class="k">do</span> <span class="o">|</span>e,
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_index.cr#L35" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantWithObject - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::RedundantWithObject - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,24 +578,24 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span>
collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e, _<span class="o">|</span>
collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e, UNDERSCORE<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantWithObject:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantWithObject:
Enabled: true</span></code></pre>
@ -635,6 +635,13 @@ collection.each_with_object(<span class="n">0</span>) <span class="k">do</span>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_object.cr#L31" target="_blank">
ameba/rule/lint/redundant_with_object.cr
</a>
<br/>
@ -903,29 +910,31 @@ collection.each_with_object(<span class="n">0</span>) <span class="k">do</span>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span>
collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e, _<span class="o">|</span>
collection.each_with_object(<span class="n">0</span>) <span class="k">do</span> <span class="o">|</span>e, UNDERSCORE<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<pre><code>collection.each <span class="k">do</span> <span class="o">|</span>e<span class="o">|</span>
<span class="c"># ...</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/RedundantWithObject:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/RedundantWithObject:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_object.cr#L31" target="_blank">View source</a>]
</div>
</div>
@ -1066,6 +1075,8 @@ collection.each_with_object(<span class="n">0</span>) <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/redundant_with_object.cr#L36" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowedArgument - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowedArgument - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
<pre><code>do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
foo <span class="o">=</span> <span class="n">1</span> <span class="c"># shadows block argument</span>
foo
<span class="k">end</span>
@ -590,7 +590,7 @@
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
<pre><code>do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
foo <span class="o">=</span> foo <span class="o">+</span> <span class="n">42</span>
foo
<span class="k">end</span>
@ -602,8 +602,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowedArgument:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowedArgument:
Enabled: true</span></code></pre>
@ -643,6 +643,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_argument.cr#L39" target="_blank">
ameba/rule/lint/shadowed_argument.cr
</a>
<br/>
@ -935,7 +942,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
<pre><code>do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
foo <span class="o">=</span> <span class="n">1</span> <span class="c"># shadows block argument</span>
foo
<span class="k">end</span>
@ -947,7 +954,7 @@
<p>and it should be written as follows:</p>
<pre><code class="language-crystal">do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
<pre><code>do_something <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span>
foo <span class="o">=</span> foo <span class="o">+</span> <span class="n">42</span>
foo
<span class="k">end</span>
@ -959,13 +966,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowedArgument:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowedArgument:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_argument.cr#L39" target="_blank">View source</a>]
</div>
</div>
@ -1106,6 +1115,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_argument.cr#L50" target="_blank">View source</a>]
</div>
</div>
@ -1120,6 +1131,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_argument.cr#L46" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowedException - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowedException - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -580,7 +580,7 @@ exception is rescued.</p>
<p>For example, this is invalid:</p>
<pre><code class="language-crystal"><span class="k">begin</span>
<pre><code><span class="k">begin</span>
do_something
<span class="k">rescue</span> <span class="t">Exception</span>
handle_exception
@ -590,7 +590,7 @@ exception is rescued.</p>
<p>And it has to be written as follows:</p>
<pre><code class="language-crystal"><span class="k">begin</span>
<pre><code><span class="k">begin</span>
do_something
<span class="k">rescue</span> <span class="t">ArgumentError</span>
handle_argument_error_exception
@ -600,8 +600,8 @@ exception is rescued.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowedException:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowedException:
Enabled: true</span></code></pre>
@ -641,6 +641,13 @@ exception is rescued.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_exception.cr#L37" target="_blank">
ameba/rule/lint/shadowed_exception.cr
</a>
<br/>
@ -930,7 +937,7 @@ exception is rescued.</p>
<p>For example, this is invalid:</p>
<pre><code class="language-crystal"><span class="k">begin</span>
<pre><code><span class="k">begin</span>
do_something
<span class="k">rescue</span> <span class="t">Exception</span>
handle_exception
@ -940,7 +947,7 @@ exception is rescued.</p>
<p>And it has to be written as follows:</p>
<pre><code class="language-crystal"><span class="k">begin</span>
<pre><code><span class="k">begin</span>
do_something
<span class="k">rescue</span> <span class="t">ArgumentError</span>
handle_argument_error_exception
@ -950,13 +957,15 @@ exception is rescued.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowedException:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowedException:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_exception.cr#L37" target="_blank">View source</a>]
</div>
</div>
@ -1097,6 +1106,8 @@ exception is rescued.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowed_exception.cr#L44" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowingOuterLocalVar - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::ShadowingOuterLocalVar - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,7 +579,7 @@ for block or proc arguments.</p>
<p>For example, this is considered incorrect:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
foo <span class="o">=</span> <span class="n">1</span>
<span class="n">3</span>.times <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span> <span class="c"># shadowing outer `foo`</span>
@ -588,7 +588,7 @@ for block or proc arguments.</p>
<p>and should be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
foo <span class="o">=</span> <span class="n">1</span>
<span class="n">3</span>.times <span class="k">do</span> <span class="o">|</span>bar<span class="o">|</span>
@ -597,8 +597,8 @@ for block or proc arguments.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowingOuterLocalVar:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowingOuterLocalVar:
Enabled: true</span></code></pre>
@ -638,6 +638,13 @@ for block or proc arguments.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L34" target="_blank">
ameba/rule/lint/shadowing_local_outer_var.cr
</a>
<br/>
@ -936,7 +943,7 @@ for block or proc arguments.</p>
<p>For example, this is considered incorrect:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
foo <span class="o">=</span> <span class="n">1</span>
<span class="n">3</span>.times <span class="k">do</span> <span class="o">|</span>foo<span class="o">|</span> <span class="c"># shadowing outer `foo`</span>
@ -945,7 +952,7 @@ for block or proc arguments.</p>
<p>and should be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">some_method</span>
<pre><code><span class="k">def</span> <span class="m">some_method</span>
foo <span class="o">=</span> <span class="n">1</span>
<span class="n">3</span>.times <span class="k">do</span> <span class="o">|</span>bar<span class="o">|</span>
@ -954,13 +961,15 @@ for block or proc arguments.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/ShadowingOuterLocalVar:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/ShadowingOuterLocalVar:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L34" target="_blank">View source</a>]
</div>
</div>
@ -1101,6 +1110,8 @@ for block or proc arguments.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L46" target="_blank">View source</a>]
</div>
</div>
@ -1115,6 +1126,8 @@ for block or proc arguments.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L50" target="_blank">View source</a>]
</div>
</div>
@ -1129,6 +1142,8 @@ for block or proc arguments.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shadowing_local_outer_var.cr#L42" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::SharedVarInFiber - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::SharedVarInFiber - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -581,7 +581,7 @@ which are mutated during iterations.</p>
<p>For example, having this example:</p>
<pre><code class="language-crystal">n <span class="o">=</span> <span class="n">0</span>
<pre><code>n <span class="o">=</span> <span class="n">0</span>
channel <span class="o">=</span> <span class="t">Channel</span>(<span class="t">Int32</span>).<span class="k">new</span>
<span class="k">while</span> n <span class="o">&lt;</span> <span class="n">3</span>
@ -596,7 +596,7 @@ and when <code>channel.receive</code> is executed its value is <code>3</code>.</
<p>To solve this, the code above needs to be rewritten to the following:</p>
<pre><code class="language-crystal">n <span class="o">=</span> <span class="n">0</span>
<pre><code>n <span class="o">=</span> <span class="n">0</span>
channel <span class="o">=</span> <span class="t">Channel</span>(<span class="t">Int32</span>).<span class="k">new</span>
<span class="k">while</span> n <span class="o">&lt;</span> <span class="n">3</span>
@ -612,12 +612,12 @@ during iterations. So it reports the issue on the first sample and passes on
the second one.</p>
<p>There are also other technics to solve the problem above which are
<a href="https://crystal-lang.org/reference/guides/concurrency.html">officially documented</a></p>
<a href="https://crystal-lang.org/reference/guides/concurrency.html" target="_blank">officially documented</a></p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/SharedVarInFiber:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/SharedVarInFiber:
Enabled: true</span></code></pre>
@ -657,6 +657,13 @@ the second one.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shared_var_in_fiber.cr#L53" target="_blank">
ameba/rule/lint/shared_var_in_fiber.cr
</a>
<br/>
@ -952,7 +959,7 @@ which are mutated during iterations.</p>
<p>For example, having this example:</p>
<pre><code class="language-crystal">n <span class="o">=</span> <span class="n">0</span>
<pre><code>n <span class="o">=</span> <span class="n">0</span>
channel <span class="o">=</span> <span class="t">Channel</span>(<span class="t">Int32</span>).<span class="k">new</span>
<span class="k">while</span> n <span class="o">&lt;</span> <span class="n">3</span>
@ -967,7 +974,7 @@ and when <code>channel.receive</code> is executed its value is <code>3</code>.</
<p>To solve this, the code above needs to be rewritten to the following:</p>
<pre><code class="language-crystal">n <span class="o">=</span> <span class="n">0</span>
<pre><code>n <span class="o">=</span> <span class="n">0</span>
channel <span class="o">=</span> <span class="t">Channel</span>(<span class="t">Int32</span>).<span class="k">new</span>
<span class="k">while</span> n <span class="o">&lt;</span> <span class="n">3</span>
@ -983,17 +990,19 @@ during iterations. So it reports the issue on the first sample and passes on
the second one.</p>
<p>There are also other technics to solve the problem above which are
<a href="https://crystal-lang.org/reference/guides/concurrency.html">officially documented</a></p>
<a href="https://crystal-lang.org/reference/guides/concurrency.html" target="_blank">officially documented</a></p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/SharedVarInFiber:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/SharedVarInFiber:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shared_var_in_fiber.cr#L53" target="_blank">View source</a>]
</div>
</div>
@ -1134,6 +1143,8 @@ the second one.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shared_var_in_fiber.cr#L64" target="_blank">View source</a>]
</div>
</div>
@ -1148,6 +1159,8 @@ the second one.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/shared_var_in_fiber.cr#L60" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::Syntax - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::Syntax - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,14 +578,14 @@
<p>For example, this syntax is invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">hello</span>
<pre><code><span class="k">def</span> <span class="m">hello</span>
do_something
<span class="k">rescue</span> <span class="t">Exception</span> => e
<span class="k">end</span></code></pre>
<p>And should be properly written:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">hello</span>
<pre><code><span class="k">def</span> <span class="m">hello</span>
do_something
<span class="k">rescue</span> e : <span class="t">Exception</span>
<span class="k">end</span></code></pre>
@ -628,6 +628,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/syntax.cr#L22" target="_blank">
ameba/rule/lint/syntax.cr
</a>
<br/>
@ -896,14 +903,14 @@
<p>For example, this syntax is invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">hello</span>
<pre><code><span class="k">def</span> <span class="m">hello</span>
do_something
<span class="k">rescue</span> <span class="t">Exception</span> => e
<span class="k">end</span></code></pre>
<p>And should be properly written:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">hello</span>
<pre><code><span class="k">def</span> <span class="m">hello</span>
do_something
<span class="k">rescue</span> e : <span class="t">Exception</span>
<span class="k">end</span></code></pre>
@ -912,6 +919,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/syntax.cr#L22" target="_blank">View source</a>]
</div>
</div>
@ -1052,6 +1061,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/syntax.cr#L28" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnneededDisableDirective - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnneededDisableDirective - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -577,7 +577,7 @@
<p>A rule that reports unneeded disable directives.
For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="c"># ameba:disable Style/PredicateName</span>
<pre><code><span class="c"># ameba:disable Style/PredicateName</span>
<span class="k">def</span> <span class="m">comment?</span>
do_something
<span class="k">end</span></code></pre>
@ -585,14 +585,14 @@ For example, this is considered invalid:</p>
<p>as the predicate name is correct and the comment directive does not
have any effect, the snippet should be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">comment?</span>
<pre><code><span class="k">def</span> <span class="m">comment?</span>
do_something
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnneededDisableDirective
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UnneededDisableDirective
Enabled: true</span></code></pre>
@ -632,6 +632,13 @@ have any effect, the snippet should be written as the following:</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unneeded_disable_directive.cr#L28" target="_blank">
ameba/rule/lint/unneeded_disable_directive.cr
</a>
<br/>
@ -918,7 +925,7 @@ have any effect, the snippet should be written as the following:</p>
<p>A rule that reports unneeded disable directives.
For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="c"># ameba:disable Style/PredicateName</span>
<pre><code><span class="c"># ameba:disable Style/PredicateName</span>
<span class="k">def</span> <span class="m">comment?</span>
do_something
<span class="k">end</span></code></pre>
@ -926,19 +933,21 @@ For example, this is considered invalid:</p>
<p>as the predicate name is correct and the comment directive does not
have any effect, the snippet should be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">comment?</span>
<pre><code><span class="k">def</span> <span class="m">comment?</span>
do_something
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnneededDisableDirective
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UnneededDisableDirective
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unneeded_disable_directive.cr#L28" target="_blank">View source</a>]
</div>
</div>
@ -1079,6 +1088,8 @@ have any effect, the snippet should be written as the following:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unneeded_disable_directive.cr#L35" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnreachableCode - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnreachableCode - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,12 +578,12 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a)
<pre><code><span class="k">def</span> <span class="m">method</span>(a)
<span class="k">return</span> <span class="n">42</span>
a <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
loop <span class="k">do</span>
<span class="k">break</span>
a += <span class="n">1</span>
@ -591,12 +591,12 @@ loop <span class="k">do</span>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a)
<pre><code><span class="k">def</span> <span class="m">method</span>(a)
<span class="k">return</span> <span class="n">42</span> <span class="k">if</span> a <span class="o">==</span> <span class="n">0</span>
a <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
loop <span class="k">do</span>
<span class="k">break</span> a <span class="o">&gt;</span> <span class="n">3</span>
a += <span class="n">1</span>
@ -604,8 +604,8 @@ loop <span class="k">do</span>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnreachableCode:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UnreachableCode:
Enabled: true</span></code></pre>
@ -647,6 +647,13 @@ loop <span class="k">do</span>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unreachable_code.cr#L45" target="_blank">
ameba/rule/lint/unreachable_code.cr
</a>
<br/>
@ -993,12 +1000,12 @@ loop <span class="k">do</span>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a)
<pre><code><span class="k">def</span> <span class="m">method</span>(a)
<span class="k">return</span> <span class="n">42</span>
a <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
loop <span class="k">do</span>
<span class="k">break</span>
a += <span class="n">1</span>
@ -1006,12 +1013,12 @@ loop <span class="k">do</span>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a)
<pre><code><span class="k">def</span> <span class="m">method</span>(a)
<span class="k">return</span> <span class="n">42</span> <span class="k">if</span> a <span class="o">==</span> <span class="n">0</span>
a <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">a <span class="o">=</span> <span class="n">1</span>
<pre><code>a <span class="o">=</span> <span class="n">1</span>
loop <span class="k">do</span>
<span class="k">break</span> a <span class="o">&gt;</span> <span class="n">3</span>
a += <span class="n">1</span>
@ -1019,13 +1026,15 @@ loop <span class="k">do</span>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnreachableCode:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UnreachableCode:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unreachable_code.cr#L45" target="_blank">View source</a>]
</div>
</div>
@ -1166,6 +1175,8 @@ loop <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unreachable_code.cr#L58" target="_blank">View source</a>]
</div>
</div>
@ -1180,6 +1191,8 @@ loop <span class="k">do</span>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unreachable_code.cr#L54" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnusedArgument - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UnusedArgument - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -577,23 +577,23 @@
<p>A rule that reports unused arguments.
For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b, c)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b, c)
a <span class="o">+</span> b
<span class="k">end</span></code></pre>
<p>and should be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
a <span class="o">+</span> b
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnusedArgument:
<pre><code><span class="t">Lint</span><span class="s">/UnusedArgument:
Enabled: true
IgnoreDefs: true
IgnoreBlocks: false
IgnoreProcs: false</code></pre>
IgnoreProcs: false</span></code></pre>
@ -633,6 +633,13 @@ For example, this is considered invalid:</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L28" target="_blank">
ameba/rule/lint/unused_argument.cr
</a>
<br/>
@ -964,28 +971,30 @@ For example, this is considered invalid:</p>
<p>A rule that reports unused arguments.
For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b, c)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b, c)
a <span class="o">+</span> b
<span class="k">end</span></code></pre>
<p>and should be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
a <span class="o">+</span> b
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UnusedArgument:
<pre><code><span class="t">Lint</span><span class="s">/UnusedArgument:
Enabled: true
IgnoreDefs: true
IgnoreBlocks: false
IgnoreProcs: false</code></pre>
IgnoreProcs: false</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L28" target="_blank">View source</a>]
</div>
</div>
@ -1210,6 +1219,8 @@ For example, this is considered invalid:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L44" target="_blank">View source</a>]
</div>
</div>
@ -1224,6 +1235,8 @@ For example, this is considered invalid:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L48" target="_blank">View source</a>]
</div>
</div>
@ -1238,6 +1251,8 @@ For example, this is considered invalid:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L52" target="_blank">View source</a>]
</div>
</div>
@ -1252,6 +1267,8 @@ For example, this is considered invalid:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/unused_argument.cr#L40" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UselessAssign - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UselessAssign - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,22 +578,22 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
var <span class="o">=</span> <span class="n">1</span>
do_something
<span class="k">end</span></code></pre>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
var <span class="o">=</span> <span class="n">1</span>
do_something(var)
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UselessAssign:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UselessAssign:
Enabled: true</span></code></pre>
@ -633,6 +633,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_assign.cr#L29" target="_blank">
ameba/rule/lint/useless_assign.cr
</a>
<br/>
@ -925,27 +932,29 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
var <span class="o">=</span> <span class="n">1</span>
do_something
<span class="k">end</span></code></pre>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
var <span class="o">=</span> <span class="n">1</span>
do_something(var)
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UselessAssign:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UselessAssign:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_assign.cr#L29" target="_blank">View source</a>]
</div>
</div>
@ -1086,6 +1095,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_assign.cr#L40" target="_blank">View source</a>]
</div>
</div>
@ -1100,6 +1111,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_assign.cr#L36" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UselessConditionInWhen - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Lint::UselessConditionInWhen - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,7 +579,7 @@ where it is guaranteed to always return the same result.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">case</span>
<pre><code><span class="k">case</span>
<span class="k">when</span> utc?
io <span class="o">&lt;&lt;</span> <span class="s">&quot; UTC&quot;</span>
<span class="k">when</span> local?
@ -588,7 +588,7 @@ where it is guaranteed to always return the same result.</p>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">case</span>
<pre><code><span class="k">case</span>
<span class="k">when</span> utc?
io <span class="o">&lt;&lt;</span> <span class="s">&quot; UTC&quot;</span>
<span class="k">when</span> local?
@ -597,8 +597,8 @@ where it is guaranteed to always return the same result.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UselessConditionInWhen:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UselessConditionInWhen:
Enabled: true</span></code></pre>
@ -638,6 +638,13 @@ where it is guaranteed to always return the same result.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_condition_in_when.cr#L34" target="_blank">
ameba/rule/lint/useless_condition_in_when.cr
</a>
<br/>
@ -926,7 +933,7 @@ where it is guaranteed to always return the same result.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">case</span>
<pre><code><span class="k">case</span>
<span class="k">when</span> utc?
io <span class="o">&lt;&lt;</span> <span class="s">&quot; UTC&quot;</span>
<span class="k">when</span> local?
@ -935,7 +942,7 @@ where it is guaranteed to always return the same result.</p>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">case</span>
<pre><code><span class="k">case</span>
<span class="k">when</span> utc?
io <span class="o">&lt;&lt;</span> <span class="s">&quot; UTC&quot;</span>
<span class="k">when</span> local?
@ -944,13 +951,15 @@ where it is guaranteed to always return the same result.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Lint/UselessConditionInWhen:
Enabled: true</code></pre>
<pre><code><span class="t">Lint</span><span class="s">/UselessConditionInWhen:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_condition_in_when.cr#L34" target="_blank">View source</a>]
</div>
</div>
@ -1091,6 +1100,8 @@ where it is guaranteed to always return the same result.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/lint/useless_condition_in_when.cr#L54" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Metrics - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Metrics - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -585,6 +585,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/metrics/cyclomatic_complexity.cr#L1" target="_blank">
ameba/rule/metrics/cyclomatic_complexity.cr
</a>
<br/>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Metrics::CyclomaticComplexity - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Metrics::CyclomaticComplexity - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,9 +578,9 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Metrics/CyclomaticComplexity:
<pre><code><span class="t">Metrics</span><span class="s">/CyclomaticComplexity:
Enabled: true
MaxComplexity: 10</code></pre>
MaxComplexity: 10</span></code></pre>
@ -620,6 +620,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/metrics/cyclomatic_complexity.cr#L12" target="_blank">
ameba/rule/metrics/cyclomatic_complexity.cr
</a>
<br/>
@ -917,14 +924,16 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Metrics/CyclomaticComplexity:
<pre><code><span class="t">Metrics</span><span class="s">/CyclomaticComplexity:
Enabled: true
MaxComplexity: 10</code></pre>
MaxComplexity: 10</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/metrics/cyclomatic_complexity.cr#L12" target="_blank">View source</a>]
</div>
</div>
@ -1093,6 +1102,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/metrics/cyclomatic_complexity.cr#L20" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Performance - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Performance - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -585,6 +585,27 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/any_after_filter.cr#L1" target="_blank">
ameba/rule/performance/any_after_filter.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/first_last_after_filter.cr#L1" target="_blank">
ameba/rule/performance/first_last_after_filter.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/size_after_filter.cr#L1" target="_blank">
ameba/rule/performance/size_after_filter.cr
</a>
<br/>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Performance::AnyAfterFilter - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Performance::AnyAfterFilter - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,21 +578,21 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.any?
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.any?
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].reject { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;=</span> <span class="n">2</span> }.any?</code></pre>
<p>And it should be written as this:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&lt;</span> <span class="n">2</span> }</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/AnyAfterFilter:
<pre><code><span class="t">Performance</span><span class="s">/AnyAfterFilter:
Enabled: true
FilterNames:
- select
- reject</code></pre>
- reject</span></code></pre>
@ -632,6 +632,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/any_after_filter.cr#L28" target="_blank">
ameba/rule/performance/any_after_filter.cr
</a>
<br/>
@ -934,26 +941,28 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.any?
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.any?
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].reject { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;=</span> <span class="n">2</span> }.any?</code></pre>
<p>And it should be written as this:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].any? { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&lt;</span> <span class="n">2</span> }</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/AnyAfterFilter:
<pre><code><span class="t">Performance</span><span class="s">/AnyAfterFilter:
Enabled: true
FilterNames:
- select
- reject</code></pre>
- reject</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/any_after_filter.cr#L28" target="_blank">View source</a>]
</div>
</div>
@ -1122,6 +1131,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/any_after_filter.cr#L37" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Performance::FirstLastAfterFilter - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Performance::FirstLastAfterFilter - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,20 +578,20 @@
<p>For example, this is considered inefficient:</p>
<pre><code class="language-crystal">[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.first?
<pre><code>[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.first?
[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.last?</code></pre>
<p>And can be written as this:</p>
<pre><code class="language-crystal">[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }
<pre><code>[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }
[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].reverse_each.find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/FirstLastAfterFilter
<pre><code><span class="t">Performance</span><span class="s">/FirstLastAfterFilter
Enabled: true
FilterNames:
- select</code></pre>
- select</span></code></pre>
@ -631,6 +631,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/first_last_after_filter.cr#L27" target="_blank">
ameba/rule/performance/first_last_after_filter.cr
</a>
<br/>
@ -943,25 +950,27 @@
<p>For example, this is considered inefficient:</p>
<pre><code class="language-crystal">[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.first?
<pre><code>[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.first?
[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }.last?</code></pre>
<p>And can be written as this:</p>
<pre><code class="language-crystal">[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }
<pre><code>[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }
[<span class="n">-1</span>, <span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].reverse_each.find { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">0</span> }</code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/FirstLastAfterFilter
<pre><code><span class="t">Performance</span><span class="s">/FirstLastAfterFilter
Enabled: true
FilterNames:
- select</code></pre>
- select</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/first_last_after_filter.cr#L27" target="_blank">View source</a>]
</div>
</div>
@ -1130,6 +1139,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/first_last_after_filter.cr#L46" target="_blank">View source</a>]
</div>
</div>
@ -1144,6 +1155,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/first_last_after_filter.cr#L37" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Performance::SizeAfterFilter - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Performance::SizeAfterFilter - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.size
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.size
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].reject { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&lt;</span> <span class="n">2</span> }.size
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span>(<span class="o">&amp;</span>.<span class="o">&lt;</span> <span class="n">2</span>).size
[<span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span>(<span class="o">&amp;</span>.zero?).size
@ -586,7 +586,7 @@
<p>And it should be written as this:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;=</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count(<span class="o">&amp;</span>.<span class="o">&lt;</span> <span class="n">2</span>)
[<span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].count(<span class="o">&amp;</span>.zero?)
@ -594,11 +594,11 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/SizeAfterFilter:
<pre><code><span class="t">Performance</span><span class="s">/SizeAfterFilter:
Enabled: true
FilterNames:
- select
- reject</code></pre>
- reject</span></code></pre>
@ -638,6 +638,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/size_after_filter.cr#L34" target="_blank">
ameba/rule/performance/size_after_filter.cr
</a>
<br/>
@ -945,7 +952,7 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.size
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span> { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }.size
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].reject { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&lt;</span> <span class="n">2</span> }.size
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].<span class="k">select</span>(<span class="o">&amp;</span>.<span class="o">&lt;</span> <span class="n">2</span>).size
[<span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].<span class="k">select</span>(<span class="o">&amp;</span>.zero?).size
@ -953,7 +960,7 @@
<p>And it should be written as this:</p>
<pre><code class="language-crystal">[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
<pre><code>[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count { <span class="o">|</span>e<span class="o">|</span> e <span class="o">&gt;=</span> <span class="n">2</span> }
[<span class="n">1</span>, <span class="n">2</span>, <span class="n">3</span>].count(<span class="o">&amp;</span>.<span class="o">&lt;</span> <span class="n">2</span>)
[<span class="n">0</span>, <span class="n">1</span>, <span class="n">2</span>].count(<span class="o">&amp;</span>.zero?)
@ -961,16 +968,18 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Performance/SizeAfterFilter:
<pre><code><span class="t">Performance</span><span class="s">/SizeAfterFilter:
Enabled: true
FilterNames:
- select
- reject</code></pre>
- reject</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/size_after_filter.cr#L34" target="_blank">View source</a>]
</div>
</div>
@ -1139,6 +1148,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/size_after_filter.cr#L52" target="_blank">View source</a>]
</div>
</div>
@ -1153,6 +1164,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/performance/size_after_filter.cr#L43" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -585,6 +585,97 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/constant_names.cr#L1" target="_blank">
ameba/rule/style/constant_names.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/is_a_nil.cr#L1" target="_blank">
ameba/rule/style/is_a_nil.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/large_numbers.cr#L1" target="_blank">
ameba/rule/style/large_numbers.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/method_names.cr#L1" target="_blank">
ameba/rule/style/method_names.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/negated_conditions_in_unless.cr#L1" target="_blank">
ameba/rule/style/negated_conditions_in_unless.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/predicate_name.cr#L1" target="_blank">
ameba/rule/style/predicate_name.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_begin.cr#L1" target="_blank">
ameba/rule/style/redundant_begin.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_next.cr#L1" target="_blank">
ameba/rule/style/redundant_next.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_return.cr#L1" target="_blank">
ameba/rule/style/redundant_return.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L1" target="_blank">
ameba/rule/style/type_names.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/unless_else.cr#L1" target="_blank">
ameba/rule/style/unless_else.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L1" target="_blank">
ameba/rule/style/variable_names.cr
</a>
<br/>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/while_true.cr#L1" target="_blank">
ameba/rule/style/while_true.cr
</a>
<br/>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::ConstantNames - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::ConstantNames - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,18 +578,18 @@
<p>For example, these constant names are considered valid:</p>
<pre><code class="language-crystal"><span class="t">LUCKY_NUMBERS</span> <span class="o">=</span> [<span class="n">3</span>, <span class="n">7</span>, <span class="n">11</span>]
<pre><code><span class="t">LUCKY_NUMBERS</span> <span class="o">=</span> [<span class="n">3</span>, <span class="n">7</span>, <span class="n">11</span>]
<span class="t">DOCUMENTATION_URL</span> <span class="o">=</span> <span class="s">&quot;http://crystal-lang.org/docs&quot;</span></code></pre>
<p>And these are invalid names:</p>
<pre><code class="language-crystal">myBadConstant <span class="o">=</span> <span class="n">1</span>
<pre><code>myBadConstant <span class="o">=</span> <span class="n">1</span>
<span class="t">Wrong_NAME</span> <span class="o">=</span> <span class="n">2</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/ConstantNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/ConstantNames:
Enabled: true</span></code></pre>
@ -629,6 +629,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/constant_names.cr#L25" target="_blank">
ameba/rule/style/constant_names.cr
</a>
<br/>
@ -916,23 +923,25 @@
<p>For example, these constant names are considered valid:</p>
<pre><code class="language-crystal"><span class="t">LUCKY_NUMBERS</span> <span class="o">=</span> [<span class="n">3</span>, <span class="n">7</span>, <span class="n">11</span>]
<pre><code><span class="t">LUCKY_NUMBERS</span> <span class="o">=</span> [<span class="n">3</span>, <span class="n">7</span>, <span class="n">11</span>]
<span class="t">DOCUMENTATION_URL</span> <span class="o">=</span> <span class="s">&quot;http://crystal-lang.org/docs&quot;</span></code></pre>
<p>And these are invalid names:</p>
<pre><code class="language-crystal">myBadConstant <span class="o">=</span> <span class="n">1</span>
<pre><code>myBadConstant <span class="o">=</span> <span class="n">1</span>
<span class="t">Wrong_NAME</span> <span class="o">=</span> <span class="n">2</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/ConstantNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/ConstantNames:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/constant_names.cr#L25" target="_blank">View source</a>]
</div>
</div>
@ -1073,6 +1082,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/constant_names.cr#L32" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::IsANil - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::IsANil - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,16 +578,16 @@
<p>This is considered bad:</p>
<pre><code class="language-crystal">var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
<pre><code>var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
<p>And needs to be written as:</p>
<pre><code class="language-crystal">var.<span class="k">nil?</span></code></pre>
<pre><code>var.<span class="k">nil?</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/IsANil:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/IsANil:
Enabled: true</span></code></pre>
@ -627,6 +627,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">
ameba/rule/style/is_a_nil.cr
</a>
<br/>
@ -919,21 +926,23 @@
<p>This is considered bad:</p>
<pre><code class="language-crystal">var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
<pre><code>var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
<p>And needs to be written as:</p>
<pre><code class="language-crystal">var.<span class="k">nil?</span></code></pre>
<pre><code>var.<span class="k">nil?</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/IsANil:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/IsANil:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">View source</a>]
</div>
</div>
@ -1074,6 +1083,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/is_a_nil.cr#L31" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::LargeNumbers - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::LargeNumbers - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -580,21 +580,21 @@ large numbers more easily.</p>
<p>For example, these are considered invalid:</p>
<pre><code class="language-crystal"><span class="n">10000</span>
<pre><code><span class="n">10000</span>
<span class="n">141592654</span>
<span class="n">5.12345</span></code></pre>
<p>And has to be rewritten as the following:</p>
<pre><code class="language-crystal"><span class="n">10_000</span>
<pre><code><span class="n">10_000</span>
<span class="n">141_592_654</span>
<span class="n">5.123_45</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/LargeNumbers:
<pre><code><span class="t">Style</span><span class="s">/LargeNumbers:
Enabled: true
IntMinDigits: 5 # i.e. integers higher than 9999</code></pre>
IntMinDigits: 5 # i.e. integers higher than 9999</span></code></pre>
@ -634,6 +634,13 @@ large numbers more easily.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">
ameba/rule/style/large_numbers.cr
</a>
<br/>
@ -933,26 +940,28 @@ large numbers more easily.</p>
<p>For example, these are considered invalid:</p>
<pre><code class="language-crystal"><span class="n">10000</span>
<pre><code><span class="n">10000</span>
<span class="n">141592654</span>
<span class="n">5.12345</span></code></pre>
<p>And has to be rewritten as the following:</p>
<pre><code class="language-crystal"><span class="n">10_000</span>
<pre><code><span class="n">10_000</span>
<span class="n">141_592_654</span>
<span class="n">5.123_45</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/LargeNumbers:
<pre><code><span class="t">Style</span><span class="s">/LargeNumbers:
Enabled: true
IntMinDigits: 5 # i.e. integers higher than 9999</code></pre>
IntMinDigits: 5 # i.e. integers higher than 9999</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">View source</a>]
</div>
</div>
@ -1121,6 +1130,8 @@ large numbers more easily.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/large_numbers.cr#L39" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::MethodNames - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::MethodNames - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, these are considered valid:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">Person</span>
<pre><code><span class="k">class</span> <span class="t">Person</span>
<span class="k">def</span> <span class="m">first_name</span>
<span class="k">end</span>
@ -591,7 +591,7 @@
<p>And these are invalid method names:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">Person</span>
<pre><code><span class="k">class</span> <span class="t">Person</span>
<span class="k">def</span> <span class="m">firstName</span>
<span class="k">end</span>
@ -604,8 +604,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/MethodNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/MethodNames:
Enabled: true</span></code></pre>
@ -645,6 +645,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/method_names.cr#L41" target="_blank">
ameba/rule/style/method_names.cr
</a>
<br/>
@ -932,7 +939,7 @@
<p>For example, these are considered valid:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">Person</span>
<pre><code><span class="k">class</span> <span class="t">Person</span>
<span class="k">def</span> <span class="m">first_name</span>
<span class="k">end</span>
@ -945,7 +952,7 @@
<p>And these are invalid method names:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">Person</span>
<pre><code><span class="k">class</span> <span class="t">Person</span>
<span class="k">def</span> <span class="m">firstName</span>
<span class="k">end</span>
@ -958,13 +965,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/MethodNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/MethodNames:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/method_names.cr#L41" target="_blank">View source</a>]
</div>
</div>
@ -1105,6 +1114,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/method_names.cr#L48" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::NegatedConditionsInUnless - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::NegatedConditionsInUnless - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,13 +578,13 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">unless</span> <span class="o">!</span>s.empty?
<pre><code><span class="k">unless</span> <span class="o">!</span>s.empty?
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
<p>And should be rewritten to the following:</p>
<pre><code class="language-crystal"><span class="k">if</span> s.emtpy?
<pre><code><span class="k">if</span> s.emtpy?
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
@ -593,8 +593,8 @@ that is executed if a negated condition is NOT met.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/NegatedConditionsInUnless:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/NegatedConditionsInUnless:
Enabled: true</span></code></pre>
@ -634,6 +634,13 @@ that is executed if a negated condition is NOT met.</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">
ameba/rule/style/negated_conditions_in_unless.cr
</a>
<br/>
@ -921,13 +928,13 @@ that is executed if a negated condition is NOT met.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">unless</span> <span class="o">!</span>s.empty?
<pre><code><span class="k">unless</span> <span class="o">!</span>s.empty?
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
<p>And should be rewritten to the following:</p>
<pre><code class="language-crystal"><span class="k">if</span> s.emtpy?
<pre><code><span class="k">if</span> s.emtpy?
<span class="n">:ok</span>
<span class="k">end</span></code></pre>
@ -936,13 +943,15 @@ that is executed if a negated condition is NOT met.</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/NegatedConditionsInUnless:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/NegatedConditionsInUnless:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">View source</a>]
</div>
</div>
@ -1083,6 +1092,8 @@ that is executed if a negated condition is NOT met.</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/negated_conditions_in_unless.cr#L37" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::PredicateName - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::PredicateName - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -579,7 +579,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>Favour these:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">valid?</span>(x)
<pre><code><span class="k">def</span> <span class="m">valid?</span>(x)
<span class="k">end</span>
<span class="k">def</span> <span class="m">picture?</span>(x)
@ -587,7 +587,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>Over these:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">is_valid?</span>(x)
<pre><code><span class="k">def</span> <span class="m">is_valid?</span>(x)
<span class="k">end</span>
<span class="k">def</span> <span class="m">has_picture?</span>(x)
@ -595,8 +595,8 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/PredicateName:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/PredicateName:
Enabled: true</span></code></pre>
@ -636,6 +636,13 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">
ameba/rule/style/predicate_name.cr
</a>
<br/>
@ -924,7 +931,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>Favour these:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">valid?</span>(x)
<pre><code><span class="k">def</span> <span class="m">valid?</span>(x)
<span class="k">end</span>
<span class="k">def</span> <span class="m">picture?</span>(x)
@ -932,7 +939,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>Over these:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">is_valid?</span>(x)
<pre><code><span class="k">def</span> <span class="m">is_valid?</span>(x)
<span class="k">end</span>
<span class="k">def</span> <span class="m">has_picture?</span>(x)
@ -940,13 +947,15 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/PredicateName:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/PredicateName:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">View source</a>]
</div>
</div>
@ -1087,6 +1096,8 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/predicate_name.cr#L40" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantBegin - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantBegin - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -582,7 +582,7 @@
<p>For example, this:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
<span class="k">begin</span>
read_content
<span class="k">rescue</span>
@ -592,7 +592,7 @@
<p>should be rewritten as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
read_content
<span class="k">rescue</span>
close_file
@ -602,7 +602,7 @@
<p>For example this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
<span class="k">begin</span>
a <span class="o">=</span> <span class="n">1</span>
b <span class="o">=</span> <span class="n">2</span>
@ -611,15 +611,15 @@
<p>and has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
a <span class="o">=</span> <span class="n">1</span>
b <span class="o">=</span> <span class="n">2</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/RedundantBegin:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/RedundantBegin:
Enabled: true</span></code></pre>
@ -661,6 +661,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">
ameba/rule/style/redundant_begin.cr
</a>
<br/>
@ -1006,7 +1013,7 @@
<p>For example, this:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
<span class="k">begin</span>
read_content
<span class="k">rescue</span>
@ -1016,7 +1023,7 @@
<p>should be rewritten as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
read_content
<span class="k">rescue</span>
close_file
@ -1026,7 +1033,7 @@
<p>For example this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
<span class="k">begin</span>
a <span class="o">=</span> <span class="n">1</span>
b <span class="o">=</span> <span class="n">2</span>
@ -1035,20 +1042,22 @@
<p>and has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
a <span class="o">=</span> <span class="n">1</span>
b <span class="o">=</span> <span class="n">2</span>
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/RedundantBegin:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/RedundantBegin:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">View source</a>]
</div>
</div>
@ -1189,6 +1198,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_begin.cr#L67" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantNext - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantNext - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -581,11 +581,11 @@ into the node which is the last in a block.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">next</span> v <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">case</span> v
<span class="k">when</span> .<span class="k">nil?</span>
<span class="k">next</span> <span class="s">&quot;nil&quot;</span>
@ -598,11 +598,11 @@ into the node which is the last in a block.</p>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
v <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="s">&quot;nil&quot;</span>
@ -624,13 +624,13 @@ into the node which is the last in a block.</p>
<p>Allows end-user to configure whether to report or not the next statements
which yield tuple literals i.e.</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
<span class="k">next</span> a, b
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the block above will be forced to be written as:</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
{a, b}
<span class="k">end</span></code></pre>
@ -639,14 +639,14 @@ which yield tuple literals i.e.</p>
<p>Allows end-user to configure whether to report or not the next statements
without arguments. Sometimes such statements are used to yild the <code>nil</code> value explicitly.</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="k">next</span>
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the block above will be forced to be written as:</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="n">nil</span>
<span class="k">end</span></code></pre>
@ -657,10 +657,10 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
</svg>
</a>YAML config example</h3>
<pre><code class="language-crystal">Style/RedundantNext:
<pre><code><span class="t">Style</span><span class="s">/RedundantNext:
Enabled: true
AllowMultiNext: true
AllowEmptyNext: true</code></pre>
AllowEmptyNext: true</span></code></pre>
@ -700,6 +700,13 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">
ameba/rule/style/redundant_next.cr
</a>
<br/>
@ -1015,11 +1022,11 @@ into the node which is the last in a block.</p>
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">next</span> v <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">case</span> v
<span class="k">when</span> .<span class="k">nil?</span>
<span class="k">next</span> <span class="s">&quot;nil&quot;</span>
@ -1032,11 +1039,11 @@ into the node which is the last in a block.</p>
<p>And has to be written as the following:</p>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
v <span class="o">+</span> <span class="n">1</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal">block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="s">&quot;nil&quot;</span>
@ -1058,13 +1065,13 @@ into the node which is the last in a block.</p>
<p>Allows end-user to configure whether to report or not the next statements
which yield tuple literals i.e.</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
<span class="k">next</span> a, b
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the block above will be forced to be written as:</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
{a, b}
<span class="k">end</span></code></pre>
@ -1073,14 +1080,14 @@ which yield tuple literals i.e.</p>
<p>Allows end-user to configure whether to report or not the next statements
without arguments. Sometimes such statements are used to yild the <code>nil</code> value explicitly.</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="k">next</span>
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the block above will be forced to be written as:</p>
<pre><code class="language-crystal">block <span class="k">do</span>
<pre><code>block <span class="k">do</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="n">nil</span>
<span class="k">end</span></code></pre>
@ -1091,15 +1098,17 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
</svg>
</a>YAML config example</h3>
<pre><code class="language-crystal">Style/RedundantNext:
<pre><code><span class="t">Style</span><span class="s">/RedundantNext:
Enabled: true
AllowMultiNext: true
AllowEmptyNext: true</code></pre>
AllowEmptyNext: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">View source</a>]
</div>
</div>
@ -1296,6 +1305,8 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_next.cr#L112" target="_blank">View source</a>]
</div>
</div>
@ -1310,6 +1321,8 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_next.cr#L108" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantReturn - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::RedundantReturn - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,11 +578,11 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
<pre><code><span class="k">def</span> <span class="m">foo</span>
<span class="k">return</span> <span class="n">:bar</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">bar</span>(arg)
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="k">return</span> <span class="s">&quot;nil&quot;</span>
@ -595,11 +595,11 @@
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
<pre><code><span class="k">def</span> <span class="m">foo</span>
<span class="n">:bar</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">bar</span>(arg)
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="s">&quot;nil&quot;</span>
@ -621,13 +621,13 @@
<p>Allows end-user to configure whether to report or not the return statements
which return tuple literals i.e.</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
<span class="k">return</span> a, b
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the method above has to be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
{a, b}
<span class="k">end</span></code></pre>
@ -636,14 +636,14 @@ which return tuple literals i.e.</p>
<p>Allows end-user to configure whether to report or not the return statements
without arguments. Sometimes such returns are used to return the <code>nil</code> value explicitly.</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="k">return</span>
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the method above has to be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="n">nil</span>
<span class="k">end</span></code></pre>
@ -654,10 +654,10 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
</svg>
</a>YAML config example</h3>
<pre><code class="language-crystal">Style/RedundantReturn:
<pre><code><span class="t">Style</span><span class="s">/RedundantReturn:
Enabled: true
AllowMutliReturn: true
AllowEmptyReturn: true</code></pre>
AllowEmptyReturn: true</span></code></pre>
@ -697,6 +697,13 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">
ameba/rule/style/redundant_return.cr
</a>
<br/>
@ -1009,11 +1016,11 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
<pre><code><span class="k">def</span> <span class="m">foo</span>
<span class="k">return</span> <span class="n">:bar</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">bar</span>(arg)
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="k">return</span> <span class="s">&quot;nil&quot;</span>
@ -1026,11 +1033,11 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
<p>And has to be written as the following:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
<pre><code><span class="k">def</span> <span class="m">foo</span>
<span class="n">:bar</span>
<span class="k">end</span></code></pre>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">bar</span>(arg)
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
<span class="k">case</span> arg
<span class="k">when</span> .<span class="k">nil?</span>
<span class="s">&quot;nil&quot;</span>
@ -1052,13 +1059,13 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
<p>Allows end-user to configure whether to report or not the return statements
which return tuple literals i.e.</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
<span class="k">return</span> a, b
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the method above has to be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
<pre><code><span class="k">def</span> <span class="m">method</span>(a, b)
{a, b}
<span class="k">end</span></code></pre>
@ -1067,14 +1074,14 @@ which return tuple literals i.e.</p>
<p>Allows end-user to configure whether to report or not the return statements
without arguments. Sometimes such returns are used to return the <code>nil</code> value explicitly.</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="k">return</span>
<span class="k">end</span></code></pre>
<p>If this param equals to <code>false</code>, the method above has to be written as:</p>
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
<pre><code><span class="k">def</span> <span class="m">method</span>
@foo <span class="o">=</span> <span class="n">:empty</span>
<span class="n">nil</span>
<span class="k">end</span></code></pre>
@ -1085,15 +1092,17 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
</svg>
</a>YAML config example</h3>
<pre><code class="language-crystal">Style/RedundantReturn:
<pre><code><span class="t">Style</span><span class="s">/RedundantReturn:
Enabled: true
AllowMutliReturn: true
AllowEmptyReturn: true</code></pre>
AllowEmptyReturn: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">View source</a>]
</div>
</div>
@ -1290,6 +1299,8 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_return.cr#L109" target="_blank">View source</a>]
</div>
</div>
@ -1304,6 +1315,8 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/redundant_return.cr#L105" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::TypeNames - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::TypeNames - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, these are considered valid:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">ParseError</span> <span class="o">&lt;</span> <span class="t">Exception</span>
<pre><code><span class="k">class</span> <span class="t">ParseError</span> <span class="o">&lt;</span> <span class="t">Exception</span>
<span class="k">end</span>
<span class="k">module</span> <span class="t">HTTP</span>
@ -599,7 +599,7 @@
<p>And these are invalid type names</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">My_class</span>
<pre><code><span class="k">class</span> <span class="t">My_class</span>
<span class="k">end</span>
<span class="k">module</span> <span class="t">HTT_p</span>
@ -618,8 +618,8 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/TypeNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/TypeNames:
Enabled: true</span></code></pre>
@ -659,6 +659,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L55" target="_blank">
ameba/rule/style/type_names.cr
</a>
<br/>
@ -966,7 +973,7 @@
<p>For example, these are considered valid:</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">ParseError</span> <span class="o">&lt;</span> <span class="t">Exception</span>
<pre><code><span class="k">class</span> <span class="t">ParseError</span> <span class="o">&lt;</span> <span class="t">Exception</span>
<span class="k">end</span>
<span class="k">module</span> <span class="t">HTTP</span>
@ -987,7 +994,7 @@
<p>And these are invalid type names</p>
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">My_class</span>
<pre><code><span class="k">class</span> <span class="t">My_class</span>
<span class="k">end</span>
<span class="k">module</span> <span class="t">HTT_p</span>
@ -1006,13 +1013,15 @@
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/TypeNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/TypeNames:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L55" target="_blank">View source</a>]
</div>
</div>
@ -1153,6 +1162,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L70" target="_blank">View source</a>]
</div>
</div>
@ -1167,6 +1178,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L74" target="_blank">View source</a>]
</div>
</div>
@ -1181,6 +1194,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L78" target="_blank">View source</a>]
</div>
</div>
@ -1195,6 +1210,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L82" target="_blank">View source</a>]
</div>
</div>
@ -1209,6 +1226,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/type_names.cr#L86" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::UnlessElse - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::UnlessElse - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,7 +578,7 @@
<p>For example, the rule considers these valid:</p>
<pre><code class="language-crystal"><span class="k">unless</span> something
<pre><code><span class="k">unless</span> something
<span class="n">:ok</span>
<span class="k">end</span>
@ -590,7 +590,7 @@
<p>But it considers this one invalid as it is an <code>unless</code> with an <code>else</code>:</p>
<pre><code class="language-crystal"><span class="k">unless</span> something
<pre><code><span class="k">unless</span> something
<span class="n">:one</span>
<span class="k">else</span>
<span class="n">:two</span>
@ -599,7 +599,7 @@
<p>The solution is to swap the order of the blocks, and change the <code>unless</code> to
an <code>if</code>, so the previous invalid example would become this:</p>
<pre><code class="language-crystal"><span class="k">if</span> something
<pre><code><span class="k">if</span> something
<span class="n">:two</span>
<span class="k">else</span>
<span class="n">:one</span>
@ -607,8 +607,8 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/UnlessElse:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/UnlessElse:
Enabled: true</span></code></pre>
@ -648,6 +648,13 @@ an <code>if</code>, so the previous invalid example would become this:</p>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/unless_else.cr#L46" target="_blank">
ameba/rule/style/unless_else.cr
</a>
<br/>
@ -935,7 +942,7 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<p>For example, the rule considers these valid:</p>
<pre><code class="language-crystal"><span class="k">unless</span> something
<pre><code><span class="k">unless</span> something
<span class="n">:ok</span>
<span class="k">end</span>
@ -947,7 +954,7 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<p>But it considers this one invalid as it is an <code>unless</code> with an <code>else</code>:</p>
<pre><code class="language-crystal"><span class="k">unless</span> something
<pre><code><span class="k">unless</span> something
<span class="n">:one</span>
<span class="k">else</span>
<span class="n">:two</span>
@ -956,7 +963,7 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<p>The solution is to swap the order of the blocks, and change the <code>unless</code> to
an <code>if</code>, so the previous invalid example would become this:</p>
<pre><code class="language-crystal"><span class="k">if</span> something
<pre><code><span class="k">if</span> something
<span class="n">:two</span>
<span class="k">else</span>
<span class="n">:one</span>
@ -964,13 +971,15 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/UnlessElse:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/UnlessElse:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/unless_else.cr#L46" target="_blank">View source</a>]
</div>
</div>
@ -1111,6 +1120,8 @@ an <code>if</code>, so the previous invalid example would become this:</p>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/unless_else.cr#L53" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::VariableNames - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::VariableNames - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,19 +578,19 @@
<p>For example, these variable names are considered valid:</p>
<pre><code class="language-crystal">var_name <span class="o">=</span> <span class="n">1</span>
<pre><code>var_name <span class="o">=</span> <span class="n">1</span>
name <span class="o">=</span> <span class="n">2</span>
_another_good_name <span class="o">=</span> <span class="n">3</span></code></pre>
<p>And these are invalid variable names:</p>
<pre><code class="language-crystal">myBadNamedVar <span class="o">=</span> <span class="n">1</span>
<pre><code>myBadNamedVar <span class="o">=</span> <span class="n">1</span>
wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/VariableNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/VariableNames:
Enabled: true</span></code></pre>
@ -630,6 +630,13 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L26" target="_blank">
ameba/rule/style/variable_names.cr
</a>
<br/>
@ -927,24 +934,26 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<p>For example, these variable names are considered valid:</p>
<pre><code class="language-crystal">var_name <span class="o">=</span> <span class="n">1</span>
<pre><code>var_name <span class="o">=</span> <span class="n">1</span>
name <span class="o">=</span> <span class="n">2</span>
_another_good_name <span class="o">=</span> <span class="n">3</span></code></pre>
<p>And these are invalid variable names:</p>
<pre><code class="language-crystal">myBadNamedVar <span class="o">=</span> <span class="n">1</span>
<pre><code>myBadNamedVar <span class="o">=</span> <span class="n">1</span>
wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/VariableNames:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/VariableNames:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L26" target="_blank">View source</a>]
</div>
</div>
@ -1085,6 +1094,8 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L39" target="_blank">View source</a>]
</div>
</div>
@ -1099,6 +1110,8 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L43" target="_blank">View source</a>]
</div>
</div>
@ -1113,6 +1126,8 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/variable_names.cr#L47" target="_blank">View source</a>]
</div>
</div>

View file

@ -3,28 +3,28 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Crystal Docs 0.35.1">
<meta name="crystal_docs.project_version" content="0.13.3-dev">
<meta name="generator" content="Crystal Docs 0.34.0">
<meta name="crystal_docs.project_version" content="master">
<meta name="crystal_docs.project_name" content="ameba">
<link href="../../../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../js/doc.js"></script>
<meta name="repository-name" content="ameba">
<title>Ameba::Rule::Style::WhileTrue - ameba 0.13.3-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<meta id="repository-name" content="ameba">
<title>Ameba::Rule::Style::WhileTrue - ameba master</title>
<script type="text/javascript">
CrystalDocs.base_path = "../../../";
</script>
</head>
<body>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
@ -39,12 +39,12 @@
</h1>
<span class="project-version">
0.13.3-dev
master
</span>
</div>
</div>
<div class="search-results hidden">
<div class="search-results" class="hidden">
<ul class="search-list"></ul>
</div>
@ -578,22 +578,22 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">while</span> <span class="n">true</span>
<pre><code><span class="k">while</span> <span class="n">true</span>
do_something
<span class="k">break</span> <span class="k">if</span> some_condition
<span class="k">end</span></code></pre>
<p>And should be replaced by the following:</p>
<pre><code class="language-crystal">loop <span class="k">do</span>
<pre><code>loop <span class="k">do</span>
do_something
<span class="k">break</span> <span class="k">if</span> some_condition
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/WhileTrue:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/WhileTrue:
Enabled: true</span></code></pre>
@ -633,6 +633,13 @@
Defined in:
</h2>
<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/while_true.cr#L29" target="_blank">
ameba/rule/style/while_true.cr
</a>
<br/>
@ -920,27 +927,29 @@
<p>For example, this is considered invalid:</p>
<pre><code class="language-crystal"><span class="k">while</span> <span class="n">true</span>
<pre><code><span class="k">while</span> <span class="n">true</span>
do_something
<span class="k">break</span> <span class="k">if</span> some_condition
<span class="k">end</span></code></pre>
<p>And should be replaced by the following:</p>
<pre><code class="language-crystal">loop <span class="k">do</span>
<pre><code>loop <span class="k">do</span>
do_something
<span class="k">break</span> <span class="k">if</span> some_condition
<span class="k">end</span></code></pre>
<p>YAML configuration example:</p>
<pre><code class="language-crystal">Style/WhileTrue:
Enabled: true</code></pre>
<pre><code><span class="t">Style</span><span class="s">/WhileTrue:
Enabled: true</span></code></pre>
</div>
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/while_true.cr#L29" target="_blank">View source</a>]
</div>
</div>
@ -1081,6 +1090,8 @@
<br/>
<div>
[<a href="https://github.com/crystal-ameba/ameba/blob/bedf3a68/src/ameba/rule/style/while_true.cr#L36" target="_blank">View source</a>]
</div>
</div>