From 742cd16f4d2d1c864cabebb69e2f634816f2c155 Mon Sep 17 00:00:00 2001 From: elbrujohalcon Date: Thu, 3 Aug 2023 08:05:17 +0200 Subject: [PATCH 1/4] elbrujohalcon.571.update-deps Fix #571: Upgrade deps --- rebar.config | 2 +- rebar.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rebar.config b/rebar.config index f013d87..e331b1e 100644 --- a/rebar.config +++ b/rebar.config @@ -63,7 +63,7 @@ %% == Dependencies == -{deps, [ {elvis_core, "1.3.1"} +{deps, [ {elvis_core, "3.0.1"} , {getopt, "1.0.2"} , {egithub, "0.7.0"} ]}. diff --git a/rebar.lock b/rebar.lock index 1c470f3..20d2ee4 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,53 +1,53 @@ {"1.2.0", -[{<<"certifi">>,{pkg,<<"certifi">>,<<"2.8.0">>},2}, +[{<<"certifi">>,{pkg,<<"certifi">>,<<"2.11.0">>},2}, {<<"egithub">>,{pkg,<<"egithub">>,<<"0.7.0">>},0}, - {<<"elvis_core">>,{pkg,<<"elvis_core">>,<<"1.3.1">>},0}, + {<<"elvis_core">>,{pkg,<<"elvis_core">>,<<"3.0.1">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.2">>},0}, {<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1}, {<<"hackney">>,{pkg,<<"hackney">>,<<"1.17.1">>},1}, {<<"idna">>,{pkg,<<"idna">>,<<"6.1.1">>},2}, {<<"jsx">>,{pkg,<<"jsx">>,<<"2.10.0">>},1}, - {<<"katana_code">>,{pkg,<<"katana_code">>,<<"1.1.2">>},1}, + {<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.0.2">>},1}, {<<"lager">>,{pkg,<<"lager">>,<<"3.9.1">>},1}, {<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},2}, {<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},2}, {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.1">>},2}, - {<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.6">>},2}, + {<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.7">>},2}, {<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.7.0">>},2}, {<<"zipper">>,{pkg,<<"zipper">>,<<"1.0.1">>},1}]}. [ {pkg_hash,[ - {<<"certifi">>, <<"D4FB0A6BB20B7C9C3643E22507E42F356AC090A1DCEA9AB99E27E0376D695EBA">>}, + {<<"certifi">>, <<"5ADFE37CEB8569D019F836944AEAF27F8AC391DACAF3707F570C155B7E03AAA8">>}, {<<"egithub">>, <<"CFF720B2ADE8A0528B8861D2309339FD3C1C289B9BCB9E498FF77C619CE28AF2">>}, - {<<"elvis_core">>, <<"844C339300DD3E9F929A045932D25DC5C99B4603D47536E995198143169CDF26">>}, + {<<"elvis_core">>, <<"EA8EB07EAA0236A682FC58F82C1138A65D35F5947294FA6D825402E0F33EA4B2">>}, {<<"getopt">>, <<"33D9B44289FE7AD08627DDFE1D798E30B2DA0033B51DA1B3A2D64E72CD581D02">>}, {<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>}, {<<"hackney">>, <<"08463F93D2CC1A03817BF28D8DAE6021543F773BD436C9377047224856C4422C">>}, {<<"idna">>, <<"8A63070E9F7D0C62EB9D9FCB360A7DE382448200FBBD1B106CC96D3D8099DF8D">>}, {<<"jsx">>, <<"77760560D6AC2B8C51FD4C980E9E19B784016AA70BE354CE746472C33BEB0B1C">>}, - {<<"katana_code">>, <<"4336743263236C3213FF1B979ECAE263940B9084ACE90E9434838F3F98CCA578">>}, + {<<"katana_code">>, <<"FAC8F2ABFB2ED54304EE44EEEEC30275BD026550533D094265A51927D7D9470D">>}, {<<"lager">>, <<"5885BC71308CD38F9D025C8ECDE4E5CCE1CE8565F80BFC6199865C845D6DBE95">>}, {<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>}, {<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>}, {<<"parse_trans">>, <<"6E6AA8167CB44CC8F39441D05193BE6E6F4E7C2946CB2759F015F8C56B76E5FF">>}, - {<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>}, + {<<"ssl_verify_fun">>, <<"354C321CF377240C7B8716899E182CE4890C5938111A1296ADD3EC74CF1715DF">>}, {<<"unicode_util_compat">>, <<"BC84380C9AB48177092F43AC89E4DFA2C6D62B40B8BD132B1059ECC7232F9A78">>}, {<<"zipper">>, <<"3CCB4F14B97C06B2749B93D8B6C204A1ECB6FAFC6050CACC3B93B9870C05952A">>}]}, {pkg_hash_ext,[ - {<<"certifi">>, <<"6AC7EFC1C6F8600B08D625292D4BBF584E14847CE1B6B5C44D983D273E1097EA">>}, + {<<"certifi">>, <<"9E37E0542EC3FABAA19A0734B3900DC095797FAC48C40A2A9741D8AD5E3C9BB7">>}, {<<"egithub">>, <<"E009CE11EFD8008D0F9ED59D9C488E3E9ABE302A0F2CD6D663E4CC26756FCC4C">>}, - {<<"elvis_core">>, <<"7A8890BF8185A3252CD4EBD826FE5F8AD6B93024EDF88576EB27AE9E5DC19D69">>}, + {<<"elvis_core">>, <<"4CF735401E7465C10851C6245C1E3E8E764984D8C0B5949D5697B14B5FAEAD49">>}, {<<"getopt">>, <<"A0029AEA4322FB82A61F6876A6D9C66DC9878B6CB61FAA13DF3187384FD4EA26">>}, {<<"goldrush">>, <<"99CB4128CFFCB3227581E5D4D803D5413FA643F4EB96523F77D9E6937D994CEB">>}, {<<"hackney">>, <<"D2CBA9E3C8103AD0320623E9F1C33E8D378A15EAABE2EE8AE441898F3D35A18C">>}, {<<"idna">>, <<"92376EB7894412ED19AC475E4A86F7B413C1B9FBB5BD16DCCD57934157944CEA">>}, {<<"jsx">>, <<"9A83E3704807298016968DB506F9FAD0F027DE37546EB838B3AE1064C3A0AD62">>}, - {<<"katana_code">>, <<"E7E6162A44E826A03F68B503B7D92981B894BF834C1EF0E647783F7D6688021C">>}, + {<<"katana_code">>, <<"3E57FED635E0B16A5FBDACCDC872EC53DEB21ED9FC6E7EB9B6415FF199B7B138">>}, {<<"lager">>, <<"3F59BA75A04A99E5F18BF91C89F46DCE536F83C6CB415FE26E6E75A62BEF37DC">>}, {<<"metrics">>, <<"69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16">>}, {<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>}, {<<"parse_trans">>, <<"620A406CE75DADA827B82E453C19CF06776BE266F5A67CFF34E1EF2CBB60E49A">>}, - {<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>}, + {<<"ssl_verify_fun">>, <<"FE4C190E8F37401D30167C8C405EDA19469F34577987C76DDE613E838BBC67F8">>}, {<<"unicode_util_compat">>, <<"25EEE6D67DF61960CF6A794239566599B09E17E668D3700247BC498638152521">>}, {<<"zipper">>, <<"6A1FD3E1F0CC1D1DF5642C9A0CE2178036411B0A5C9642851D1DA276BD737C2D">>}]} ]. From e599c5aa6d220369c47c3bd81c31a18462187090 Mon Sep 17 00:00:00 2001 From: elbrujohalcon Date: Thu, 3 Aug 2023 08:08:35 +0200 Subject: [PATCH 2/4] elbrujohalcon.571.update-deps Update CI --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 208dc6a..a38e727 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - otp_vsn: ["21", "22", "23"] - os: [ubuntu-latest] + otp_vsn: [23, 24, 25] + os: [ubuntu-20.04, windows-latest] steps: - name: Install Git 2.18 shell: bash @@ -28,13 +28,12 @@ jobs: sudo make prefix=/usr/local all sudo make prefix=/usr/local install cd $HOME - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: erlef/setup-beam@v1.7.0 + - uses: actions/checkout@v3 + - uses: erlef/setup-beam@v1 + id: setup-beam with: otp-version: ${{matrix.otp_vsn}} - rebar3-version: '3.14' + rebar3-version: '3.20' - shell: bash run: rebar3 dialyzer - shell: bash From a105332800a97236c8add3c98b5a9ccb76a79ba4 Mon Sep 17 00:00:00 2001 From: elbrujohalcon Date: Thu, 3 Aug 2023 08:11:38 +0200 Subject: [PATCH 3/4] elbrujohalcon.571.update-deps No windows tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a38e727..d376380 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: otp_vsn: [23, 24, 25] - os: [ubuntu-20.04, windows-latest] + os: [ubuntu-20.04] steps: - name: Install Git 2.18 shell: bash From 11c17dfe63b830aed3e60daea93d755942bcca89 Mon Sep 17 00:00:00 2001 From: elbrujohalcon Date: Thu, 3 Aug 2023 08:21:24 +0200 Subject: [PATCH 4/4] elbrujohalcon.571.update-deps Apply new elvis rules --- elvis.config | 4 ---- src/elvis.erl | 4 ++-- src/elvis_git.erl | 6 +++--- src/elvis_webhook.erl | 6 ++---- test/elvis_SUITE.erl | 5 +++-- test/elvis_meta_SUITE.erl | 4 ++-- test/git_SUITE.erl | 4 ++-- test/xref_SUITE.erl | 1 + 8 files changed, 15 insertions(+), 19 deletions(-) diff --git a/elvis.config b/elvis.config index 6bbebf1..956d6e6 100644 --- a/elvis.config +++ b/elvis.config @@ -7,10 +7,6 @@ filter => "*.erl", ruleset => erl_files }, - #{dirs => ["."], - filter => "Makefile", - ruleset => makefiles - }, #{dirs => ["."], filter => "rebar.config", ruleset => rebar_config diff --git a/src/elvis.erl b/src/elvis.erl index eaa2865..89336e4 100644 --- a/src/elvis.erl +++ b/src/elvis.erl @@ -142,7 +142,7 @@ process_options([{parallel, Num} | Opts], Cmds, Config) -> process_options([], Cmds, Config) -> process_commands(Cmds, Config). --spec process_commands([string()], elvis_config:configs()) ->ok. +-spec process_commands([string()], elvis_config:configs()) -> ok. process_commands([rock | Files], Config) -> case Files of [] -> @@ -168,7 +168,7 @@ process_commands(['git-branch', Commit | Cmds], Config) -> process_commands([], _Config) -> ok; process_commands([_Cmd | _Cmds], _Config) -> - throw(unrecognized_or_unimplemented_command). + error(unrecognized_or_unimplemented_command). %%% Options diff --git a/src/elvis_git.erl b/src/elvis_git.erl index ccfebed..aff6043 100644 --- a/src/elvis_git.erl +++ b/src/elvis_git.erl @@ -106,7 +106,7 @@ install_hook() -> check_git_dir() -> case filelib:is_dir(".git") of true -> ok; - false -> throw("Not a git repository.") + false -> error("Not a git repository.") end. %% @doc Adds elvis as a pre commit hook. If a pre-commit file already exists @@ -123,7 +123,7 @@ add_pre_commit_hook() -> {ok, Content} = file:read_file(?PRE_COMMIT_FILE), case binary:match(Content, <<"elvis">>) of nomatch -> {[append], Command}; - _ -> throw("Elvis is already installed as a git hook.") + _ -> error("Elvis is already installed as a git hook.") end; false -> {[write], <
>} end, @@ -155,7 +155,7 @@ patch_line_type(Line) -> $+ -> addition; $- -> deletion; $\\ -> same; - $ -> same %space + $\s -> same %space end. %% @private diff --git a/src/elvis_webhook.erl b/src/elvis_webhook.erl index 509f2c4..5a4fcaa 100644 --- a/src/elvis_webhook.erl +++ b/src/elvis_webhook.erl @@ -50,10 +50,8 @@ handle_pull_request(Cred, Data, GithubFiles) -> comments => []}} end. --spec handle_error( {error, term()} - , egithub_webhook:req_data() - , [egithub_webhook:file()] - ) -> {ok, [], []}. +-spec handle_error( + {error, term()}, egithub_webhook:req_data(), [egithub_webhook:file()]) -> {ok, [], []}. handle_error({error, _}, _, _) -> {ok, [], []}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/test/elvis_SUITE.erl b/test/elvis_SUITE.erl index a9ba815..4e05ab9 100644 --- a/test/elvis_SUITE.erl +++ b/test/elvis_SUITE.erl @@ -32,7 +32,8 @@ end_per_suite ]). --type config() :: [{atom(), term()}]. +-type config() :: proplists:proplist(). +-export_type([config/0]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Common test @@ -240,7 +241,7 @@ main_default_config(_Config) -> meck:expect(elvis_utils, erlang_halt, fun(Code) -> Code end), Src = "../../config/elvis-test.config", Dest = "./elvis.config", - {ok , _} = file:copy(Src, Dest), + {ok, _} = file:copy(Src, Dest), Expected = "# ../../src/elvis.erl.*OK", RockFun = fun() -> elvis:main("rock") end, diff --git a/test/elvis_meta_SUITE.erl b/test/elvis_meta_SUITE.erl index b08f754..996fe08 100644 --- a/test/elvis_meta_SUITE.erl +++ b/test/elvis_meta_SUITE.erl @@ -1,10 +1,10 @@ -module(elvis_meta_SUITE). --author('felipe@inakanetworks.net'). -export([all/0]). -export([dialyzer/1, xref/1, elvis/1]). --type config() :: [{atom(), term()}]. +-type config() :: proplists:proplist(). +-export_type([config/0]). -spec all() -> [dialyzer | xref | elvis]. all() -> [dialyzer, xref, elvis]. diff --git a/test/git_SUITE.erl b/test/git_SUITE.erl index 7f9399b..52eae17 100644 --- a/test/git_SUITE.erl +++ b/test/git_SUITE.erl @@ -20,7 +20,8 @@ end_per_suite ]). --type config() :: [{atom(), term()}]. +-type config() :: proplists:proplist(). +-export_type([config/0]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Common test @@ -129,4 +130,3 @@ maybe_git_config_user() -> _ = os:cmd("git config user.name 'Your Name'"), ok end. - diff --git a/test/xref_SUITE.erl b/test/xref_SUITE.erl index def5cdf..8d6670a 100644 --- a/test/xref_SUITE.erl +++ b/test/xref_SUITE.erl @@ -1,6 +1,7 @@ -module(xref_SUITE). -type config() :: proplists:proplist(). +-export_type([config/0]). -export( [