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 @ db5eee76cb
🚀
This commit is contained in:
parent
e38ddb7437
commit
3b4b740467
121 changed files with 733 additions and 743 deletions
|
@ -749,19 +749,14 @@
|
|||
Overview
|
||||
</h2>
|
||||
|
||||
<p>A rule that disallows tautological predicate names, meaning those that
|
||||
start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores if the alternative isn't valid Crystal code (e.g. <code>is_404?</code>).</p>
|
||||
<p>Favour these:</p>
|
||||
<p>A rule that disallows tautological predicate names -
|
||||
meaning those that start with the prefix <code>is_</code>, except for
|
||||
the ones that are not valid Crystal code (e.g. <code>is_404?</code>).</p>
|
||||
<p>Favour this:</p>
|
||||
<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)
|
||||
<span class="k">end</span></code></pre>
|
||||
<p>Over these:</p>
|
||||
<p>Over this:</p>
|
||||
<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)
|
||||
<span class="k">end</span></code></pre>
|
||||
<p>YAML configuration example:</p>
|
||||
<pre><code class="language-crystal"><span class="t">Style</span><span class="o">/</span><span class="t">PredicateName</span>:
|
||||
|
@ -806,7 +801,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/2811352c/src/ameba/rule/style/predicate_name.cr#L31" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/db5eee76/src/ameba/rule/style/predicate_name.cr#L26" target="_blank">
|
||||
ameba/rule/style/predicate_name.cr
|
||||
</a>
|
||||
|
||||
|
@ -854,7 +849,7 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
<li class="entry-summary">
|
||||
<a href="#new%28config%3Dnil%29-class-method" class="signature"><strong>.new</strong>(config = <span class="n">nil</span>)</a>
|
||||
|
||||
<div class="summary"><p>A rule that disallows tautological predicate names, meaning those that start with the prefix <code>has_</code> or the prefix <code>is_</code>.</p></div>
|
||||
<div class="summary"><p>A rule that disallows tautological predicate names - meaning those that start with the prefix <code>is_</code>, except for the ones that are not valid Crystal code (e.g.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -1086,19 +1081,14 @@ start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores
|
|||
|
||||
<div class="doc">
|
||||
|
||||
<p>A rule that disallows tautological predicate names, meaning those that
|
||||
start with the prefix <code>has_</code> or the prefix <code>is_</code>. Ignores if the alternative isn't valid Crystal code (e.g. <code>is_404?</code>).</p>
|
||||
<p>Favour these:</p>
|
||||
<p>A rule that disallows tautological predicate names -
|
||||
meaning those that start with the prefix <code>is_</code>, except for
|
||||
the ones that are not valid Crystal code (e.g. <code>is_404?</code>).</p>
|
||||
<p>Favour this:</p>
|
||||
<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)
|
||||
<span class="k">end</span></code></pre>
|
||||
<p>Over these:</p>
|
||||
<p>Over this:</p>
|
||||
<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)
|
||||
<span class="k">end</span></code></pre>
|
||||
<p>YAML configuration example:</p>
|
||||
<pre><code class="language-crystal"><span class="t">Style</span><span class="o">/</span><span class="t">PredicateName</span>:
|
||||
|
@ -1108,7 +1098,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/2811352c/src/ameba/rule/style/predicate_name.cr#L31" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/db5eee76/src/ameba/rule/style/predicate_name.cr#L26" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1289,7 +1279,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/2811352c/src/ameba/rule/style/predicate_name.cr#L39" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/db5eee76/src/ameba/rule/style/predicate_name.cr#L33" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue