Skip to content

Commit

Permalink
[inaka#380] Add a section describing elvis.config
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanVikman committed Oct 26, 2017
1 parent ca4f544 commit 1b5daf0
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,40 @@ The `config` and `output_format` are explained in [`elvis_core`](https://github.
The GitHub configuration parameters `github_user` and `github_password` are
required only when `elvis` is used as a [webhook](#webhook).

### elvis.config

In your `elvis.config` file you can setup which rules should be
applied, on what files and in which directories to do it.

The configuration is in Erlang format, it is not that hard to write
but it is easier if you use the `elvis.config` file in this reposiotry
as a template.

In the `elvis.config` file you create an elvis config where for a set
of directories, you want to run a ruleset (or specific rules) on a set
of files.

For example, configure to check all erlang files under the `src`
directory using the ruleset `erl_files`:
```
[
{
elvis,
[
{config,
[#{dirs => ["src"],
filter => "*.erl",
ruleset => erl_files
}
]
}
]
}
].
```

You can use four different rulesets `erl_files`, `makefiles`, `rebar_config` or `elvis_config`.

## Implemented Rules

A reference of all rules implemented in Elvis can be found in this wiki page:
Expand Down

0 comments on commit 1b5daf0

Please sign in to comment.