{"id":13482678,"url":"https://github.com/crystal-ameba/ameba","last_synced_at":"2025-05-15T13:08:40.751Z","repository":{"id":38290581,"uuid":"108447748","full_name":"crystal-ameba/ameba","owner":"crystal-ameba","description":"A static code analysis tool for Crystal","archived":false,"fork":false,"pushed_at":"2025-04-17T01:00:51.000Z","size":15637,"stargazers_count":532,"open_issues_count":36,"forks_count":39,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-12T00:55:58.013Z","etag":null,"topics":["ameba","code-analysis","crystal","linter","static-analysis"],"latest_commit_sha":null,"homepage":"https://crystal-ameba.github.io","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crystal-ameba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-26T18:04:29.000Z","updated_at":"2025-05-11T10:55:18.000Z","dependencies_parsed_at":"2023-02-19T20:45:32.280Z","dependency_job_id":"85a2b705-1b92-467f-9612-ecde4cad9d02","html_url":"https://github.com/crystal-ameba/ameba","commit_stats":{"total_commits":828,"total_committers":27,"mean_commits":"30.666666666666668","dds":0.5555555555555556,"last_synced_commit":"51cb88e4fb9016981beb78726dff881c2c1dac4a"},"previous_names":["veelenga/ameba"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-ameba%2Fameba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-ameba%2Fameba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-ameba%2Fameba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crystal-ameba%2Fameba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crystal-ameba","download_url":"https://codeload.github.com/crystal-ameba/ameba/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ameba","code-analysis","crystal","linter","static-analysis"],"created_at":"2024-07-31T17:01:04.425Z","updated_at":"2025-05-15T13:08:35.743Z","avatar_url":"https://github.com/crystal-ameba.png","language":"Crystal","funding_links":[],"categories":["Crystal","crystal","Linters","Code Analysis and Metrics"],"sub_categories":["Crystal"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/veelenga/bin/master/ameba/logo.png\" width=\"800\"\u003e\n  \u003ch3 align=\"center\"\u003eAmeba\u003c/h3\u003e\n  \u003cp align=\"center\"\u003eCode style linter for Crystal\u003cp\u003e\n  \u003cp align=\"center\"\u003e\n    \u003csup\u003e\n      \u003ci\u003e(a single-celled animal that catches food and moves about by extending fingerlike projections of protoplasm)\u003c/i\u003e\n    \u003c/sup\u003e\n  \u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/crystal-ameba/ameba/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://github.com/crystal-ameba/ameba/actions/workflows/ci.yml/badge.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/crystal-ameba/ameba/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/crystal-ameba/ameba.svg?maxAge=360\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/crystal-ameba/ameba/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/crystal-ameba/ameba.svg\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\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 \\\u0026 integrations](#editors--integrations)\n- [Credits \\\u0026 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\u003e 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\u003e return s += issues.size\n         ^\n\nsrc/ameba/formatter/base_formatter.cr:16:7 [Correctable]\n[C] Style/RedundantReturn: Redundant `return` detected\n\u003e return s += issues.size\n  ^---------------------^\n\nFinished in 389.45 milliseconds\n107 inspected, 3 failures\n```\n\n### Watch a tutorial\n\n\u003ca href=\"https://luckycasts.com/videos/ameba\"\u003e\u003cimg src=\"https://i.imgur.com/uOETQlM.png\" title=\"Write Better Crystal Code with the Ameba Shard\" width=\"500\" /\u003e\u003c/a\u003e\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\nSome quick benchmark results measured while running Ameba on Crystal repo:\n\n```sh\n$ CRYSTAL_WORKERS=1 ameba #=\u003e 29.11 seconds\n$ CRYSTAL_WORKERS=2 ameba #=\u003e 19.49 seconds\n$ CRYSTAL_WORKERS=4 ameba #=\u003e 13.48 seconds\n$ CRYSTAL_WORKERS=8 ameba #=\u003e 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```\n\nBuild `bin/ameba` binary within your project directory while running `shards install`.\n\n### OS X\n\n```sh\n$ brew tap crystal-ameba/ameba\n$ brew install ameba\n```\n\n### Docker\n\nBuild the image:\n\n```sh\n$ docker build -t ghcr.io/crystal-ameba/ameba .\n```\n\nTo use the resulting image on a local source folder, mount the current (or target) directory into `/src`:\n\n```sh\n$ docker run -v $(pwd):/src ghcr.io/crystal-ameba/ameba\n```\n\nAlso available on GitHub: https://github.com/crystal-ameba/ameba/pkgs/container/ameba\n\n### From sources\n\n```sh\n$ git clone https://github.com/crystal-ameba/ameba \u0026\u0026 cd ameba\n$ make install\n```\n\n## Configuration\n\nDefault configuration file is `.ameba.yml`.\nIt allows to configure rule properties, disable specific rules and exclude sources from the rules.\n\nGenerate new file by running `ameba --gen-config`.\n\n### Sources\n\n**List of sources to run Ameba on can be configured globally via:**\n\n- `Globs` section - an array of wildcards (or paths) to include to the\n  inspection. Defaults to `%w[**/*.cr !lib]`, meaning it includes all project\n  files with `*.cr` extension except those which exist in `lib` folder.\n- `Excluded` section - an array of wildcards (or paths) to exclude from the\n  source list defined by `Globs`. Defaults to an empty array.\n\nIn this example we define default globs and exclude `src/compiler` folder:\n\n``` yaml\nGlobs:\n  - \"**/*.cr\"\n  - \"**/*.ecr\"\n  - \"!lib\"\n\nExcluded:\n  - src/compiler\n```\n\n**Specific sources can be excluded at rule level**:\n\n``` yaml\nStyle/RedundantBegin:\n  Excluded:\n    - src/server/processor.cr\n    - src/server/api.cr\n```\n\n### Rules\n\nOne or more rules, or a one or more group of rules can be included or excluded\nvia command line arguments:\n\n```sh\n$ ameba --only   Lint/Syntax # runs only Lint/Syntax rule\n$ ameba --only   Style,Lint  # runs only rules from Style and Lint groups\n$ ameba --except Lint/Syntax # runs all rules except Lint/Syntax\n$ ameba --except Style,Lint  # runs all rules except rules in Style and Lint groups\n```\n\nOr through the configuration file:\n\n``` yaml\nStyle/RedundantBegin:\n  Enabled: false\n```\n\n### Inline disabling\n\nOne or more rules or one or more group of rules can be disabled using inline directives:\n\n```crystal\n# ameba:disable Style/LargeNumbers\ntime = Time.epoch(1483859302)\n\ntime = Time.epoch(1483859302) # ameba:disable Style/LargeNumbers, Lint/UselessAssign\ntime = Time.epoch(1483859302) # ameba:disable Style, Lint\n```\n\n## Editors \u0026 integrations\n\n- Vim: [vim-crystal](https://github.com/rhysd/vim-crystal), [Ale](https://github.com/w0rp/ale)\n- Emacs: [ameba.el](https://github.com/crystal-ameba/ameba.el)\n- Sublime Text: [Sublime Linter Ameba](https://github.com/epergo/SublimeLinter-contrib-ameba)\n- VSCode: [vscode-crystal-ameba](https://github.com/crystal-ameba/vscode-crystal-ameba)\n- Codacy: [codacy-ameba](https://github.com/codacy/codacy-ameba)\n- GitHub Actions: [github-action](https://github.com/crystal-ameba/github-action)\n\n## Credits \u0026 inspirations\n\n- [Crystal Language](https://crystal-lang.org)\n- [Rubocop](https://rubocop.org)\n- [Credo](http://credo-ci.org)\n- [Dogma](https://github.com/lpil/dogma)\n\n## Contributors\n\n- [veelenga](https://github.com/veelenga) Vitalii Elenhaupt - creator, maintainer\n- [Sija](https://github.com/Sija) Sijawusz Pur Rahnama - contributor, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-ameba%2Fameba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystal-ameba%2Fameba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystal-ameba%2Fameba/lists"}