mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Deploying to gh-pages from @ 51b0a07e81 🚀
This commit is contained in:
parent
2f03204df2
commit
8d0a0f7c6a
93 changed files with 1813 additions and 1813 deletions
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::ConstantNames - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,18 +578,18 @@
|
|||
|
||||
<p>For example, these constant names are considered valid:</p>
|
||||
|
||||
<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>]
|
||||
<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>]
|
||||
<span class="t">DOCUMENTATION_URL</span> <span class="o">=</span> <span class="s">"http://crystal-lang.org/docs"</span></code></pre>
|
||||
|
||||
<p>And these are invalid names:</p>
|
||||
|
||||
<pre><code>myBadConstant <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/ConstantNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/ConstantNames:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -630,7 +630,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/constant_names.cr#L25" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/constant_names.cr#L25" target="_blank">
|
||||
ameba/rule/style/constant_names.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -923,24 +923,24 @@
|
|||
|
||||
<p>For example, these constant names are considered valid:</p>
|
||||
|
||||
<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>]
|
||||
<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>]
|
||||
<span class="t">DOCUMENTATION_URL</span> <span class="o">=</span> <span class="s">"http://crystal-lang.org/docs"</span></code></pre>
|
||||
|
||||
<p>And these are invalid names:</p>
|
||||
|
||||
<pre><code>myBadConstant <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/ConstantNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/ConstantNames:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/constant_names.cr#L25" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/constant_names.cr#L25" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1082,7 +1082,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/constant_names.cr#L32" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/constant_names.cr#L32" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::IsANil - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,16 +578,16 @@
|
|||
|
||||
<p>This is considered bad:</p>
|
||||
|
||||
<pre><code>var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
|
||||
<pre><code class="language-crystal">var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
|
||||
|
||||
<p>And needs to be written as:</p>
|
||||
|
||||
<pre><code>var.<span class="k">nil?</span></code></pre>
|
||||
<pre><code class="language-crystal">var.<span class="k">nil?</span></code></pre>
|
||||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/IsANil:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/IsANil:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -628,7 +628,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">
|
||||
ameba/rule/style/is_a_nil.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -926,22 +926,22 @@
|
|||
|
||||
<p>This is considered bad:</p>
|
||||
|
||||
<pre><code>var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
|
||||
<pre><code class="language-crystal">var.<span class="k">is_a?</span> <span class="t">Nil</span></code></pre>
|
||||
|
||||
<p>And needs to be written as:</p>
|
||||
|
||||
<pre><code>var.<span class="k">nil?</span></code></pre>
|
||||
<pre><code class="language-crystal">var.<span class="k">nil?</span></code></pre>
|
||||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/IsANil:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/IsANil:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/is_a_nil.cr#L23" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1083,7 +1083,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/is_a_nil.cr#L31" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/is_a_nil.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::LargeNumbers - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results 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><span class="n">10000</span>
|
||||
<pre><code class="language-crystal"><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><span class="n">10_000</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/LargeNumbers:
|
||||
<pre><code class="language-crystal">Style/LargeNumbers:
|
||||
Enabled: true
|
||||
IntMinDigits: 5 # i.e. integers higher than 9999</span></code></pre>
|
||||
IntMinDigits: 5 # i.e. integers higher than 9999</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -635,7 +635,7 @@ large numbers more easily.</p>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">
|
||||
ameba/rule/style/large_numbers.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -940,27 +940,27 @@ large numbers more easily.</p>
|
|||
|
||||
<p>For example, these are considered invalid:</p>
|
||||
|
||||
<pre><code><span class="n">10000</span>
|
||||
<pre><code class="language-crystal"><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><span class="n">10_000</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/LargeNumbers:
|
||||
<pre><code class="language-crystal">Style/LargeNumbers:
|
||||
Enabled: true
|
||||
IntMinDigits: 5 # i.e. integers higher than 9999</span></code></pre>
|
||||
IntMinDigits: 5 # i.e. integers higher than 9999</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/large_numbers.cr#L30" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1130,7 +1130,7 @@ large numbers more easily.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/large_numbers.cr#L39" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/large_numbers.cr#L39" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::MethodNames - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,7 +578,7 @@
|
|||
|
||||
<p>For example, these are considered valid:</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">Person</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">class</span> <span class="t">Person</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/MethodNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/MethodNames:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -646,7 +646,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/method_names.cr#L41" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/method_names.cr#L41" target="_blank">
|
||||
ameba/rule/style/method_names.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -939,7 +939,7 @@
|
|||
|
||||
<p>For example, these are considered valid:</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">Person</span>
|
||||
<pre><code class="language-crystal"><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>
|
||||
|
||||
|
|
@ -952,7 +952,7 @@
|
|||
|
||||
<p>And these are invalid method names:</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">Person</span>
|
||||
<pre><code class="language-crystal"><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>
|
||||
|
||||
|
|
@ -965,14 +965,14 @@
|
|||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/MethodNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/MethodNames:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/method_names.cr#L41" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/method_names.cr#L41" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1114,7 +1114,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/method_names.cr#L48" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/method_names.cr#L48" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::NegatedConditionsInUnless - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,13 +578,13 @@
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">unless</span> <span class="o">!</span>s.empty?
|
||||
<pre><code class="language-crystal"><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><span class="k">if</span> s.emtpy?
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/NegatedConditionsInUnless:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/NegatedConditionsInUnless:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -635,7 +635,7 @@ that is executed if a negated condition is NOT met.</p>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">
|
||||
ameba/rule/style/negated_conditions_in_unless.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -928,13 +928,13 @@ that is executed if a negated condition is NOT met.</p>
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">unless</span> <span class="o">!</span>s.empty?
|
||||
<pre><code class="language-crystal"><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><span class="k">if</span> s.emtpy?
|
||||
<pre><code class="language-crystal"><span class="k">if</span> s.emtpy?
|
||||
<span class="n">:ok</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
|
|
@ -943,14 +943,14 @@ that is executed if a negated condition is NOT met.</p>
|
|||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/NegatedConditionsInUnless:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/NegatedConditionsInUnless:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/negated_conditions_in_unless.cr#L30" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1092,7 +1092,7 @@ that is executed if a negated condition is NOT met.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/negated_conditions_in_unless.cr#L37" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/negated_conditions_in_unless.cr#L37" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::PredicateName - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results 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><span class="k">def</span> <span class="m">valid?</span>(x)
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">is_valid?</span>(x)
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/PredicateName:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/PredicateName:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -637,7 +637,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">
|
||||
ameba/rule/style/predicate_name.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -931,7 +931,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
|
||||
<p>Favour these:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">valid?</span>(x)
|
||||
<pre><code class="language-crystal"><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)
|
||||
|
|
@ -939,7 +939,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
|
||||
<p>Over these:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">is_valid?</span>(x)
|
||||
<pre><code class="language-crystal"><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)
|
||||
|
|
@ -947,14 +947,14 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/PredicateName:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/PredicateName:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/predicate_name.cr#L32" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1096,7 +1096,7 @@ 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/d28f9f75/src/ameba/rule/style/predicate_name.cr#L40" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/predicate_name.cr#L40" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::RedundantBegin - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -582,7 +582,7 @@
|
|||
|
||||
<p>For example, this:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/RedundantBegin:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/RedundantBegin:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -662,7 +662,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">
|
||||
ameba/rule/style/redundant_begin.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -1013,7 +1013,7 @@
|
|||
|
||||
<p>For example, this:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
|
||||
<span class="k">begin</span>
|
||||
read_content
|
||||
<span class="k">rescue</span>
|
||||
|
|
@ -1023,7 +1023,7 @@
|
|||
|
||||
<p>should be rewritten as:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>
|
||||
read_content
|
||||
<span class="k">rescue</span>
|
||||
close_file
|
||||
|
|
@ -1033,7 +1033,7 @@
|
|||
|
||||
<p>For example this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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>
|
||||
|
|
@ -1042,21 +1042,21 @@
|
|||
|
||||
<p>and has to be written as the following:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/RedundantBegin:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/RedundantBegin:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_begin.cr#L59" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1198,7 +1198,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_begin.cr#L67" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_begin.cr#L67" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::RedundantNext - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results 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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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">"nil"</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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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">"nil"</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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/RedundantNext:
|
||||
<pre><code class="language-crystal">Style/RedundantNext:
|
||||
Enabled: true
|
||||
AllowMultiNext: true
|
||||
AllowEmptyNext: true</span></code></pre>
|
||||
AllowEmptyNext: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -701,7 +701,7 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">
|
||||
ameba/rule/style/redundant_next.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -1022,11 +1022,11 @@ into the node which is the last in a block.</p>
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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">"nil"</span>
|
||||
|
|
@ -1039,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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span> <span class="o">|</span>v<span class="o">|</span>
|
||||
<pre><code class="language-crystal">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">"nil"</span>
|
||||
|
|
@ -1065,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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">block <span class="k">do</span>
|
||||
{a, b}
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
|
|
@ -1080,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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>block <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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>
|
||||
|
|
@ -1098,16 +1098,16 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
|
|||
</svg>
|
||||
</a>YAML config example</h3>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/RedundantNext:
|
||||
<pre><code class="language-crystal">Style/RedundantNext:
|
||||
Enabled: true
|
||||
AllowMultiNext: true
|
||||
AllowEmptyNext: true</span></code></pre>
|
||||
AllowEmptyNext: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_next.cr#L99" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1305,7 +1305,7 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_next.cr#L112" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_next.cr#L112" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1321,7 +1321,7 @@ without arguments. Sometimes such statements are used to yild the <code>nil</cod
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_next.cr#L108" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_next.cr#L108" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::RedundantReturn - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,11 +578,11 @@
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">foo</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">bar</span>(arg)
|
||||
<pre><code class="language-crystal"><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">"nil"</span>
|
||||
|
|
@ -595,11 +595,11 @@
|
|||
|
||||
<p>And has to be written as the following:</p>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">foo</span>
|
||||
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
|
||||
<span class="n">:bar</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
|
||||
<pre><code class="language-crystal"><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">"nil"</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><span class="k">def</span> <span class="m">method</span>(a, b)
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>(a, b)
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/RedundantReturn:
|
||||
<pre><code class="language-crystal">Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMutliReturn: true
|
||||
AllowEmptyReturn: true</span></code></pre>
|
||||
AllowEmptyReturn: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -698,7 +698,7 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">
|
||||
ameba/rule/style/redundant_return.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -1016,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><span class="k">def</span> <span class="m">foo</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">bar</span>(arg)
|
||||
<pre><code class="language-crystal"><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">"nil"</span>
|
||||
|
|
@ -1033,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><span class="k">def</span> <span class="m">foo</span>
|
||||
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">foo</span>
|
||||
<span class="n">:bar</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<pre><code><span class="k">def</span> <span class="m">bar</span>(arg)
|
||||
<pre><code class="language-crystal"><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">"nil"</span>
|
||||
|
|
@ -1059,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><span class="k">def</span> <span class="m">method</span>(a, b)
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>(a, b)
|
||||
<pre><code class="language-crystal"><span class="k">def</span> <span class="m">method</span>(a, b)
|
||||
{a, b}
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
|
|
@ -1074,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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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><span class="k">def</span> <span class="m">method</span>
|
||||
<pre><code class="language-crystal"><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>
|
||||
|
|
@ -1092,16 +1092,16 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
|
|||
</svg>
|
||||
</a>YAML config example</h3>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/RedundantReturn:
|
||||
<pre><code class="language-crystal">Style/RedundantReturn:
|
||||
Enabled: true
|
||||
AllowMutliReturn: true
|
||||
AllowEmptyReturn: true</span></code></pre>
|
||||
AllowEmptyReturn: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_return.cr#L96" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1299,7 +1299,7 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_return.cr#L109" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_return.cr#L109" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1315,7 +1315,7 @@ without arguments. Sometimes such returns are used to return the <code>nil</code
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/redundant_return.cr#L105" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/redundant_return.cr#L105" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::TypeNames - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,7 +578,7 @@
|
|||
|
||||
<p>For example, these are considered valid:</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">ParseError</span> <span class="o"><</span> <span class="t">Exception</span>
|
||||
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">ParseError</span> <span class="o"><</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><span class="k">class</span> <span class="t">My_class</span>
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/TypeNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/TypeNames:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -660,7 +660,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L55" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L55" target="_blank">
|
||||
ameba/rule/style/type_names.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -973,7 +973,7 @@
|
|||
|
||||
<p>For example, these are considered valid:</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">ParseError</span> <span class="o"><</span> <span class="t">Exception</span>
|
||||
<pre><code class="language-crystal"><span class="k">class</span> <span class="t">ParseError</span> <span class="o"><</span> <span class="t">Exception</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
<span class="k">module</span> <span class="t">HTTP</span>
|
||||
|
|
@ -994,7 +994,7 @@
|
|||
|
||||
<p>And these are invalid type names</p>
|
||||
|
||||
<pre><code><span class="k">class</span> <span class="t">My_class</span>
|
||||
<pre><code class="language-crystal"><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>
|
||||
|
|
@ -1013,14 +1013,14 @@
|
|||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/TypeNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/TypeNames:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L55" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L55" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1162,7 +1162,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L70" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L70" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1178,7 +1178,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L74" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L74" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1194,7 +1194,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L78" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L78" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1210,7 +1210,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L82" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L82" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1226,7 +1226,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/type_names.cr#L86" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/type_names.cr#L86" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::UnlessElse - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,7 +578,7 @@
|
|||
|
||||
<p>For example, the rule considers these valid:</p>
|
||||
|
||||
<pre><code><span class="k">unless</span> something
|
||||
<pre><code class="language-crystal"><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><span class="k">unless</span> something
|
||||
<pre><code class="language-crystal"><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><span class="k">if</span> something
|
||||
<pre><code class="language-crystal"><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><span class="t">Style</span><span class="s">/UnlessElse:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/UnlessElse:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -649,7 +649,7 @@ an <code>if</code>, so the previous invalid example would become this:</p>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/unless_else.cr#L46" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/unless_else.cr#L46" target="_blank">
|
||||
ameba/rule/style/unless_else.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -942,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><span class="k">unless</span> something
|
||||
<pre><code class="language-crystal"><span class="k">unless</span> something
|
||||
<span class="n">:ok</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
|
|
@ -954,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><span class="k">unless</span> something
|
||||
<pre><code class="language-crystal"><span class="k">unless</span> something
|
||||
<span class="n">:one</span>
|
||||
<span class="k">else</span>
|
||||
<span class="n">:two</span>
|
||||
|
|
@ -963,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><span class="k">if</span> something
|
||||
<pre><code class="language-crystal"><span class="k">if</span> something
|
||||
<span class="n">:two</span>
|
||||
<span class="k">else</span>
|
||||
<span class="n">:one</span>
|
||||
|
|
@ -971,14 +971,14 @@ an <code>if</code>, so the previous invalid example would become this:</p>
|
|||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
<pre><code><span class="t">Style</span><span class="s">/UnlessElse:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/UnlessElse:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/unless_else.cr#L46" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/unless_else.cr#L46" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1120,7 +1120,7 @@ an <code>if</code>, so the previous invalid example would become this:</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/unless_else.cr#L53" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/unless_else.cr#L53" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::VariableNames - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,19 +578,19 @@
|
|||
|
||||
<p>For example, these variable names are considered valid:</p>
|
||||
|
||||
<pre><code>var_name <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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>myBadNamedVar <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/VariableNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/VariableNames:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -631,7 +631,7 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/variable_names.cr#L26" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/variable_names.cr#L26" target="_blank">
|
||||
ameba/rule/style/variable_names.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -934,25 +934,25 @@ 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>var_name <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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>myBadNamedVar <span class="o">=</span> <span class="n">1</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/VariableNames:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/VariableNames:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/variable_names.cr#L26" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/variable_names.cr#L26" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1094,7 +1094,7 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/variable_names.cr#L39" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/variable_names.cr#L39" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1110,7 +1110,7 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/variable_names.cr#L43" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/variable_names.cr#L43" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1126,7 +1126,7 @@ wrong_Name <span class="o">=</span> <span class="n">2</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/variable_names.cr#L47" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/variable_names.cr#L47" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,21 +3,16 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="generator" content="Crystal Docs 0.34.0">
|
||||
<meta name="generator" content="Crystal Docs 0.35.1">
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<meta name="repository-name" content="ameba">
|
||||
<title>Ameba::Rule::Style::WhileTrue - ameba master</title>
|
||||
<script type="text/javascript">
|
||||
CrystalDocs.base_path = "../../../";
|
||||
|
|
@ -25,6 +20,11 @@
|
|||
</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>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<div class="search-box">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-results" class="hidden">
|
||||
<div class="search-results hidden">
|
||||
<ul class="search-list"></ul>
|
||||
</div>
|
||||
|
||||
|
|
@ -578,22 +578,22 @@
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">while</span> <span class="n">true</span>
|
||||
<pre><code class="language-crystal"><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>loop <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/WhileTrue:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/WhileTrue:
|
||||
Enabled: true</code></pre>
|
||||
|
||||
|
||||
|
||||
|
|
@ -634,7 +634,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/while_true.cr#L29" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/while_true.cr#L29" target="_blank">
|
||||
ameba/rule/style/while_true.cr
|
||||
</a>
|
||||
|
||||
|
|
@ -927,28 +927,28 @@
|
|||
|
||||
<p>For example, this is considered invalid:</p>
|
||||
|
||||
<pre><code><span class="k">while</span> <span class="n">true</span>
|
||||
<pre><code class="language-crystal"><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>loop <span class="k">do</span>
|
||||
<pre><code class="language-crystal">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><span class="t">Style</span><span class="s">/WhileTrue:
|
||||
Enabled: true</span></code></pre>
|
||||
<pre><code class="language-crystal">Style/WhileTrue:
|
||||
Enabled: true</code></pre>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/while_true.cr#L29" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/while_true.cr#L29" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1090,7 +1090,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/d28f9f75/src/ameba/rule/style/while_true.cr#L36" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/51b0a07e/src/ameba/rule/style/while_true.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue