Skip to content

Commit

Permalink
Don't crash on rebar3's pkg aliases
Browse files Browse the repository at this point in the history
rebar3 allows dependency declarations like
```
{deps,[
  {rebar, {pkg, rebar_fork}}, % rebar app under a different pkg name
]}
```

elvis crashes at a declaration like this 

```
# rebar.config [FAIL]
Error: 'badarg' while applying rule 'protocol_for_deps_rebar'.
# rebar.config [FAIL]
Error: 'badarg' while applying rule 'protocol_for_deps_rebar'.
```

This fix prevents elvis from crashing and accepts the declaration as valid.
  • Loading branch information
sstrigler authored Jul 13, 2016
1 parent 8e24a61 commit 4aa81a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elvis_project.erl
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ is_rebar_hex_dep({_AppName, _Vsn})
is_rebar_hex_dep(_) ->
false.

is_rebar_not_git_dep({_AppName, {pkg, _OtherName}}, _Regex) ->
false;
is_rebar_not_git_dep({_AppName, {_SCM, Url, _Branch}}, Regex) ->
nomatch == re:run(Url, Regex, []);
is_rebar_not_git_dep({_AppName, {_SCM, Url}}, Regex) ->
Expand Down

0 comments on commit 4aa81a8

Please sign in to comment.