woody_erlang/rebar.config
2024-05-17 13:48:26 +03:00

141 lines
3.8 KiB
Erlang

%% Common project erlang options.
{erl_opts, [
% mandatory
debug_info,
warnings_as_errors,
warn_export_all,
warn_missing_spec,
%warn_untyped_record, %%thanks thrift
warn_export_vars,
% by default
warn_unused_record,
warn_bif_clash,
warn_obsolete_guard,
warn_unused_vars,
warn_shadow_vars,
warn_unused_import,
warn_unused_function,
warn_deprecated_function
% at will
% bin_opt_info
% no_auto_import
% warn_missing_spec_all
]}.
% Common project dependencies.
{deps, [
{cowboy, "2.9.0"},
{hackney, "1.18.0"},
{gproc, "0.9.0"},
{cache, "2.3.3"},
{snowflake, {git, "https://github.com/valitydev/snowflake.git", {branch, "master"}}},
{genlib, {git, "https://github.com/valitydev/genlib.git", {branch, "master"}}},
{prometheus, "4.8.1"},
{opentelemetry_api, "1.2.1"}
]}.
%% XRef checks
{xref_checks, [
undefined_function_calls,
undefined_functions,
deprecated_functions_calls,
deprecated_functions
]}.
{xref_ignores, [
{thrift_binary_protocol, new, 2},
{thrift_client, call, 3},
{thrift_client, close, 1},
{thrift_client, new, 2},
{thrift_client_codec, read_function_result, 5},
{thrift_client_codec, write_function_call, 6},
{thrift_membuffer_transport, new, 1},
{thrift_processor_codec, match_exception, 3},
{thrift_processor_codec, read_function_call, 3},
{thrift_processor_codec, write_function_result, 6},
{thrift_protocol, close_transport, 1},
{thrift_protocol, flush_transport, 1},
{thrift_protocol, read, 2},
{thrift_protocol, write, 2},
{thrift_strict_binary_codec, close, 1},
{thrift_strict_binary_codec, new, 0},
{thrift_strict_binary_codec, new, 1},
{thrift_transport, new, 2}
]}.
% at will
% {xref_warnings, true}.
%% Dialyzer static analyzing
{dialyzer, [
{warnings, [
% mandatory
unmatched_returns,
error_handling,
race_conditions,
unknown
]},
{plt_apps, all_deps}
]}.
{profiles, [
{test, [
{extra_src_dirs, [{"test", [{recursive, true}]}]},
{plugins, [
{rebar3_bench, "0.2.1"}
]},
{cover_enabled, true},
{provider_hooks, [
{pre, [
{compile, {thrift, compile}},
{clean, {thrift, clean}}
]}
]},
{thrift_compiler_opts, [
{in_dir, "test"},
{in_files, ["test.thrift"]},
{out_erl_dir, "test"},
{out_hrl_dir, "test"},
{gen, "erlang:app_prefix=woody"}
]},
{deps, [
{cth_readable, "1.4.9"},
{proper, "1.4.0"},
{thrift,
{git, "https://github.com/valitydev/thrift_erlang.git",
{ref, "3f3e11246d90aefa8f58b35e4f2eab14c0c28bd2"}}},
{damsel,
{git, "https://github.com/valitydev/damsel.git", {ref, "3fa6f31db54b2ae781b27898ab4daf56bb36eb36"}}},
{mg_proto,
{git, "https://github.com/valitydev/machinegun-proto.git",
{ref, "ebae56fe2b3e79e4eb34afc8cb55c9012ae989f8"}}},
{opentelemetry, "1.3.0"}
]},
{dialyzer, [
{plt_extra_apps, [thrift, prometheus, eunit, proper, common_test, cth_readable, opentelemetry]}
]}
]}
]}.
{project_plugins, [
{rebar3_thrift_compiler, {git, "https://github.com/valitydev/rebar3_thrift_compiler.git", {tag, "0.3.1"}}},
{erlfmt, "1.0.0"},
{rebar3_lint, "1.0.1"},
{covertool, "2.0.4"}
]}.
%% Linter config.
{elvis_output_format, colors}.
{erlfmt, [
{print_width, 120},
{files, ["{src,include,test}/*.{hrl,erl}", "rebar.config", "elvis.config"]}
]}.
{covertool, [
{coverdata_files, [
"eunit.coverdata",
"ct.coverdata"
]}
]}.