mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
1130 lines
42 KiB
HTML
1130 lines
42 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="generator" content="Crystal Docs 1.10.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>
|
|
|
|
<meta name="repository-name" content="ameba">
|
|
<title>ameba master</title>
|
|
<script type="text/javascript">
|
|
CrystalDocs.base_path = "";
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<svg class="hidden">
|
|
<symbol id="octicon-link" viewBox="0 0 16 16">
|
|
<path fill="currentColor" 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>
|
|
<input type="checkbox" id="sidebar-btn">
|
|
<label for="sidebar-btn" id="sidebar-btn-label">
|
|
<svg class="open" xmlns="http://www.w3.org/2000/svg" height="2em" width="2em" viewBox="0 0 512 512"><title>Open Sidebar</title><path fill="currentColor" d="M80 96v64h352V96H80zm0 112v64h352v-64H80zm0 112v64h352v-64H80z"></path></svg>
|
|
<svg class="close" xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 512 512"><title>Close Sidebar</title><path fill="currentColor" d="m118.6 73.4-45.2 45.2L210.7 256 73.4 393.4l45.2 45.2L256 301.3l137.4 137.3 45.2-45.2L301.3 256l137.3-137.4-45.2-45.2L256 210.7Z"></path></svg>
|
|
</label>
|
|
<div class="sidebar">
|
|
<div class="sidebar-header">
|
|
<div class="search-box">
|
|
<input type="search" class="search-input" placeholder="Search..." spellcheck="false" aria-label="Search">
|
|
</div>
|
|
|
|
<div class="project-summary">
|
|
<h1 class="project-name">
|
|
<a href="index.html">
|
|
ameba
|
|
</a>
|
|
</h1>
|
|
|
|
<span class="project-version">
|
|
master
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-results hidden">
|
|
<ul class="search-list"></ul>
|
|
</div>
|
|
|
|
<div class="types-list">
|
|
<ul>
|
|
|
|
<li class="parent " data-id="ameba/Ameba" data-name="ameba">
|
|
<a href="Ameba.html">Ameba</a>
|
|
|
|
<ul>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/AST" data-name="ameba::ast">
|
|
<a href="Ameba/AST.html">AST</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Argument" data-name="ameba::ast::argument">
|
|
<a href="Ameba/AST/Argument.html">Argument</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Assignment" data-name="ameba::ast::assignment">
|
|
<a href="Ameba/AST/Assignment.html">Assignment</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/BaseVisitor" data-name="ameba::ast::basevisitor">
|
|
<a href="Ameba/AST/BaseVisitor.html">BaseVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Branch" data-name="ameba::ast::branch">
|
|
<a href="Ameba/AST/Branch.html">Branch</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Branchable" data-name="ameba::ast::branchable">
|
|
<a href="Ameba/AST/Branchable.html">Branchable</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/CountingVisitor" data-name="ameba::ast::countingvisitor">
|
|
<a href="Ameba/AST/CountingVisitor.html">CountingVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/FlowExpression" data-name="ameba::ast::flowexpression">
|
|
<a href="Ameba/AST/FlowExpression.html">FlowExpression</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/FlowExpressionVisitor" data-name="ameba::ast::flowexpressionvisitor">
|
|
<a href="Ameba/AST/FlowExpressionVisitor.html">FlowExpressionVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/InstanceVariable" data-name="ameba::ast::instancevariable">
|
|
<a href="Ameba/AST/InstanceVariable.html">InstanceVariable</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/AST/NodeVisitor" data-name="ameba::ast::nodevisitor">
|
|
<a href="Ameba/AST/NodeVisitor.html">NodeVisitor</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/NodeVisitor/Category" data-name="ameba::ast::nodevisitor::category">
|
|
<a href="Ameba/AST/NodeVisitor/Category.html">Category</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/RedundantControlExpressionVisitor" data-name="ameba::ast::redundantcontrolexpressionvisitor">
|
|
<a href="Ameba/AST/RedundantControlExpressionVisitor.html">RedundantControlExpressionVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Reference" data-name="ameba::ast::reference">
|
|
<a href="Ameba/AST/Reference.html">Reference</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Scope" data-name="ameba::ast::scope">
|
|
<a href="Ameba/AST/Scope.html">Scope</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/ScopeVisitor" data-name="ameba::ast::scopevisitor">
|
|
<a href="Ameba/AST/ScopeVisitor.html">ScopeVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/TopLevelNodesVisitor" data-name="ameba::ast::toplevelnodesvisitor">
|
|
<a href="Ameba/AST/TopLevelNodesVisitor.html">TopLevelNodesVisitor</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/TypeDecVariable" data-name="ameba::ast::typedecvariable">
|
|
<a href="Ameba/AST/TypeDecVariable.html">TypeDecVariable</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Util" data-name="ameba::ast::util">
|
|
<a href="Ameba/AST/Util.html">Util</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/AST/Variable" data-name="ameba::ast::variable">
|
|
<a href="Ameba/AST/Variable.html">Variable</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Config" data-name="ameba::config">
|
|
<a href="Ameba/Config.html">Config</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Ext" data-name="ameba::ext">
|
|
<a href="Ameba/Ext.html">Ext</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Ext/Location" data-name="ameba::ext::location">
|
|
<a href="Ameba/Ext/Location.html">Location</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Formatter" data-name="ameba::formatter">
|
|
<a href="Ameba/Formatter.html">Formatter</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/BaseFormatter" data-name="ameba::formatter::baseformatter">
|
|
<a href="Ameba/Formatter/BaseFormatter.html">BaseFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/DisabledFormatter" data-name="ameba::formatter::disabledformatter">
|
|
<a href="Ameba/Formatter/DisabledFormatter.html">DisabledFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/DotFormatter" data-name="ameba::formatter::dotformatter">
|
|
<a href="Ameba/Formatter/DotFormatter.html">DotFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/ExplainFormatter" data-name="ameba::formatter::explainformatter">
|
|
<a href="Ameba/Formatter/ExplainFormatter.html">ExplainFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/FlycheckFormatter" data-name="ameba::formatter::flycheckformatter">
|
|
<a href="Ameba/Formatter/FlycheckFormatter.html">FlycheckFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/JSONFormatter" data-name="ameba::formatter::jsonformatter">
|
|
<a href="Ameba/Formatter/JSONFormatter.html">JSONFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/TODOFormatter" data-name="ameba::formatter::todoformatter">
|
|
<a href="Ameba/Formatter/TODOFormatter.html">TODOFormatter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Formatter/Util" data-name="ameba::formatter::util">
|
|
<a href="Ameba/Formatter/Util.html">Util</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/GlobUtils" data-name="ameba::globutils">
|
|
<a href="Ameba/GlobUtils.html">GlobUtils</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/InlineComments" data-name="ameba::inlinecomments">
|
|
<a href="Ameba/InlineComments.html">InlineComments</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/InlineComments/Action" data-name="ameba::inlinecomments::action">
|
|
<a href="Ameba/InlineComments/Action.html">Action</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Issue" data-name="ameba::issue">
|
|
<a href="Ameba/Issue.html">Issue</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Issue/Status" data-name="ameba::issue::status">
|
|
<a href="Ameba/Issue/Status.html">Status</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Presenter" data-name="ameba::presenter">
|
|
<a href="Ameba/Presenter.html">Presenter</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Presenter/BasePresenter" data-name="ameba::presenter::basepresenter">
|
|
<a href="Ameba/Presenter/BasePresenter.html">BasePresenter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Presenter/RuleCollectionPresenter" data-name="ameba::presenter::rulecollectionpresenter">
|
|
<a href="Ameba/Presenter/RuleCollectionPresenter.html">RuleCollectionPresenter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Presenter/RulePresenter" data-name="ameba::presenter::rulepresenter">
|
|
<a href="Ameba/Presenter/RulePresenter.html">RulePresenter</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Reportable" data-name="ameba::reportable">
|
|
<a href="Ameba/Reportable.html">Reportable</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule" data-name="ameba::rule">
|
|
<a href="Ameba/Rule.html">Rule</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Base" data-name="ameba::rule::base">
|
|
<a href="Ameba/Rule/Base.html">Base</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Documentation" data-name="ameba::rule::documentation">
|
|
<a href="Ameba/Rule/Documentation.html">Documentation</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Documentation/Documentation" data-name="ameba::rule::documentation::documentation">
|
|
<a href="Ameba/Rule/Documentation/Documentation.html">Documentation</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Documentation/DocumentationAdmonition" data-name="ameba::rule::documentation::documentationadmonition">
|
|
<a href="Ameba/Rule/Documentation/DocumentationAdmonition.html">DocumentationAdmonition</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Layout" data-name="ameba::rule::layout">
|
|
<a href="Ameba/Rule/Layout.html">Layout</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Layout/LineLength" data-name="ameba::rule::layout::linelength">
|
|
<a href="Ameba/Rule/Layout/LineLength.html">LineLength</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Layout/TrailingBlankLines" data-name="ameba::rule::layout::trailingblanklines">
|
|
<a href="Ameba/Rule/Layout/TrailingBlankLines.html">TrailingBlankLines</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Layout/TrailingWhitespace" data-name="ameba::rule::layout::trailingwhitespace">
|
|
<a href="Ameba/Rule/Layout/TrailingWhitespace.html">TrailingWhitespace</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Lint" data-name="ameba::rule::lint">
|
|
<a href="Ameba/Rule/Lint.html">Lint</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/AmbiguousAssignment" data-name="ameba::rule::lint::ambiguousassignment">
|
|
<a href="Ameba/Rule/Lint/AmbiguousAssignment.html">AmbiguousAssignment</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/BadDirective" data-name="ameba::rule::lint::baddirective">
|
|
<a href="Ameba/Rule/Lint/BadDirective.html">BadDirective</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/ComparisonToBoolean" data-name="ameba::rule::lint::comparisontoboolean">
|
|
<a href="Ameba/Rule/Lint/ComparisonToBoolean.html">ComparisonToBoolean</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/DebugCalls" data-name="ameba::rule::lint::debugcalls">
|
|
<a href="Ameba/Rule/Lint/DebugCalls.html">DebugCalls</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/DebuggerStatement" data-name="ameba::rule::lint::debuggerstatement">
|
|
<a href="Ameba/Rule/Lint/DebuggerStatement.html">DebuggerStatement</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/DuplicatedRequire" data-name="ameba::rule::lint::duplicatedrequire">
|
|
<a href="Ameba/Rule/Lint/DuplicatedRequire.html">DuplicatedRequire</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/EmptyEnsure" data-name="ameba::rule::lint::emptyensure">
|
|
<a href="Ameba/Rule/Lint/EmptyEnsure.html">EmptyEnsure</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/EmptyExpression" data-name="ameba::rule::lint::emptyexpression">
|
|
<a href="Ameba/Rule/Lint/EmptyExpression.html">EmptyExpression</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/EmptyLoop" data-name="ameba::rule::lint::emptyloop">
|
|
<a href="Ameba/Rule/Lint/EmptyLoop.html">EmptyLoop</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/Formatting" data-name="ameba::rule::lint::formatting">
|
|
<a href="Ameba/Rule/Lint/Formatting.html">Formatting</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/HashDuplicatedKey" data-name="ameba::rule::lint::hashduplicatedkey">
|
|
<a href="Ameba/Rule/Lint/HashDuplicatedKey.html">HashDuplicatedKey</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/LiteralAssignmentsInExpressions" data-name="ameba::rule::lint::literalassignmentsinexpressions">
|
|
<a href="Ameba/Rule/Lint/LiteralAssignmentsInExpressions.html">LiteralAssignmentsInExpressions</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/LiteralInCondition" data-name="ameba::rule::lint::literalincondition">
|
|
<a href="Ameba/Rule/Lint/LiteralInCondition.html">LiteralInCondition</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/LiteralInInterpolation" data-name="ameba::rule::lint::literalininterpolation">
|
|
<a href="Ameba/Rule/Lint/LiteralInInterpolation.html">LiteralInInterpolation</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/LiteralsComparison" data-name="ameba::rule::lint::literalscomparison">
|
|
<a href="Ameba/Rule/Lint/LiteralsComparison.html">LiteralsComparison</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/MissingBlockArgument" data-name="ameba::rule::lint::missingblockargument">
|
|
<a href="Ameba/Rule/Lint/MissingBlockArgument.html">MissingBlockArgument</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/NotNil" data-name="ameba::rule::lint::notnil">
|
|
<a href="Ameba/Rule/Lint/NotNil.html">NotNil</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/NotNilAfterNoBang" data-name="ameba::rule::lint::notnilafternobang">
|
|
<a href="Ameba/Rule/Lint/NotNilAfterNoBang.html">NotNilAfterNoBang</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/PercentArrays" data-name="ameba::rule::lint::percentarrays">
|
|
<a href="Ameba/Rule/Lint/PercentArrays.html">PercentArrays</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/RandZero" data-name="ameba::rule::lint::randzero">
|
|
<a href="Ameba/Rule/Lint/RandZero.html">RandZero</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/RedundantStringCoercion" data-name="ameba::rule::lint::redundantstringcoercion">
|
|
<a href="Ameba/Rule/Lint/RedundantStringCoercion.html">RedundantStringCoercion</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/RedundantWithIndex" data-name="ameba::rule::lint::redundantwithindex">
|
|
<a href="Ameba/Rule/Lint/RedundantWithIndex.html">RedundantWithIndex</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/RedundantWithObject" data-name="ameba::rule::lint::redundantwithobject">
|
|
<a href="Ameba/Rule/Lint/RedundantWithObject.html">RedundantWithObject</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/ShadowedArgument" data-name="ameba::rule::lint::shadowedargument">
|
|
<a href="Ameba/Rule/Lint/ShadowedArgument.html">ShadowedArgument</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/ShadowedException" data-name="ameba::rule::lint::shadowedexception">
|
|
<a href="Ameba/Rule/Lint/ShadowedException.html">ShadowedException</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/ShadowingOuterLocalVar" data-name="ameba::rule::lint::shadowingouterlocalvar">
|
|
<a href="Ameba/Rule/Lint/ShadowingOuterLocalVar.html">ShadowingOuterLocalVar</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/SharedVarInFiber" data-name="ameba::rule::lint::sharedvarinfiber">
|
|
<a href="Ameba/Rule/Lint/SharedVarInFiber.html">SharedVarInFiber</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/SpecFilename" data-name="ameba::rule::lint::specfilename">
|
|
<a href="Ameba/Rule/Lint/SpecFilename.html">SpecFilename</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/SpecFocus" data-name="ameba::rule::lint::specfocus">
|
|
<a href="Ameba/Rule/Lint/SpecFocus.html">SpecFocus</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/Syntax" data-name="ameba::rule::lint::syntax">
|
|
<a href="Ameba/Rule/Lint/Syntax.html">Syntax</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/Typos" data-name="ameba::rule::lint::typos">
|
|
<a href="Ameba/Rule/Lint/Typos.html">Typos</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UnneededDisableDirective" data-name="ameba::rule::lint::unneededdisabledirective">
|
|
<a href="Ameba/Rule/Lint/UnneededDisableDirective.html">UnneededDisableDirective</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UnreachableCode" data-name="ameba::rule::lint::unreachablecode">
|
|
<a href="Ameba/Rule/Lint/UnreachableCode.html">UnreachableCode</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UnusedArgument" data-name="ameba::rule::lint::unusedargument">
|
|
<a href="Ameba/Rule/Lint/UnusedArgument.html">UnusedArgument</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UnusedBlockArgument" data-name="ameba::rule::lint::unusedblockargument">
|
|
<a href="Ameba/Rule/Lint/UnusedBlockArgument.html">UnusedBlockArgument</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UselessAssign" data-name="ameba::rule::lint::uselessassign">
|
|
<a href="Ameba/Rule/Lint/UselessAssign.html">UselessAssign</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Lint/UselessConditionInWhen" data-name="ameba::rule::lint::uselessconditioninwhen">
|
|
<a href="Ameba/Rule/Lint/UselessConditionInWhen.html">UselessConditionInWhen</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Metrics" data-name="ameba::rule::metrics">
|
|
<a href="Ameba/Rule/Metrics.html">Metrics</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Metrics/CyclomaticComplexity" data-name="ameba::rule::metrics::cyclomaticcomplexity">
|
|
<a href="Ameba/Rule/Metrics/CyclomaticComplexity.html">CyclomaticComplexity</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Naming" data-name="ameba::rule::naming">
|
|
<a href="Ameba/Rule/Naming.html">Naming</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/AccessorMethodName" data-name="ameba::rule::naming::accessormethodname">
|
|
<a href="Ameba/Rule/Naming/AccessorMethodName.html">AccessorMethodName</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/AsciiIdentifiers" data-name="ameba::rule::naming::asciiidentifiers">
|
|
<a href="Ameba/Rule/Naming/AsciiIdentifiers.html">AsciiIdentifiers</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/BinaryOperatorParameterName" data-name="ameba::rule::naming::binaryoperatorparametername">
|
|
<a href="Ameba/Rule/Naming/BinaryOperatorParameterName.html">BinaryOperatorParameterName</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/BlockParameterName" data-name="ameba::rule::naming::blockparametername">
|
|
<a href="Ameba/Rule/Naming/BlockParameterName.html">BlockParameterName</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/ConstantNames" data-name="ameba::rule::naming::constantnames">
|
|
<a href="Ameba/Rule/Naming/ConstantNames.html">ConstantNames</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/Filename" data-name="ameba::rule::naming::filename">
|
|
<a href="Ameba/Rule/Naming/Filename.html">Filename</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/MethodNames" data-name="ameba::rule::naming::methodnames">
|
|
<a href="Ameba/Rule/Naming/MethodNames.html">MethodNames</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/PredicateName" data-name="ameba::rule::naming::predicatename">
|
|
<a href="Ameba/Rule/Naming/PredicateName.html">PredicateName</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/QueryBoolMethods" data-name="ameba::rule::naming::queryboolmethods">
|
|
<a href="Ameba/Rule/Naming/QueryBoolMethods.html">QueryBoolMethods</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/RescuedExceptionsVariableName" data-name="ameba::rule::naming::rescuedexceptionsvariablename">
|
|
<a href="Ameba/Rule/Naming/RescuedExceptionsVariableName.html">RescuedExceptionsVariableName</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/TypeNames" data-name="ameba::rule::naming::typenames">
|
|
<a href="Ameba/Rule/Naming/TypeNames.html">TypeNames</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Naming/VariableNames" data-name="ameba::rule::naming::variablenames">
|
|
<a href="Ameba/Rule/Naming/VariableNames.html">VariableNames</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Performance" data-name="ameba::rule::performance">
|
|
<a href="Ameba/Rule/Performance.html">Performance</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/AnyAfterFilter" data-name="ameba::rule::performance::anyafterfilter">
|
|
<a href="Ameba/Rule/Performance/AnyAfterFilter.html">AnyAfterFilter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/AnyInsteadOfEmpty" data-name="ameba::rule::performance::anyinsteadofempty">
|
|
<a href="Ameba/Rule/Performance/AnyInsteadOfEmpty.html">AnyInsteadOfEmpty</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/Base" data-name="ameba::rule::performance::base">
|
|
<a href="Ameba/Rule/Performance/Base.html">Base</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/ChainedCallWithNoBang" data-name="ameba::rule::performance::chainedcallwithnobang">
|
|
<a href="Ameba/Rule/Performance/ChainedCallWithNoBang.html">ChainedCallWithNoBang</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/CompactAfterMap" data-name="ameba::rule::performance::compactaftermap">
|
|
<a href="Ameba/Rule/Performance/CompactAfterMap.html">CompactAfterMap</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/ExcessiveAllocations" data-name="ameba::rule::performance::excessiveallocations">
|
|
<a href="Ameba/Rule/Performance/ExcessiveAllocations.html">ExcessiveAllocations</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/FirstLastAfterFilter" data-name="ameba::rule::performance::firstlastafterfilter">
|
|
<a href="Ameba/Rule/Performance/FirstLastAfterFilter.html">FirstLastAfterFilter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/FlattenAfterMap" data-name="ameba::rule::performance::flattenaftermap">
|
|
<a href="Ameba/Rule/Performance/FlattenAfterMap.html">FlattenAfterMap</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/MapInsteadOfBlock" data-name="ameba::rule::performance::mapinsteadofblock">
|
|
<a href="Ameba/Rule/Performance/MapInsteadOfBlock.html">MapInsteadOfBlock</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/MinMaxAfterMap" data-name="ameba::rule::performance::minmaxaftermap">
|
|
<a href="Ameba/Rule/Performance/MinMaxAfterMap.html">MinMaxAfterMap</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Performance/SizeAfterFilter" data-name="ameba::rule::performance::sizeafterfilter">
|
|
<a href="Ameba/Rule/Performance/SizeAfterFilter.html">SizeAfterFilter</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Rule/Style" data-name="ameba::rule::style">
|
|
<a href="Ameba/Rule/Style.html">Style</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/GuardClause" data-name="ameba::rule::style::guardclause">
|
|
<a href="Ameba/Rule/Style/GuardClause.html">GuardClause</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/IsAFilter" data-name="ameba::rule::style::isafilter">
|
|
<a href="Ameba/Rule/Style/IsAFilter.html">IsAFilter</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/IsANil" data-name="ameba::rule::style::isanil">
|
|
<a href="Ameba/Rule/Style/IsANil.html">IsANil</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/LargeNumbers" data-name="ameba::rule::style::largenumbers">
|
|
<a href="Ameba/Rule/Style/LargeNumbers.html">LargeNumbers</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/NegatedConditionsInUnless" data-name="ameba::rule::style::negatedconditionsinunless">
|
|
<a href="Ameba/Rule/Style/NegatedConditionsInUnless.html">NegatedConditionsInUnless</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/ParenthesesAroundCondition" data-name="ameba::rule::style::parenthesesaroundcondition">
|
|
<a href="Ameba/Rule/Style/ParenthesesAroundCondition.html">ParenthesesAroundCondition</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/RedundantBegin" data-name="ameba::rule::style::redundantbegin">
|
|
<a href="Ameba/Rule/Style/RedundantBegin.html">RedundantBegin</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/RedundantNext" data-name="ameba::rule::style::redundantnext">
|
|
<a href="Ameba/Rule/Style/RedundantNext.html">RedundantNext</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/RedundantReturn" data-name="ameba::rule::style::redundantreturn">
|
|
<a href="Ameba/Rule/Style/RedundantReturn.html">RedundantReturn</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/UnlessElse" data-name="ameba::rule::style::unlesselse">
|
|
<a href="Ameba/Rule/Style/UnlessElse.html">UnlessElse</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/VerboseBlock" data-name="ameba::rule::style::verboseblock">
|
|
<a href="Ameba/Rule/Style/VerboseBlock.html">VerboseBlock</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Rule/Style/WhileTrue" data-name="ameba::rule::style::whiletrue">
|
|
<a href="Ameba/Rule/Style/WhileTrue.html">WhileTrue</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Runner" data-name="ameba::runner">
|
|
<a href="Ameba/Runner.html">Runner</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Runner/InfiniteCorrectionLoopError" data-name="ameba::runner::infinitecorrectionlooperror">
|
|
<a href="Ameba/Runner/InfiniteCorrectionLoopError.html">InfiniteCorrectionLoopError</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Severity" data-name="ameba::severity">
|
|
<a href="Ameba/Severity.html">Severity</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/SeverityYamlConverter" data-name="ameba::severityyamlconverter">
|
|
<a href="Ameba/SeverityYamlConverter.html">SeverityYamlConverter</a>
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Source" data-name="ameba::source">
|
|
<a href="Ameba/Source.html">Source</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Source/Corrector" data-name="ameba::source::corrector">
|
|
<a href="Ameba/Source/Corrector.html">Corrector</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Source/Rewriter" data-name="ameba::source::rewriter">
|
|
<a href="Ameba/Source/Rewriter.html">Rewriter</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class="parent " data-id="ameba/Ameba/Spec" data-name="ameba::spec">
|
|
<a href="Ameba/Spec.html">Spec</a>
|
|
|
|
<ul>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Spec/AnnotatedSource" data-name="ameba::spec::annotatedsource">
|
|
<a href="Ameba/Spec/AnnotatedSource.html">AnnotatedSource</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Spec/BeValid" data-name="ameba::spec::bevalid">
|
|
<a href="Ameba/Spec/BeValid.html">BeValid</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Spec/BeValidExpectation" data-name="ameba::spec::bevalidexpectation">
|
|
<a href="Ameba/Spec/BeValidExpectation.html">BeValidExpectation</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Spec/ExpectIssue" data-name="ameba::spec::expectissue">
|
|
<a href="Ameba/Spec/ExpectIssue.html">ExpectIssue</a>
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Spec/Util" data-name="ameba::spec::util">
|
|
<a href="Ameba/Spec/Util.html">Util</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
<li class=" " data-id="ameba/Ameba/Tokenizer" data-name="ameba::tokenizer">
|
|
<a href="Ameba/Tokenizer.html">Tokenizer</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="main-content">
|
|
<p align="center">
|
|
<img src="https://raw.githubusercontent.com/veelenga/bin/master/ameba/logo.png" width="800">
|
|
<h3 align="center">Ameba</h3>
|
|
<p align="center">Code style linter for Crystal<p>
|
|
<p align="center">
|
|
<sup>
|
|
<i>(a single-celled animal that catches food and moves about by extending fingerlike projections of protoplasm)</i>
|
|
</sup>
|
|
</p>
|
|
<p align="center">
|
|
<a href="https://github.com/crystal-ameba/ameba/actions/workflows/ci.yml"><img src="https://github.com/crystal-ameba/ameba/actions/workflows/ci.yml/badge.svg"></a>
|
|
<a href="https://github.com/crystal-ameba/ameba/releases"><img src="https://img.shields.io/github/release/crystal-ameba/ameba.svg?maxAge=360"></a>
|
|
<a href="https://github.com/crystal-ameba/ameba/blob/master/LICENSE"><img src="https://img.shields.io/github/license/crystal-ameba/ameba.svg"></a>
|
|
</p>
|
|
</p>
|
|
<ul>
|
|
<li><a href="#about">About</a></li>
|
|
<li><a href="#usage">Usage</a>
|
|
<ul>
|
|
<li><a href="#watch-a-tutorial">Watch a tutorial</a></li>
|
|
<li><a href="#autocorrection">Autocorrection</a></li>
|
|
<li><a href="#explain-issues">Explain issues</a></li>
|
|
<li><a href="#run-in-parallel">Run in parallel</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#installation">Installation</a>
|
|
<ul>
|
|
<li><a href="#as-a-project-dependency">As a project dependency:</a></li>
|
|
<li><a href="#os-x">OS X</a></li>
|
|
<li><a href="#docker">Docker</a></li>
|
|
<li><a href="#from-sources">From sources</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#configuration">Configuration</a>
|
|
<ul>
|
|
<li><a href="#sources">Sources</a></li>
|
|
<li><a href="#rules">Rules</a></li>
|
|
<li><a href="#inline-disabling">Inline disabling</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#editors--integrations">Editors & integrations</a></li>
|
|
<li><a href="#credits--inspirations">Credits & inspirations</a></li>
|
|
<li><a href="#contributors">Contributors</a></li>
|
|
</ul>
|
|
<h2><a id="about" class="anchor" href="#about">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>About</h2>
|
|
<p>Ameba is a static code analysis tool for the Crystal language.
|
|
It enforces a consistent <a href="https://crystal-lang.org/reference/conventions/coding_style.html">Crystal code style</a>,
|
|
also catches code smells and wrong code constructions.</p>
|
|
<p>See also <a href="https://github.com/crystal-ameba/ameba/wiki">Roadmap</a>.</p>
|
|
<h2><a id="usage" class="anchor" href="#usage">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Usage</h2>
|
|
<p>Run <code>ameba</code> binary within your project directory to catch code issues:</p>
|
|
<pre><code class="language-sh">$ ameba
|
|
Inspecting 107 files
|
|
|
|
...............F.....................FF....................................................................
|
|
|
|
src/ameba/formatter/flycheck_formatter.cr:6:37
|
|
[W] Lint/UnusedArgument: Unused argument `location`. If it's necessary, use `_` as an argument name to indicate that it won't be used.
|
|
> source.issues.each do |issue, location|
|
|
^
|
|
|
|
src/ameba/formatter/base_formatter.cr:16:14
|
|
[W] Lint/UselessAssign: Useless assignment to variable `s`
|
|
> return s += issues.size
|
|
^
|
|
|
|
src/ameba/formatter/base_formatter.cr:16:7 [Correctable]
|
|
[C] Style/RedundantReturn: Redundant `return` detected
|
|
> return s += issues.size
|
|
^---------------------^
|
|
|
|
Finished in 389.45 milliseconds
|
|
107 inspected, 3 failures</code></pre>
|
|
<h3><a id="watch-a-tutorial" class="anchor" href="#watch-a-tutorial">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Watch a tutorial</h3>
|
|
<p><a href="https://luckycasts.com/videos/ameba"><img src="https://i.imgur.com/uOETQlM.png" title="Write Better Crystal Code with the Ameba Shard" width="500" /></a></p>
|
|
<p><a href="https://luckycasts.com/videos/ameba">🎬 Watch the LuckyCast showing how to use Ameba</a></p>
|
|
<h3><a id="autocorrection" class="anchor" href="#autocorrection">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Autocorrection</h3>
|
|
<p>Rules that are marked as <code>[Correctable]</code> in the output can be automatically corrected using <code>--fix</code> flag:</p>
|
|
<pre><code class="language-sh">$ ameba --fix</code></pre>
|
|
<h3><a id="explain-issues" class="anchor" href="#explain-issues">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Explain issues</h3>
|
|
<p>Ameba allows you to dig deeper into an issue, by showing you details about the issue
|
|
and the reasoning by it being reported.</p>
|
|
<p>To be convenient, you can just copy-paste the <code>PATH:line:column</code> string from the
|
|
report and paste behind the <code>ameba</code> command to check it out.</p>
|
|
<pre><code class="language-sh">$ ameba crystal/command/format.cr:26:83 # show explanation for the issue
|
|
$ ameba --explain crystal/command/format.cr:26:83 # same thing</code></pre>
|
|
<h3><a id="run-in-parallel" class="anchor" href="#run-in-parallel">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Run in parallel</h3>
|
|
<p>Some quick benchmark results measured while running Ameba on Crystal repo:</p>
|
|
<pre><code class="language-sh">$ CRYSTAL_WORKERS=1 ameba #=> 29.11 seconds
|
|
$ CRYSTAL_WORKERS=2 ameba #=> 19.49 seconds
|
|
$ CRYSTAL_WORKERS=4 ameba #=> 13.48 seconds
|
|
$ CRYSTAL_WORKERS=8 ameba #=> 10.14 seconds</code></pre>
|
|
<h2><a id="installation" class="anchor" href="#installation">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Installation</h2>
|
|
<h3><a id="as-a-project-dependency" class="anchor" href="#as-a-project-dependency">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>As a project dependency:</h3>
|
|
<p>Add this to your application's <code>shard.yml</code>:</p>
|
|
<pre><code class="language-yaml">development_dependencies:
|
|
ameba:
|
|
github: crystal-ameba/ameba</code></pre>
|
|
<p>Build <code>bin/ameba</code> binary within your project directory while running <code>shards install</code>.</p>
|
|
<h3><a id="os-x" class="anchor" href="#os-x">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>OS X</h3>
|
|
<pre><code class="language-sh">$ brew tap crystal-ameba/ameba
|
|
$ brew install ameba</code></pre>
|
|
<h3><a id="docker" class="anchor" href="#docker">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Docker</h3>
|
|
<p>Build the image:</p>
|
|
<pre><code class="language-sh">$ docker build -t ghcr.io/crystal-ameba/ameba .</code></pre>
|
|
<p>To use the resulting image on a local source folder, mount the current (or target) directory into <code>/src</code>:</p>
|
|
<pre><code class="language-sh">$ docker run -v $(pwd):/src ghcr.io/crystal-ameba/ameba</code></pre>
|
|
<p>Also available on GitHub: https://github.com/crystal-ameba/ameba/pkgs/container/ameba</p>
|
|
<h3><a id="from-sources" class="anchor" href="#from-sources">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>From sources</h3>
|
|
<pre><code class="language-sh">$ git clone https://github.com/crystal-ameba/ameba && cd ameba
|
|
$ make install</code></pre>
|
|
<h2><a id="configuration" class="anchor" href="#configuration">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Configuration</h2>
|
|
<p>Default configuration file is <code>.ameba.yml</code>.
|
|
It allows to configure rule properties, disable specific rules and exclude sources from the rules.</p>
|
|
<p>Generate new file by running <code>ameba --gen-config</code>.</p>
|
|
<h3><a id="sources" class="anchor" href="#sources">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Sources</h3>
|
|
<p><strong>List of sources to run Ameba on can be configured globally via:</strong></p>
|
|
<ul>
|
|
<li><code>Globs</code> section - an array of wildcards (or paths) to include to the
|
|
inspection. Defaults to <code>%w[**/*.cr !lib]</code>, meaning it includes all project
|
|
files with <code>*.cr</code> extension except those which exist in <code>lib</code> folder.</li>
|
|
<li><code>Excluded</code> section - an array of wildcards (or paths) to exclude from the
|
|
source list defined by <code>Globs</code>. Defaults to an empty array.</li>
|
|
</ul>
|
|
<p>In this example we define default globs and exclude <code>src/compiler</code> folder:</p>
|
|
<pre><code class="language-yaml">Globs:
|
|
- "**/*.cr"
|
|
- "!lib"
|
|
|
|
Excluded:
|
|
- src/compiler</code></pre>
|
|
<p><strong>Specific sources can be excluded at rule level</strong>:</p>
|
|
<pre><code class="language-yaml">Style/RedundantBegin:
|
|
Excluded:
|
|
- src/server/processor.cr
|
|
- src/server/api.cr</code></pre>
|
|
<h3><a id="rules" class="anchor" href="#rules">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Rules</h3>
|
|
<p>One or more rules, or a one or more group of rules can be included or excluded
|
|
via command line arguments:</p>
|
|
<pre><code class="language-sh">$ ameba --only Lint/Syntax # runs only Lint/Syntax rule
|
|
$ ameba --only Style,Lint # runs only rules from Style and Lint groups
|
|
$ ameba --except Lint/Syntax # runs all rules except Lint/Syntax
|
|
$ ameba --except Style,Lint # runs all rules except rules in Style and Lint groups</code></pre>
|
|
<p>Or through the configuration file:</p>
|
|
<pre><code class="language-yaml">Style/RedundantBegin:
|
|
Enabled: false</code></pre>
|
|
<h3><a id="inline-disabling" class="anchor" href="#inline-disabling">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Inline disabling</h3>
|
|
<p>One or more rules or one or more group of rules can be disabled using inline directives:</p>
|
|
<pre><code class="language-crystal"><span class="c"># ameba:disable Style/LargeNumbers</span>
|
|
time <span class="o">=</span> <span class="t">Time</span>.epoch(<span class="n">1483859302</span>)
|
|
|
|
time <span class="o">=</span> <span class="t">Time</span>.epoch(<span class="n">1483859302</span>) <span class="c"># ameba:disable Style/LargeNumbers, Lint/UselessAssign</span>
|
|
time <span class="o">=</span> <span class="t">Time</span>.epoch(<span class="n">1483859302</span>) <span class="c"># ameba:disable Style, Lint</span></code></pre>
|
|
<h2><a id="editors-integrations" class="anchor" href="#editors-integrations">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Editors & integrations</h2>
|
|
<ul>
|
|
<li>Vim: <a href="https://github.com/rhysd/vim-crystal">vim-crystal</a>, <a href="https://github.com/w0rp/ale">Ale</a></li>
|
|
<li>Emacs: <a href="https://github.com/crystal-ameba/ameba.el">ameba.el</a></li>
|
|
<li>Sublime Text: <a href="https://github.com/epergo/SublimeLinter-contrib-ameba">Sublime Linter Ameba</a></li>
|
|
<li>VSCode: <a href="https://github.com/crystal-ameba/vscode-crystal-ameba">vscode-crystal-ameba</a></li>
|
|
<li>Codacy: <a href="https://github.com/codacy/codacy-ameba">codacy-ameba</a></li>
|
|
<li>GitHub Actions: <a href="https://github.com/crystal-ameba/github-action">github-action</a></li>
|
|
</ul>
|
|
<h2><a id="credits-inspirations" class="anchor" href="#credits-inspirations">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Credits & inspirations</h2>
|
|
<ul>
|
|
<li><a href="https://crystal-lang.org">Crystal Language</a></li>
|
|
<li><a href="https://rubocop.readthedocs.io/en/latest/">Rubocop</a></li>
|
|
<li><a href="http://credo-ci.org/">Credo</a></li>
|
|
<li><a href="https://github.com/lpil/dogma">Dogma</a></li>
|
|
</ul>
|
|
<h2><a id="contributors" class="anchor" href="#contributors">
|
|
<svg class="octicon-link" aria-hidden="true">
|
|
<use href="#octicon-link"/>
|
|
</svg>
|
|
</a>Contributors</h2>
|
|
<ul>
|
|
<li><a href="https://github.com/veelenga">veelenga</a> Vitalii Elenhaupt - creator, maintainer</li>
|
|
<li><a href="https://github.com/Sija">Sija</a> Sijawusz Pur Rahnama - contributor, maintainer</li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|