{"repository_name":"ameba","body":"[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n- [About](#about)\n- [Usage](#usage)\n * [Watch a tutorial](#watch-a-tutorial)\n * [Autocorrection](#autocorrection)\n * [Explain issues](#explain-issues)\n * [Run in parallel](#run-in-parallel)\n- [Installation](#installation)\n * [As a project dependency:](#as-a-project-dependency)\n * [OS X](#os-x)\n * [Docker](#docker)\n * [From sources](#from-sources)\n- [Configuration](#configuration)\n * [Sources](#sources)\n * [Rules](#rules)\n * [Inline disabling](#inline-disabling)\n- [Editors & integrations](#editors--integrations)\n- [Credits & inspirations](#credits--inspirations)\n- [Contributors](#contributors)\n\n## About\n\nAmeba is a static code analysis tool for the Crystal language.\nIt enforces a consistent [Crystal code style](https://crystal-lang.org/reference/conventions/coding_style.html),\nalso catches code smells and wrong code constructions.\n\nSee also [Roadmap](https://github.com/crystal-ameba/ameba/wiki).\n\n## Usage\n\nRun `ameba` binary within your project directory to catch code issues:\n\n```sh\n$ ameba\nInspecting 107 files\n\n...............F.....................FF....................................................................\n\nsrc/ameba/formatter/flycheck_formatter.cr:6:37\n[W] Lint/UnusedArgument: Unused argument `location`. If it's necessary, use `_` as an argument name to indicate that it won't be used.\n> source.issues.each do |issue, location|\n ^\n\nsrc/ameba/formatter/base_formatter.cr:16:14\n[W] Lint/UselessAssign: Useless assignment to variable `s`\n> return s += issues.size\n ^\n\nsrc/ameba/formatter/base_formatter.cr:16:7 [Correctable]\n[C] Style/RedundantReturn: Redundant `return` detected\n> return s += issues.size\n ^---------------------^\n\nFinished in 389.45 milliseconds\n107 inspected, 3 failures\n```\n\n### Watch a tutorial\n\n\n\n[🎬 Watch the LuckyCast showing how to use Ameba](https://luckycasts.com/videos/ameba)\n\n### Autocorrection\n\nRules that are marked as `[Correctable]` in the output can be automatically corrected using `--fix` flag:\n\n```sh\n$ ameba --fix\n```\n\n### Explain issues\n\nAmeba allows you to dig deeper into an issue, by showing you details about the issue\nand the reasoning by it being reported.\n\nTo be convenient, you can just copy-paste the `PATH:line:column` string from the\nreport and paste behind the `ameba` command to check it out.\n\n```sh\n$ ameba crystal/command/format.cr:26:83 # show explanation for the issue\n$ ameba --explain crystal/command/format.cr:26:83 # same thing\n```\n\n### Run in parallel\n\nStarting from 0.31.0 Crystal [supports parallelism](https://crystal-lang.org/2019/09/06/parallelism-in-crystal.html).\nIt allows to run linting in parallel too.\nIn order to take advantage of this feature you need to build ameba with preview_mt support:\n\n```sh\n$ crystal build src/cli.cr -Dpreview_mt -o bin/ameba\n$ make install\n```\n\nSome quick benchmark results measured while running Ameba on Crystal repo:\n\n```sh\n$ CRYSTAL_WORKERS=1 ameba #=> 29.11 seconds\n$ CRYSTAL_WORKERS=2 ameba #=> 19.49 seconds\n$ CRYSTAL_WORKERS=4 ameba #=> 13.48 seconds\n$ CRYSTAL_WORKERS=8 ameba #=> 10.14 seconds\n```\n\n## Installation\n\n### As a project dependency:\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndevelopment_dependencies:\n ameba:\n github: crystal-ameba/ameba\n version: ~> 1.3.0\n```\n\nBuild `bin/ameba` binary within your project directory while running `shards install`.\n\nYou may also want to use it on [Travis](travis-ci.org):\n\n```yaml\n# .travis.yml\nlanguage: crystal\ninstall:\n - shards install\nscript:\n - crystal spec\n - crystal bin/ameba.cr\n```\n\nUsing this config Ameba will inspect files just after the specs run. Travis will also fail\nthe build if some