-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from paulo-ferraz-oliveira/feature/improved_re…
…adme Improve README.md and rebar.config
- Loading branch information
Showing
3 changed files
with
79 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,63 @@ | ||
rebar3_lint | ||
===== | ||
=== | ||
|
||
![build](https://github.com/project-fifo/rebar3_lint/workflows/build/badge.svg) | ||
|
||
A rebar plugin | ||
|
||
Build | ||
----- | ||
|
||
$ rebar3 compile | ||
`rebar3_lint` is a `rebar3` plugin to ease the integration of | ||
[elvis](https://github.com/inaka/elvis_core) into your project. | ||
|
||
Use | ||
--- | ||
|
||
Add the plugin to your rebar config: | ||
Add the plugin to your `rebar.config`: | ||
|
||
```erlang | ||
{profiles, | ||
[ | ||
{lint, [{plugins, [{rebar3_lint, {git, "https://github.com/project-fifo/rebar3_lint.git", {tag, "0.1.11"}}}]}]} | ||
] | ||
}. | ||
{project_plugins, [ | ||
rebar3_lint | ||
]}. | ||
``` | ||
|
||
Then just call your plugin directly in an existing application: | ||
|
||
Then call it: | ||
|
||
$ rebar3 as lint lint | ||
===> Fetching rebar3_lint | ||
===> Compiling rebar3_lint | ||
<Plugin Output> | ||
|
||
## Configuration ## | ||
```bash | ||
$ rebar3 lint | ||
===> Fetching rebar3_lint | ||
===> Compiling rebar3_lint | ||
<plugin output> | ||
``` | ||
|
||
the plugin supports the following configuration options in the rebar.config: | ||
Configuration | ||
--- | ||
|
||
Elvis check configuration (keyword config if placed in application config or | ||
elvis.config file) | ||
The plugin supports configuration option `elvis_output_format` in `rebar.config`: | ||
|
||
```erlang | ||
{elvis, [map()]}. | ||
{elvis_output_format, plain | colors | parsable}. % default: colors | ||
``` | ||
|
||
Specify output format. Default: colors | ||
It also supports option `elvis` (in `rebar.config`) as you'd find `elvis`'s own | ||
`config` (inside option `elvis`). | ||
|
||
```erlang | ||
{elvis_output_format, plain | colors}. | ||
``` | ||
If no `elvis` configuration is present in `rebar.config`, the | ||
plug-in will look for an `elvis.config` file in the project root folder | ||
(but only the `config` section will be applied - this is an `elvis` idiosyncrasy). | ||
|
||
The output format may then be configured separately in `rebar.config`, as previously | ||
explained. | ||
|
||
If no `elvis` configuation statement is given in the `rebar.config` file the | ||
plug-in will look for a `elvis.config` file in the project root folder. But | ||
only the config section will be applied (this is an elvis idiosyncrasy). The | ||
output format may be configured separately in the `rebar.config` | ||
This is the default configuration if no input is provided: | ||
|
||
[### This is the default if no config is provided ###](src/rebar3_lint_prv.erl#L86-L105) | ||
```erlang | ||
{elvis, | ||
[#{dirs => ["apps/*/src", "src"], | ||
filter => "*.erl", | ||
ruleset => erl_files | ||
}, | ||
#{dirs => ["."], | ||
filter => "Makefile", | ||
ruleset => makefiles | ||
}, | ||
#{dirs => ["."], | ||
filter => "rebar.config", | ||
ruleset => rebar_config | ||
} | ||
#{dirs => ["."], | ||
filter => "elvis.config", | ||
ruleset => elvis_config | ||
} | ||
] | ||
} | ||
[#{ dirs => ["apps/*/src/**", "src/**"], | ||
filter => "*.erl", | ||
ruleset => erl_files }, | ||
#{ dirs => ["."], | ||
filter => "Makefile", | ||
ruleset => makefiles }, | ||
#{ dirs => ["."], | ||
filter => "rebar.config", | ||
ruleset => rebar_config } | ||
#{ dirs => ["."], | ||
filter => "elvis.config", | ||
ruleset => elvis_config }] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters