Static code analysis · Crystal

Ameba logo

Keep your Crystal code clean.

A fast, modular linter for Crystal — hundreds of rules, autocorrection and editor support, shipped as a single binary.

shard.yml
development_dependencies:
  ameba:
    github: crystal-ameba/ameba

Then shards install && bin/ameba. Also on Homebrew, Docker and from source.

~/projects/my-shard — ameba
$ ameba
Inspecting 107 files
 
...............F.....................FF..........
 
src/ameba/formatter/flycheck_formatter.cr:6:37
W Lint/UnusedArgument: Unused argument `location`.
> source.issues.each do |issue, location|
^------^
 
src/ameba/formatter/base_formatter.cr:16:7 [Correctable]
C Style/RedundantReturn: Redundant `return` detected
> return size += issues.size
^------------------------^
 
Finished in 389.45 milliseconds
107 inspected, 3 failures — run ameba --fix to autocorrect

Why ameba

Built for the way Crystal developers work.

01 · Speed

Fast

Native Crystal with its own AST parser and lexer. Lints large code bases in milliseconds.

02 · Fixes

Autocorrect

Issues flagged as [Correctable] can be rewritten for you. Run ameba --fix and move on.

03 · Control

Configurable

Tune every rule from a single config file. Enable only what you need.

04 · Anywhere

Editor support

Diagnostics in VS Code, Vim, Emacs and Sublime, plus CI and code-quality integrations.

1
Single static binary
0
Runtime dependencies
<1s
To lint a typical project
MIT
Open source license