%% -*- mode: erlang; -*-
{minimum_otp_vsn, "21"}.

{erl_opts, [
    fail_on_warning,
    debug_info,
    warn_unused_vars,
    warn_unused_import,
    warn_exported_vars
]}.

{xref_checks, [
    undefined_function_calls,
    undefined_functions,
    locals_not_used,
    %% exports_not_used,
    deprecated_function_calls,
    deprecated_functions
]}.

{project_plugins, [
    erlfmt,
    rebar3_ex_doc,
    rebar3_proper
]}.

{erlfmt, [
    write,
    {print_width, 120},
    {files, [
        "{src,include,test}/*.{hrl,erl}",
        "src/*.app.src",
        "rebar.config"
    ]},
    {exclude_files, [
        "src/smtp_rfc5322_parse.erl",
        "src/smtp_rfc5322_scan.erl",
        "src/smtp_rfc822_parse.erl"
    ]}
]}.

{xref_ignores, [
    {smtp_rfc822_parse, return_error, 2}
]}.

{deps, [
    {ranch, ">= 1.8.0"}
]}.

{profiles, [
    {dialyzer, [
        {deps, [
            {eiconv, "1.0.0"}
        ]},
        {dialyzer, [
            {plt_extra_apps, [
                eiconv,
                ssl
            ]},
            {warnings, [
                error_handling,
                unknown
            ]}
        ]}
    ]},
    {ranch_v2, [{deps, [{ranch, "2.1.0"}]}]},
    {test, [
        {cover_enabled, true},
        {cover_print_enabled, true},
        {deps, [
            {eiconv, "1.0.0"},
            {proper, "1.3.0"}
        ]}
    ]}
]}.

{ex_doc, [
    {source_url, <<"https://github.com/gen-smtp/gen_smtp">>},
    {prefix_ref_vsn_with_v, false},
    {extras, [
        {'README.md', #{title => "Overview"}},
        {'LICENSE', #{title => "License"}}
    ]},
    {main, <<"readme">>}
]}.

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