Skip to content

Commit

Permalink
Merge pull request #177 from inaka/modernize
Browse files Browse the repository at this point in the history
Modernize
  • Loading branch information
elbrujohalcon authored Oct 7, 2021
2 parents 799f74a + 0f2b364 commit 8e12489
Show file tree
Hide file tree
Showing 29 changed files with 2,425 additions and 2,545 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Erlang CI

on: [push, pull_request]

jobs:

build:

runs-on: ubuntu-latest

strategy:
matrix:
otp: ['23.3', '24.0']
rebar: ['3.16.1']

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup-beam
with:
otp-version: ${{matrix.otp}}
rebar3-version: ${{matrix.rebar}}
- name: Restore _build
uses: actions/cache@v2
with:
path: _build
key: _build-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}}
- name: Restore rebar3's cache
uses: actions/cache@v2
with:
path: ~/.cache/rebar3
key: rebar3-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}}
- name: Compile
run: rebar3 compile
- name: Format check
run: rebar3 format --verify
- name: Run tests and verifications
run: rebar3 test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
rebar3.crashdump
doc/
codecov.json
_build/
all.coverdata
Expand Down
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Emakefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Worker Pool [![Build Status](https://travis-ci.org/inaka/worker_pool.svg?branch=master)](https://travis-ci.org/inaka/worker_pool)[![codecov](https://codecov.io/gh/inaka/worker_pool/branch/master/graph/badge.svg)](https://codecov.io/gh/inaka/worker_pool)
# Worker Pool [![Build Status](https://travis-ci.org/inaka/worker_pool.svg?branch=main)](https://travis-ci.org/inaka/worker_pool)[![codecov](https://codecov.io/gh/inaka/worker_pool/branch/main/graph/badge.svg)](https://codecov.io/gh/inaka/worker_pool)

<img src="http://img3.wikia.nocookie.net/__cb20140705120849/clubpenguin/images/thumb/f/ff/MINIONS.jpg/481px-MINIONS.jpg" align="right" style="float:right" height="400" />

Expand Down
21 changes: 0 additions & 21 deletions ci

This file was deleted.

82 changes: 20 additions & 62 deletions elvis.config
Original file line number Diff line number Diff line change
@@ -1,62 +1,20 @@
[
{
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
, dont_repeat_yourself
, #{ ignore => [wpool_SUITE]
, min_complexity => 13
}
}
, { elvis_style
, line_length
, #{limit => 100}
}
]
},
#{dirs => ["test"],
filter => "*.erl",
ruleset => erl_files,
rules =>
[ { elvis_style
, no_debug_call
, disable
}
, { elvis_style
, dont_repeat_yourself
, #{min_complexity => 13}
}
, { elvis_style
, line_length
, #{limit => 100}
}
]
},
#{dirs => ["."],
filter => "Makefile",
ruleset => makefiles
},
#{dirs => ["."],
filter => "elvis.config",
ruleset => elvis_config
}
]
}
]
}
].
[{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}]}]}].
125 changes: 64 additions & 61 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,75 +2,78 @@
%% ex: ts=4 sw=4 ft=erlang et

%% == Erlang Compiler ==
{minimum_otp_vsn, "21.0"}.
{minimum_otp_vsn, "23"}.

%% Erlang compiler options
{erl_opts, [ warn_unused_vars
, ewarn_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
, debug_info
]}.
{erl_opts,
[warn_unused_vars,
ewarn_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,
debug_info]}.

{profiles, [{test, [{deps, [ {katana_test, "1.0.1"}
, {katana, "0.4.0"}
, {mixer, "1.1.0", {pkg, inaka_mixer}}
, {meck, "0.8.13"}
]
}]
}]
}.
{profiles,
[{test,
[{deps, [{katana, "1.0.0"}, {mixer, "1.2.0", {pkg, inaka_mixer}}, {meck, "0.9.2"}]}]}]}.

{ct_compile_opts, [ warn_unused_vars
, 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
, debug_info
]}.
{ct_compile_opts,
[warn_unused_vars,
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,
debug_info]}.

{ct_opts, []}.

{alias, [{test, [dialyzer, ct, cover]}]}.

{ct_extra_params,"-no_auto_compile -dir ebin -logdir log/ct --erl_args -smp enable -boot start_sasl"}.
{ct_extra_params,
"-no_auto_compile -dir ebin -logdir log/ct --erl_args -smp enable -boot start_sasl"}.

{edoc_opts, [ {report_missing_types, true}
, {source_path, ["src"]}
, {report_missing_types, true}
, {todo, true}
, {packages, false}
, {subpackages, false}
]}.
{edoc_opts,
[{report_missing_types, true},
{source_path, ["src"]},
{report_missing_types, true},
{todo, true},
{packages, false},
{subpackages, false}]}.

{dialyzer, [ {warnings, [ race_conditions
, no_return
, unmatched_returns
, error_handling
, unknown
]}
, {plt_apps, all_deps}
, {plt_extra_apps, [erts, kernel, stdlib]}
, {plt_location, local}
, {base_plt_apps, [stdlib, kernel]}
, {base_plt_location, global}
]}.
{dialyzer,
[{warnings,
[race_conditions, unknown, no_return, unmatched_returns, error_handling, underspecs]}]}.

{project_plugins,
[{rebar3_hex, "~> 6.11.7"},
{rebar3_format, "~> 1.0.1"},
{rebar3_lint, "~> 0.5.0"},
{rebar3_hank, "~> 1.2.2"},
rebar3_depup]}.

{cover_enabled, true}.

{cover_opts, [verbose]}.

{alias,
[{test, [compile, format, lint, hank, dialyzer, {ct, "--verbose"}, cover, edoc]}]}.

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

{ application
, worker_pool
, [ {description, "Erlang Worker Pool"}
, {vsn, "4.0.3"}
, {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/http://inaka.net/blog/2014/09/25/worker-pool/"}
]}
, {build_tools,["rebar3"]}
]
}.
{application,
worker_pool,
[{description, "Erlang Worker Pool"},
{vsn, "4.0.3"},
{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/http://inaka.net/blog/2014/09/25/worker-pool/"}]},
{build_tools, ["rebar3"]}]}.
Loading

0 comments on commit 8e12489

Please sign in to comment.