-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from paulo-ferraz-oliveira/feature/minor-maint…
…enance-updates Maintenance updates
- Loading branch information
Showing
16 changed files
with
648 additions
and
744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
name: Erlang CI | ||
|
||
"on": [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
matrix: | ||
otp: ['24', '25', '26'] | ||
rebar: ['3.22'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: erlef/setup-beam@v1 | ||
id: setup-beam | ||
with: | ||
otp-version: ${{matrix.otp}} | ||
rebar3-version: ${{matrix.rebar}} | ||
- name: Restore _build | ||
uses: actions/cache@v3 | ||
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@v3 | ||
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 | ||
- name: Run meta verifications | ||
run: rebar3 as test test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Lint | ||
|
||
"on": [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# uses .markdownlint-cli2.yaml for configuration | ||
- name: markdownlint | ||
uses: DavidAnson/markdownlint-cli2-action@v11 | ||
with: | ||
globs: | | ||
*.md | ||
LICENSE | ||
!CHANGELOG.md | ||
- name: yamllint | ||
uses: ibiqlik/action-yamllint@v3 | ||
with: | ||
file_or_dir: | | ||
.github/**/erlang.yml | ||
.*.yml | ||
strict: true | ||
config_file: .yamllint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,6 @@ | ||
doc/ | ||
.erlang.mk/ | ||
zipper.d | ||
.eunit | ||
deps | ||
*.o | ||
*.beam | ||
*.plt | ||
erl_crash.dump | ||
ebin | ||
.erlang.mk.* | ||
log*/ | ||
_build/ | ||
rebar3.crashdump | ||
.rebar3 | ||
_* | ||
logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
default: true | ||
MD013: | ||
line_length: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,11 @@ | ||
[ | ||
{ | ||
elvis, | ||
[ | ||
{config, | ||
[#{dirs => ["src", "test"], | ||
filter => "*.erl", | ||
rules => [{elvis_style, line_length, #{limit => 80, | ||
skip_comments => false}}, | ||
{elvis_style, no_tabs}, | ||
{elvis_style, no_trailing_whitespace}, | ||
{elvis_style, macro_names}, | ||
{elvis_style, macro_module_names}, | ||
{elvis_style, operator_spaces, #{rules => [{right, ","}, | ||
{right, "++"}, | ||
{left, "++"}]}}, | ||
{elvis_style, nesting_level, #{level => 3}}, | ||
{elvis_style, god_modules, #{limit => 30}}, | ||
{elvis_style, no_if_expression}, | ||
{elvis_style, invalid_dynamic_call}, | ||
{elvis_style, used_ignored_variable}, | ||
{elvis_style, no_behavior_info}, | ||
{ | ||
elvis_style, | ||
module_naming_convention, | ||
#{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$", | ||
ignore => []} | ||
}, | ||
{ | ||
elvis_style, | ||
function_naming_convention, | ||
#{regex => "^([a-z][a-z0-9]*_?)*$"} | ||
}, | ||
{elvis_style, state_record_and_type}, | ||
{elvis_style, no_spec_with_records}, | ||
{elvis_style, dont_repeat_yourself, #{min_complexity => 18}}, | ||
{elvis_style, no_debug_call} | ||
] | ||
}, | ||
#{dirs => ["."], | ||
filter => "Makefile", | ||
rules => [{elvis_project, no_deps_master_erlang_mk}, | ||
{elvis_project, protocol_for_deps_erlang_mk, #{regex => "(https://.*|[0-9]+([.][0-9]+)*)"}}] | ||
}, | ||
#{dirs => ["."], | ||
filter => "rebar.config", | ||
rules => [{elvis_project, no_deps_master_rebar}, | ||
{elvis_project, protocol_for_deps_rebar}] | ||
}, | ||
#{dirs => ["."], | ||
filter => "elvis.config", | ||
rules => [{elvis_project, old_configuration_format}] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
]. | ||
[{elvis, | ||
[{config, | ||
[#{dirs => ["src", "test"], | ||
filter => "*.erl", | ||
ruleset => erl_files}, | ||
#{dirs => ["."], | ||
filter => "rebar.config", | ||
ruleset => rebar_config}, | ||
#{dirs => ["."], | ||
filter => "elvis.config", | ||
ruleset => elvis_config}]}]}]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,56 @@ | ||
%% -*- mode: erlang;erlang-indent-level: 2;indent-tabs-mode: nil -*- | ||
%% ex: ts=4 sw=4 ft=erlang et | ||
|
||
%% == Erlang Compiler == | ||
|
||
%% Erlang compiler options | ||
{erl_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 | ||
]}. | ||
|
||
{profiles, [ | ||
{test, [ | ||
{deps, [ | ||
{xref_runner, "1.0.0"} | ||
]} | ||
]}, | ||
{shell, [ | ||
{deps, [ | ||
{sync, {git, "https://github.com/rustyio/sync.git", {ref, "9c78e7b"}}} | ||
]} | ||
]} | ||
]}. | ||
|
||
%% == Common Test == | ||
|
||
%% {erl_opts, [...]}, but for CT runs | ||
{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, []}. | ||
|
||
%% == Cover == | ||
|
||
{cover_enabled, true}. | ||
|
||
{cover_opts, [verbose]}. | ||
|
||
%% == Dependencies == | ||
|
||
{deps, []}. | ||
|
||
%% == Dialyzer == | ||
|
||
{dialyzer, [ | ||
{warnings, [ unmatched_returns | ||
, error_handling | ||
]}, | ||
{get_warnings, true}, | ||
{plt_apps, top_level_deps}, | ||
{plt_extra_apps, []}, | ||
{plt_location, local}, | ||
{base_plt_apps, [stdlib, kernel]}, | ||
{base_plt_location, global} | ||
]}. | ||
|
||
%% == Shell == | ||
|
||
{shell, [{apps, [sync]}]}. | ||
%% == Compiler and Profiles == | ||
|
||
{erl_opts, | ||
[warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}. | ||
|
||
{minimum_otp_vsn, "24"}. | ||
|
||
{profiles, | ||
[{test, | ||
[{cover_enabled, true}, | ||
{cover_opts, [verbose]}, | ||
{ct_opts, [{verbose, true}]}, | ||
{dialyzer, | ||
[{warnings, [no_return, unmatched_returns, error_handling, unknown]}, | ||
{plt_extra_apps, [syntax_tools]}]}]}, | ||
{shell, [{deps, [{sync, "0.4.1"}]}, {apps, [sync]}]}]}. | ||
|
||
{alias, [{test, [compile, format, hank, lint, xref, dialyzer, ct, cover, ex_doc]}]}. | ||
|
||
%% == Dependencies and plugins == | ||
|
||
{project_plugins, | ||
[{rebar3_hank, "~> 1.4.0"}, | ||
{rebar3_hex, "~> 7.0.7"}, | ||
{rebar3_format, "~> 1.3.0"}, | ||
{rebar3_lint, "~> 3.1.0"}, | ||
{rebar3_ex_doc, "~> 0.2.20"}]}. | ||
|
||
%% == Documentation == | ||
|
||
{ex_doc, | ||
[{source_url, <<"https://github.com/inaka/zipper">>}, | ||
{extras, [<<"README.md">>, <<"LICENSE">>]}, | ||
{main, <<"README.md">>}, | ||
{prefix_ref_vsn_with_v, false}]}. | ||
|
||
{hex, [{doc, #{provider => ex_doc}}]}. | ||
|
||
%% == Format == | ||
|
||
{format, [{files, ["*.config", "src/*", "test/*"]}]}. | ||
|
||
%% == Hank == | ||
|
||
{hank, [{ignore, [{"test/*.erl", unnecessary_function_arguments}]}]}. | ||
|
||
%% == Dialyzer + XRef == | ||
|
||
{dialyzer, | ||
[{warnings, [no_return, unmatched_returns, error_handling, unknown]}, | ||
{plt_extra_apps, [syntax_tools]}]}. | ||
|
||
{xref_checks, | ||
[undefined_function_calls, deprecated_function_calls, deprecated_functions]}. | ||
|
||
{xref_extra_paths, ["test/**"]}. |
Oops, something went wrong.