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 @ b9bc5aaab2
🚀
This commit is contained in:
parent
41b26a705d
commit
71c7b49a44
129 changed files with 759 additions and 2359 deletions
|
@ -51,11 +51,6 @@
|
|||
<div class="types-list">
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="ameba/toplevel" data-name="top level namespace">
|
||||
<a href="../../../toplevel.html">Top Level Namespace</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="ameba/Ameba" data-name="ameba">
|
||||
<a href="../../../Ameba.html">Ameba</a>
|
||||
|
||||
|
@ -780,13 +775,12 @@
|
|||
</h2>
|
||||
|
||||
<p>This rule checks for mistyped shorthand assignments.</p>
|
||||
<pre><code class="language-crystal"><span class="c"># bad</span>
|
||||
x <span class="o">=</span><span class="o">-</span> y
|
||||
x <span class="o">=</span><span class="o">+</span> y
|
||||
x <span class="o">=</span><span class="o">!</span> y
|
||||
|
||||
<span class="c"># good</span>
|
||||
x <span class="o">-=</span> y <span class="c"># or x = -y</span>
|
||||
<p>This is considered invalid:</p>
|
||||
<pre><code class="language-crystal">x <span class="o">=</span> <span class="o">-</span>y
|
||||
x <span class="o">=</span> <span class="o">+</span>y
|
||||
x <span class="o">=</span> <span class="o">!</span>y</code></pre>
|
||||
<p>And this is valid:</p>
|
||||
<pre><code class="language-crystal">x <span class="o">-=</span> y <span class="c"># or x = -y</span>
|
||||
x <span class="o">+=</span> y <span class="c"># or x = +y</span>
|
||||
x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
||||
<p>YAML configuration example:</p>
|
||||
|
@ -834,7 +828,7 @@ x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/2cfbe97b/src/ameba/rule/lint/ambiguous_assignment.cr#L20" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/b9bc5aaa/src/ameba/rule/lint/ambiguous_assignment.cr#L26" target="_blank">
|
||||
ameba/rule/lint/ambiguous_assignment.cr
|
||||
</a>
|
||||
|
||||
|
@ -856,7 +850,7 @@ x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
|||
<dl>
|
||||
|
||||
<dt class="entry-const" id="MISTAKES">
|
||||
<strong>MISTAKES</strong> = <code>{<span class="s">"=-"</span> <span class="o">=></span> <span class="s">"-="</span>, <span class="s">"=+"</span> <span class="o">=></span> <span class="s">"+="</span>, <span class="s">"=!"</span> <span class="o">=></span> <span class="s">"!="</span>}</code>
|
||||
<strong>MISTAKES</strong> = <code>{<span class="s">"=-"</span>: <span class="s">"-="</span>, <span class="s">"=+"</span>: <span class="s">"+="</span>, <span class="s">"=!"</span>: <span class="s">"!="</span>}</code>
|
||||
</dt>
|
||||
|
||||
|
||||
|
@ -1223,13 +1217,12 @@ x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
|||
<div class="doc">
|
||||
|
||||
<p>This rule checks for mistyped shorthand assignments.</p>
|
||||
<pre><code class="language-crystal"><span class="c"># bad</span>
|
||||
x <span class="o">=</span><span class="o">-</span> y
|
||||
x <span class="o">=</span><span class="o">+</span> y
|
||||
x <span class="o">=</span><span class="o">!</span> y
|
||||
|
||||
<span class="c"># good</span>
|
||||
x <span class="o">-=</span> y <span class="c"># or x = -y</span>
|
||||
<p>This is considered invalid:</p>
|
||||
<pre><code class="language-crystal">x <span class="o">=</span> <span class="o">-</span>y
|
||||
x <span class="o">=</span> <span class="o">+</span>y
|
||||
x <span class="o">=</span> <span class="o">!</span>y</code></pre>
|
||||
<p>And this is valid:</p>
|
||||
<pre><code class="language-crystal">x <span class="o">-=</span> y <span class="c"># or x = -y</span>
|
||||
x <span class="o">+=</span> y <span class="c"># or x = +y</span>
|
||||
x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
||||
<p>YAML configuration example:</p>
|
||||
|
@ -1240,7 +1233,7 @@ x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/2cfbe97b/src/ameba/rule/lint/ambiguous_assignment.cr#L20" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/b9bc5aaa/src/ameba/rule/lint/ambiguous_assignment.cr#L26" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1421,7 +1414,7 @@ x <span class="o">!=</span> y <span class="c"># or x = !y</span></code></pre>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/2cfbe97b/src/ameba/rule/lint/ambiguous_assignment.cr#L35" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/b9bc5aaa/src/ameba/rule/lint/ambiguous_assignment.cr#L41" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue