Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh readme #315

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 38 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- [About](#about)
- [Usage](#usage)
* [Watch a tutorial](#watch-a-tutorial)
* [Autocorrection](#autocorrection)
* [Explain issues](#explain-issues)
* [Run in parallel](#run-in-parallel)
- [Installation](#installation)
* [As a project dependency:](#as-a-project-dependency)
Expand All @@ -29,7 +31,6 @@
- [Configuration](#configuration)
* [Sources](#sources)
* [Rules](#rules)
* [Explain issues](#explain-issues)
* [Inline disabling](#inline-disabling)
- [Editors & integrations](#editors--integrations)
- [Credits & inspirations](#credits--inspirations)
Expand All @@ -51,20 +52,25 @@ Run `ameba` binary within your project directory to catch code issues:
$ ameba
Inspecting 107 files

...............F.....................F....................................................................
...............F.....................FF....................................................................

src/ameba/formatter/flycheck_formatter.cr:4:33
[W] Lint/UnusedArgument: Unused argument `location`
> source.issues.each do |e, location|
^
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:12:7
src/ameba/formatter/base_formatter.cr:16:14
[W] Lint/UselessAssign: Useless assignment to variable `s`
> return s += issues.size
^

Finished in 542.64 milliseconds
129 inspected, 2 failures
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
```

### Watch a tutorial
Expand All @@ -73,6 +79,27 @@ Finished in 542.64 milliseconds

[🎬 Watch the LuckyCast showing how to use Ameba](https://luckycasts.com/videos/ameba)

### Autocorrection

Rules that are marked as `[Correctable]` in the output can be automatically corrected using `--fix` flag:

```sh
$ ameba --fix
```

### Explain issues

Ameba allows you to dig deeper into an issue, by showing you details about the issue
and the reasoning by it being reported.

To be convenient, you can just copy-paste the `PATH:line:column` string from the
report and paste behind the `ameba` command to check it out.

```sh
$ ameba crystal/command/format.cr:26:83 # show explanation for the issue
$ ameba --explain crystal/command/format.cr:26:83 # same thing
```

### Run in parallel

Starting from 0.31.0 Crystal [supports parallelism](https://crystal-lang.org/2019/09/06/parallelism-in-crystal.html).
Expand Down Expand Up @@ -103,7 +130,7 @@ Add this to your application's `shard.yml`:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.0.0
version: ~> 1.3.0
```

Build `bin/ameba` binary within your project directory while running `shards install`.
Expand Down Expand Up @@ -209,19 +236,6 @@ Style/RedundantBegin:
Enabled: false
```

### Explain issues

Ameba allows you to dig deeper into an issue, by showing you details about the issue
and the reasoning by it being reported.

To be convenient, you can just copy-paste the `PATH:line:column` string from the
report and paste behind the `ameba` command to check it out.

```sh
$ ameba crystal/command/format.cr:26:83 # show explanation for the issue
$ ameba --explain crystal/command/format.cr:26:83 # same thing
```

### Inline disabling

One or more rules or one or more group of rules can be disabled using inline directives:
Expand Down Expand Up @@ -254,3 +268,4 @@ time = Time.epoch(1483859302) # ameba:disable Style, Lint
## Contributors

- [veelenga](https://github.com/veelenga) Vitalii Elenhaupt - creator, maintainer
- [Sija](https://github.com/Sija) Sijawusz Pur Rahnama - maintainer