From 4acf05e32b85bf5b49ec03c46ddd37074657447d Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Sun, 6 Aug 2023 22:01:15 +0100 Subject: [PATCH] "Modernize" it and format it - tweak erl_opts - update deps' and project plugins' versions - tweak dialyzer options - tweak `test` profile (and put all test stuff inside) - add ex_doc - tweak alias test - add format - add hank - tweak xref --- rebar.config | 114 +++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/rebar.config b/rebar.config index 457138c..dc1a843 100644 --- a/rebar.config +++ b/rebar.config @@ -1,60 +1,60 @@ -%%% -*- mode: erlang; -*- +%% == Compiler and Profiles == + {erl_opts, - [ - debug_info - ] -}. - -{deps, - [ - {cowboy, "2.8.0"}, - {ranch, "2.0.0"} - ] -}. - -{project_plugins, [ - rebar3_lint, - rebar3_hank, - rebar3_hex -]}. - -{profiles, [ - {test, [ - {cover_enabled, true}, - {cover_opts, [verbose]}, - {deps, [ - {meck, "0.9.2"} - ]} - ]} - ]}. - -{alias, [{test, [xref, dialyzer, lint, hank, ct, cover, edoc]}]}. + [warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}. + +{minimum_otp_vsn, "23"}. + +{profiles, + [{test, + [{ct_opts, [{verbose, true}]}, + {cover_enabled, true}, + {cover_opts, [verbose]}, + {deps, [{meck, "0.9.2"}]}, + {dialyzer, + [{warnings, [no_return, underspecs, unmatched_returns, error_handling, unknown]}, + {plt_extra_apps, [meck]}]}]}]}. + +{alias, [{test, [compile, format, hank, lint, xref, dialyzer, ct, cover, ex_doc]}]}. + +%% == Dependencies and plugins == + +{deps, [{cowboy, "2.10.0"}, {ranch, "2.1.0"}]}. + +{project_plugins, + [{rebar3_hank, "~> 1.4.0"}, + {rebar3_hex, "~> 7.0.7"}, + {rebar3_format, "~> 1.3.0"}, + {rebar3_lint, "~> 3.0.1"}, + {rebar3_ex_doc, "0.2.18"}]}. + +%% == Documentation == + +{ex_doc, + [{source_url, <<"https://github.com/inaka/cowboy-trails">>} + ]}. + +{hex, [{doc, #{provider => ex_doc}}]}. + +%% == Format == + +{format, + [{files, ["*.config", "src/*", "test/*", "example/{rel,src,.}/*{.config,.erl,.src}"]}]}. + +%% == Hank == + +{hank, + [{ignore, + ["example/_build/**", + "example/_checkouts", + {"test/trails_SUITE.erl", unnecessary_function_arguments}]}]}. + +%% == Dialyzer + XRef == + +{dialyzer, + [{warnings, [no_return, underspecs, unmatched_returns, error_handling, unknown]}]}. {xref_checks, - [ - undefined_function_calls - , locals_not_used - , deprecated_function_calls - ] -}. - -{dialyzer, [ {warnings, [ underspecs - , unmatched_returns - , error_handling - , unknown - ]} - , {plt_apps, top_level_deps} - , {plt_extra_apps, []} - , {plt_location, local} - , {base_plt_apps, [erts, stdlib, kernel]} - , {base_plt_location, global}]}. - -%% == hank == - -{hank, [ - {ignore, [ - "example/_build/**", - "example/_checkouts/**", - {"test/trails_SUITE.erl", unnecessary_function_arguments} - ]} -]}. + [undefined_function_calls, deprecated_function_calls, deprecated_functions]}. + +{xref_extra_paths, ["test/**"]}.