From 8571b87c9b84e7af3bde76c2d919cbdec729a81d Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Wed, 22 May 2024 20:41:59 +0100 Subject: [PATCH] ... to have it fixed We add a couple of text to the project_SUITE to have the issue more apparent --- src/elvis_project.erl | 2 ++ test/examples/rebar.config.fail | 3 ++- test/project_SUITE.erl | 16 ++++++++++++---- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/elvis_project.erl b/src/elvis_project.erl index 47b7b79b..7efb0fd5 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 abb398c9..f39e7bf2 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 ae0de5dc..4980e9c6 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().