%% == Compiler and Profiles ==

{erl_opts, [warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}.

{minimum_otp_vsn, "27"}.

{profiles, [
    {test, [
        {ct_extra_params,
            "-no_auto_compile -dir ebin -logdir log/ct --erl_args -smp enable -boot start_sasl"},
        {cover_enabled, true},
        {cover_export_enabled, true},
        {cover_opts, [verbose, {min_coverage, 92}]},
        {ct_opts, [{verbose, true}]},
        {deps, [{katana, "1.0.0"}, {mixer, "1.2.0", {pkg, inaka_mixer}}, {meck, "~> 1.1"}]},
        {dialyzer, [
            {warnings, [no_return, unmatched_returns, error_handling, underspecs, unknown]},
            {plt_extra_apps, [common_test, katana, meck]}
        ]}
    ]}
]}.

{alias, [
    {test, [
        compile,
        fmt,
        hank,
        lint,
        xref,
        dialyzer,
        ct,
        cover,
        {covertool, "generate"},
        ex_doc
    ]}
]}.

{covertool, [{coverdata_files, ["ct.coverdata"]}]}.

%% == Dependencies and plugins ==

{project_plugins, [
    {rebar3_hank, "~> 1.6"},
    {rebar3_depup, "~> 0.4.0"},
    {rebar3_hex, "~> 7.1"},
    {rebar3_ex_doc, "~> 0.2"},
    {rebar3_lint, "~> 5.0"},
    {erlfmt, "~> 1.8"},
    {covertool, "~> 2.0"}
]}.

%% == Documentation ==

{ex_doc, [
    {source_url, <<"https://github.com/inaka/worker_pool">>},
    {extras, [<<"README.md">>, <<"LICENSE">>]},
    {main, <<"README.md">>},
    {prefix_ref_vsn_with_v, false}
]}.

{hex, [{doc, #{provider => ex_doc}}]}.

%% == Format ==

{erlfmt, [
    write,
    {files, [
        "{src,test}/**/*.{hrl,erl,app.src}",
        "config/**/*.config",
        "*.config"
    ]}
]}.

%% == Dialyzer + XRef ==

{dialyzer, [{warnings, [no_return, unmatched_returns, error_handling, underspecs, unknown]}]}.

{xref_checks, [undefined_function_calls, deprecated_function_calls, deprecated_functions]}.

{xref_extra_paths, ["test/**"]}.
