Skip to content

Commit 6b56f8e

Browse files
Merge pull request #91 from paulo-ferraz-oliveira/fix/for-strict-generators
Support OTP 28
2 parents cd4287f + 44f7a51 commit 6b56f8e

File tree

10 files changed

+922
-574
lines changed

10 files changed

+922
-574
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,31 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
otp: ['25', '26', '27']
14-
rebar: ['3.24']
13+
otp: ['26', '27', '28']
14+
rebar: ['3.25']
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: erlef/setup-beam@v1
1919
id: setup-beam
2020
with:
2121
otp-version: ${{matrix.otp}}
2222
rebar3-version: ${{matrix.rebar}}
2323
- name: Restore _build
24-
uses: actions/cache@v3
24+
uses: actions/cache@v4
2525
with:
2626
path: _build
2727
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')}}
2828
- name: Restore rebar3's cache
29-
uses: actions/cache@v3
29+
uses: actions/cache@v4
3030
with:
3131
path: ~/.cache/rebar3
3232
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')}}
3333
- name: Compile
3434
run: ERL_FLAGS="-enable-feature all" rebar3 compile
35-
#- name: Format check
36-
# run: ERL_FLAGS="-enable-feature all" rebar3 format --verify
35+
- name: Format check
36+
if: matrix.otp == '27'
37+
run: rebar3 fmt --check
3738
- name: Run tests and verifications (features not enabled)
3839
run: rebar3 test
3940
- name: Run tests and verifications (features enabled)

elvis.config

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
[{elvis,
2-
[{config,
3-
[#{dirs => ["src"],
4-
filter => "*.erl",
5-
ruleset => erl_files,
6-
rules => [{elvis_style, atom_naming_convention, #{regex => "^([a-z][A-Za-z0-9]*_?)*$"}}]},
7-
#{dirs => ["test"],
8-
filter => "*.erl",
9-
ruleset => erl_files,
10-
rules => [{elvis_style, no_debug_call, disable}]}]}]}].
1+
[
2+
{elvis, [
3+
{config, [
4+
#{
5+
dirs => ["src"],
6+
filter => "*.erl",
7+
ruleset => erl_files,
8+
rules => [
9+
{elvis_style, atom_naming_convention, #{regex => "^([a-z][A-Za-z0-9]*_?)*$"}}
10+
]
11+
},
12+
#{
13+
dirs => ["test"],
14+
filter => "*.erl",
15+
ruleset => erl_files,
16+
rules => [{elvis_style, no_debug_call, disable}]
17+
}
18+
]}
19+
]}
20+
].

rebar.config

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
11
%% == Compiler and Profiles ==
22

3-
{erl_opts,
4-
[warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}.
3+
{erl_opts, [warn_unused_import, warn_export_vars, warnings_as_errors, verbose, report, debug_info]}.
54

6-
{minimum_otp_vsn, "25"}.
5+
{minimum_otp_vsn, "26"}.
76

8-
{profiles,
9-
[{test, [{cover_enabled, true}, {cover_opts, [verbose]}, {ct_opts, [{verbose, true}]}]}]}.
7+
{profiles, [{test, [{cover_enabled, true}, {cover_opts, [verbose]}, {ct_opts, [{verbose, true}]}]}]}.
108

119
{alias, [{test, [compile, lint, xref, dialyzer, ct, cover]}]}.
1210

1311
%% == Dependencies and plugins ==
1412

15-
{project_plugins,
16-
[{rebar3_hank, "~> 1.4.0"},
17-
{rebar3_hex, "~> 7.0.7"},
18-
{rebar3_format, "~> 1.3.0"},
19-
{rebar3_lint, "~> 3.1.0"},
20-
{rebar3_ex_doc, "~> 0.2.20"}]}.
13+
{project_plugins, [
14+
{rebar3_hank, "~> 1.4.0"},
15+
{rebar3_hex, "~> 7.0.7"},
16+
{erlfmt, "~> 1.6.2"},
17+
{rebar3_lint, "~> 3.1.0"},
18+
{rebar3_ex_doc, "~> 0.2.20"}
19+
]}.
2120

2221
%% == Documentation ==
2322

24-
{ex_doc,
25-
[{source_url, <<"https://github.com/inaka/katana-code">>},
26-
{extras, [<<"README.md">>, <<"LICENSE">>]},
27-
{main, <<"README.md">>},
28-
{prefix_ref_vsn_with_v, false}]}.
23+
{ex_doc, [
24+
{source_url, <<"https://github.com/inaka/katana-code">>},
25+
{extras, [<<"README.md">>, <<"LICENSE">>]},
26+
{main, <<"README.md">>},
27+
{prefix_ref_vsn_with_v, false}
28+
]}.
2929

3030
{hex, [{doc, #{provider => ex_doc}}]}.
3131

3232
%% == Format ==
3333

34-
{format, [{options, #{unquote_atoms => false}}]}.
34+
{erlfmt, [
35+
write,
36+
{files, ["src/**/*.app.src", "src/**/*.erl", "test/**/*.erl", "*.config"]}
37+
]}.
3538

3639
%% == Dialyzer + XRef ==
3740

38-
{dialyzer,
39-
[{warnings, [no_return, unmatched_returns, error_handling, underspecs, unknown]},
40-
{plt_extra_apps, [syntax_tools, common_test]}]}.
41+
{dialyzer, [
42+
{warnings, [no_return, unmatched_returns, error_handling, underspecs, unknown]},
43+
{plt_extra_apps, [syntax_tools, common_test]}
44+
]}.
4145

42-
{xref_checks,
43-
[undefined_function_calls, deprecated_function_calls, deprecated_functions]}.
46+
{xref_checks, [undefined_function_calls, deprecated_function_calls, deprecated_functions]}.
4447

4548
{xref_extra_paths, ["test/**"]}.

src/katana_code.app.src

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{application,
2-
katana_code,
3-
[{description, "Functions useful for processing Erlang code."},
4-
{vsn, git},
5-
{applications, [kernel, stdlib]},
6-
{modules, []},
7-
{registered, []},
8-
{licenses, ["Apache 2.0"]},
9-
{links, [{"GitHub", "https://github.com/inaka/katana-code"}]},
10-
{build_tools, ["rebar3"]}]}.
1+
{application, katana_code, [
2+
{description, "Functions useful for processing Erlang code."},
3+
{vsn, git},
4+
{applications, [kernel, stdlib]},
5+
{modules, []},
6+
{registered, []},
7+
{licenses, ["Apache 2.0"]},
8+
{links, [{"GitHub", "https://github.com/inaka/katana-code"}]},
9+
{build_tools, ["rebar3"]}
10+
]}.

0 commit comments

Comments
 (0)