Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
64a2a22617a942230873949cb0a11ac582741438
2 changes: 1 addition & 1 deletion .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Compile
run: rebar3 compile
- name: Format check
run: rebar3 format --verify
run: rebar3 fmt --check
- name: Run tests and verifications
run: rebar3 test
- name: Upload code coverage
Expand Down
53 changes: 33 additions & 20 deletions elvis.config
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
[{elvis,
[{config,
[#{dirs => ["src"],
filter => "*.erl",
ruleset => erl_files,
rules =>
[{elvis_style, invalid_dynamic_call, #{ignore => [wpool_process, wpool_time_checker]}},
{elvis_style, god_modules, #{limit => 30}},
{elvis_style, state_record_and_type, disable},
{elvis_style, dont_repeat_yourself, #{ignore => [wpool_SUITE], min_complexity => 13}}]},
#{dirs => ["test"],
filter => "*.erl",
ruleset => erl_files,
rules =>
[{elvis_style, no_debug_call, disable},
{elvis_style, state_record_and_type, disable},
{elvis_style, dont_repeat_yourself, #{min_complexity => 13}}]},
#{dirs => ["."],
filter => "elvis.config",
ruleset => elvis_config}]}]}].
[
{elvis, [
{config, [
#{
dirs => ["src/**"],
filter => "*.erl",
ruleset => erl_files,
rules =>
[
{elvis_style, no_invalid_dynamic_calls, #{
ignore => [wpool_process, wpool_time_checker]
}},
{elvis_style, no_god_modules, #{limit => 30}},
{elvis_style, state_record_and_type, disable},
{elvis_style, dont_repeat_yourself, #{
ignore => [wpool_SUITE], min_complexity => 13
}}
]
},
#{
dirs => ["test"],
filter => "*.erl",
ruleset => erl_files,
rules =>
[
{elvis_style, no_debug_call, disable},
{elvis_style, state_record_and_type, disable},
{elvis_style, dont_repeat_yourself, #{min_complexity => 13}}
]
}
]}
]}
].
97 changes: 52 additions & 45 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,69 +1,76 @@
%% == Compiler and Profiles ==

{erl_opts,
[warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}.
{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.0.0"}]},
{dialyzer,
[{warnings, [no_return, unmatched_returns, error_handling, underspecs, unknown]},
{plt_extra_apps, [common_test, katana, meck]}]}]}]}.

{alias,
[{test,
[compile,
format,
hank,
lint,
xref,
dialyzer,
ct,
cover,
{covertool, "generate"},
ex_doc]}]}.
{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.0.0"}]},
{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.4.1"},
{rebar3_hex, "~> 7.0.11"},
{rebar3_format, "~> 1.3.0"},
{rebar3_lint, "~> 4.1.0"},
{rebar3_ex_doc, "~> 0.2.30"},
{rebar3_depup, "~> 0.4.0"},
{covertool, "~> 2.0.7"}]}.
{project_plugins, [
{rebar3_hank, "~> 1.4.1"},
{rebar3_depup, "~> 0.4.0"},
{rebar3_hex, "~> 7.0"},
{rebar3_ex_doc, "~> 0.2"},
{rebar3_lint, "~> 4.2"},
{erlfmt, "~> 1.7"},
{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}]}.
{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 ==

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

%% == Dialyzer + XRef ==

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

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

{xref_extra_paths, ["test/**"]}.
33 changes: 17 additions & 16 deletions src/worker_pool.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
% specific language governing permissions and limitations
% under the License.

{application,
worker_pool,
[{description, "Erlang Worker Pool"},
{vsn, git},
{id, "worker_pool"},
{registered, []},
{modules, []},
{applications, [kernel, stdlib]},
{mod, {wpool, []}},
{env, []},
{licenses, ["Apache2"]},
{links,
[{"GitHub", "https://github.com/inaka/worker_pool"},
{"Blog Post",
"https://web.archive.org/web/20170602054156/https://inaka.net/blog/2014/09/25/worker-pool/"}]},
{build_tools, ["rebar3"]}]}.
{application, worker_pool, [
{description, "Erlang Worker Pool"},
{vsn, git},
{id, "worker_pool"},
{registered, []},
{modules, []},
{applications, [kernel, stdlib]},
{mod, {wpool, []}},
{env, []},
{licenses, ["Apache2"]},
{links, [
{"GitHub", "https://github.com/inaka/worker_pool"},
{"Blog Post",
"https://web.archive.org/web/20170602054156/https://inaka.net/blog/2014/09/25/worker-pool/"}
]},
{build_tools, ["rebar3"]}
]}.
Loading