Current section

Files

Jump to
prometheus rebar.config
Raw

rebar.config

%% -*- mode: erlang -*-
{minimum_otp_vsn, "26"}.
{erl_opts, [
debug_info,
warn_unused_vars,
warnings_as_errors,
warn_export_all,
warn_shadow_vars,
warn_unused_import,
warn_unused_function,
warn_bif_clash,
warn_unused_record,
warn_deprecated_function,
warn_obsolete_guard,
strict_validation,
warn_export_vars,
warn_exported_vars
%warn_missing_spec, warn_untyped_record, <- Added dynamically for OTP >=27 in rebar.config.script
]}.
{deps, [
{ddskerl, "0.4.3"}
]}.
{shell, [{apps, [prometheus]}]}.
{xref_extra_paths, []}.
{xref_ignores, [prometheus_model]}.
{xref_checks, [
undefined_function_calls,
undefined_functions,
locals_not_used,
{deprecated_function_calls, next_major_release},
{deprecated_functions, next_major_release}
]}.
{dialyzer, [
{warnings, [no_return, error_handling, unknown]},
{plt_extra_apps, [mnesia]}
]}.
{profiles, [
{test, [
{erl_opts, [nowarn_missing_spec]},
{eunit_compile_opts, [{src_dirs, ["src", "test/eunit"]}]},
{eunit_opts, [verbose]},
{covertool, [{coverdata_files, ["ct.coverdata"]}]},
{cover_opts, [verbose, {min_coverage, 95}]},
{cover_enabled, true},
{cover_export_enabled, true},
{cover_excl_mods, [prometheus_model, prometheus]}
]},
{gpb, [
{plugins, [{rebar3_gpb_plugin, "2.23.2"}]},
{provider_hooks, [
{pre, [{compile, {protobuf, compile}}]},
{post, [{clean, {protobuf, clean}}]}
]},
{gpb_opts, [
{i, "src/model"},
{o_erl, "src/model"},
{o_hrl, "include"},
defs_as_proplists,
strings_as_binaries,
type_specs
]}
]},
{benchmark, [
{src_dirs, ["src", "benchmark"]},
{deps, [
{'erlang-color',
{git, "https://github.com/julianduque/erlang-color", {branch, "master"}}}
]}
]}
]}.
{project_plugins, [
{rebar3_hex, "~> 7.1"},
{rebar3_lint, "~> 5.0"},
{rebar3_ex_doc, "~> 0.2"},
{erlfmt, "~> 1.8"},
{covertool, "~> 2.0"}
]}.
{hex, [{doc, #{provider => ex_doc}}]}.
{ex_doc, [
{source_url, <<"https://github.com/prometheus-erl/prometheus.erl">>},
{main, <<"readme">>},
{extras, [
{'README.md', #{title => <<"Overview">>}},
{'LICENSE', #{title => <<"License">>}}
]}
]}.
{erlfmt, [
write,
{files, [
"include/**/*.{hrl,erl,app.src}",
"src/**/*.{hrl,erl,app.src}",
"test/**/*.{hrl,erl,app.src}",
"rebar.config.script",
"rebar.config"
]},
{exclude_files, [
"src/model/prometheus_model.erl",
"include/prometheus_model.hrl"
]}
]}.
{elvis, [
{config, [
#{
files => ["src/**/*.erl"],
ignore => ["src/model/"],
rules => [
{elvis_text_style, max_line_length, #{limit => 120, skip_comments => false}},
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
{elvis_style, generic_type, #{preferred_type => term}},
{elvis_style, no_invalid_dynamic_calls, #{
ignore => [
prometheus_misc,
prometheus_registry,
prometheus_sup
]
}},
{elvis_style, no_god_modules, #{limit => 40}},
{elvis_style, no_catch_expressions, disable}
],
ruleset => erl_files
},
#{
files => ["src/model/prometheus_model_helpers.erl"],
rules => [
{elvis_text_style, max_line_length, #{limit => 120}},
%% FIXME: why create_mf calls collect_metrics??
{elvis_style, no_invalid_dynamic_calls, disable},
{elvis_style, no_god_modules, #{limit => 40}}
],
ruleset => erl_files
},
#{
files => ["test/eunit/**/*.erl"],
rules => [
{elvis_text_style, max_line_length, #{limit => 120}},
{elvis_style, no_god_modules, #{limit => 40}},
%% looks like eunit generates underscored vars
{elvis_style, variable_naming_convention, #{regex => "^([A-Z_][0-9a-zA-Z_]*)$"}},
{elvis_style, dont_repeat_yourself, #{min_complexity => 200}},
{elvis_style, no_block_expressions, disable}
],
ruleset => erl_files
},
#{
files => ["rebar.config"],
ruleset => rebar_config
}
]}
]}.