diff --git a/src/elvis_project.erl b/src/elvis_project.erl index 47b7b79..7efb0fd 100644 --- a/src/elvis_project.erl +++ b/src/elvis_project.erl @@ -141,6 +141,8 @@ is_not_git_dep({_AppName, {_SCM, Url}}, Regex) -> is_not_git_dep({_AppName, _Vsn, {_SCM, Url}}, Regex) -> nomatch == re:run(Url, Regex, []); is_not_git_dep({_AppName, _Vsn, {_SCM, Url, _Branch}}, Regex) -> + nomatch == re:run(Url, Regex, []); +is_not_git_dep({_AppName, {git_subdir, Url, {branch, _Branch}, _SubDir}}, Regex) -> nomatch == re:run(Url, Regex, []). %% @private diff --git a/test/examples/rebar.config.fail b/test/examples/rebar.config.fail index abb398c..f39e7bf 100644 --- a/test/examples/rebar.config.fail +++ b/test/examples/rebar.config.fail @@ -37,7 +37,8 @@ {jiffy, {git, "git@github.com:davisp/jiffy.git"}}, {ibrowse, {git, "https://github.com/cmullaparthi/ibrowse.git", "v4.1.1"}}, {aleppo, {git, "https://github.com/inaka/aleppo.git", "main"}}, - {jsx, {raw, {git, "https://github.com/talentdeficit.git", {branch, "main"}}}} + {jsx, {raw, {git, "https://github.com/talentdeficit.git", {branch, "main"}}}}, + {opentelemetry_api, {git_subdir, "http://github.com/open-telemetry/opentelemetry-erlang", {branch, "main"}, "apps/opentelemetry_api"}} ] }. {escript_name, "elvis"}. diff --git a/test/project_SUITE.erl b/test/project_SUITE.erl index ae0de5d..4980e9c 100644 --- a/test/project_SUITE.erl +++ b/test/project_SUITE.erl @@ -60,16 +60,24 @@ verify_protocol_for_deps(_Config) -> Filename = "rebar.config.fail", {ok, File} = elvis_test_utils:find_file(SrcDirs, Filename), - [_, _, _, _, _, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, #{}), + [#{info := [lager, _]}, + #{info := [getopt, _]}, + #{info := [jiffy, _]}, + #{info := [jsx, _]}, + #{info := [lager, _]}, + #{info := [getopt, _]}, + #{info := [jiffy, _]}, + #{info := [opentelemetry_api, _]}] = + elvis_project:protocol_for_deps(ElvisConfig, File, #{}), RuleConfig = #{ignore => [getopt, jsx]}, - [_, _, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, RuleConfig), + [_, _, _, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, RuleConfig), RuleConfig1 = #{ignore => [getopt, lager]}, - [_, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, RuleConfig1), + [_, _, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, RuleConfig1), RuleConfig2 = #{ignore => [meck], regex => "git@.*"}, - [_, _, _, _, _, _, _, _, _] = + [_, _, _, _, _, _, _, _, _, _] = elvis_project:protocol_for_deps(ElvisConfig, File, RuleConfig2). -spec verify_hex_dep(config()) -> any().