Skip to content

Commit 61cdc9e

Browse files
authored
Merge pull request #77 from dw-kihara/feature/brushups_for_otp27
Brushups for OTP27
2 parents e4a797a + d7433ba commit 61cdc9e

File tree

7 files changed

+21
-19
lines changed

7 files changed

+21
-19
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
platform: [ubuntu-latest]
14-
otp-version: [22, 23, 24, 25, 26]
14+
otp-version: [23, 24, 25, 26, 27]
1515
runs-on: ${{ matrix.platform }}
1616
container:
1717
image: erlang:${{ matrix.otp-version }}
@@ -64,7 +64,7 @@ jobs:
6464
strategy:
6565
matrix:
6666
platform: [ubuntu-latest]
67-
otp-version: [24, 25, 26]
67+
otp-version: [24, 25, 26, 27]
6868
runs-on: ${{ matrix.platform }}
6969
container:
7070
image: erlang:${{ matrix.otp-version }}
@@ -86,4 +86,4 @@ jobs:
8686
restore-keys: |
8787
${{ runner.os }}-dialyzer-
8888
- name: Generate docs
89-
run: rebar3 ex_doc
89+
run: rebar3 ex_doc

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
, deprecated_functions
4141
]}.
4242

43-
{plugins, [ {rebar3_lint, "0.3.2"} ]}.
43+
{plugins, [ {rebar3_lint, "3.0.1"} ]}.

rebar.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{"1.2.0",
22
[{<<"eini">>,{pkg,<<"eini_beam">>,<<"2.2.4">>},0},
3-
{<<"iso8601">>,{pkg,<<"iso8601">>,<<"1.3.1">>},0},
3+
{<<"iso8601">>,{pkg,<<"iso8601">>,<<"1.3.4">>},0},
44
{<<"jsx">>,{pkg,<<"jsx">>,<<"3.1.0">>},0}]}.
55
[
66
{pkg_hash,[
77
{<<"eini">>, <<"02143B1DCE4DDA4243248E7D9B3D8274B8D9F5A666445E3D868E2CCE79E4FF22">>},
8-
{<<"iso8601">>, <<"D1CEE73F56D71C35590C6B2DB2074873BF410BABAAB768F6EA566366D8CA4810">>},
8+
{<<"iso8601">>, <<"7B1F095F86F6CF65E1E5A77872E8E8BF69BD58D4C3A415B3F77D9CC9423ECBB9">>},
99
{<<"jsx">>, <<"D12516BAA0BB23A59BB35DCCAF02A1BD08243FCBB9EFE24F2D9D056CCFF71268">>}]},
1010
{pkg_hash_ext,[
1111
{<<"eini">>, <<"12DE479D144B19E09BB92BA202A7EA716739929AFDF9DFF01AD802E2B1508471">>},
12-
{<<"iso8601">>, <<"A8B00594F4309A41D17BA4AEAB2B94DFE1F4BE99F263BC1F46DAC9002CE99A29">>},
12+
{<<"iso8601">>, <<"A334469C07F1C219326BC891A95F5EEC8EB12DD8071A3FFF56A7843CB20FAE34">>},
1313
{<<"jsx">>, <<"0C5CC8FDC11B53CC25CF65AC6705AD39E54ECC56D1C22E4ADB8F5A53FB9427F3">>}]}
1414
].

src/aws_credentials.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
, tref = undefined :: reference()
4242
| undefined
4343
}).
44-
-type state() :: #state{}.
44+
-opaque state() :: #state{}.
45+
-export_type([state/0]). % for linter only
4546

4647
-type credentials() :: #{ credential_provider := aws_credentials_provider:provider()
4748
, access_key_id := access_key_id()
@@ -128,9 +129,9 @@ terminate(_Reason, _State) ->
128129

129130
-spec handle_call(any(), any(), state()) ->
130131
{'noreply', _} | {'reply', any(), state()}.
131-
handle_call(get_credentials, _From, State=#state{credentials=C}) ->
132+
handle_call(get_credentials, _From, #state{credentials=C}=State) ->
132133
{reply, C, State};
133-
handle_call({force_refresh, Options}, _From, State=#state{tref=T}) ->
134+
handle_call({force_refresh, Options}, _From, #state{tref=T}=State) ->
134135
{ok, C, NewT} = fetch_credentials(Options),
135136
case is_reference(T) of
136137
true -> erlang:cancel_timer(T);

src/aws_credentials_app.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
%% API
1212
%%====================================================================
1313

14-
-spec start( 'normal'
15-
| {takeover, Node :: node()}
16-
| {failover, Node :: node()}, any()) -> {ok, pid()}.
14+
-spec start('normal'
15+
| {takeover, Node :: node()}
16+
| {failover, Node :: node()}, any()) -> {ok, pid()}.
1717
start(_StartType, _StartArgs) ->
1818
aws_credentials_httpc:start(),
1919
aws_credentials_sup:start_link().

src/aws_credentials_httpc.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,15 @@
3232
-type headers() :: [header()].
3333
-type response() :: {'error', response_error()} | {'ok', status_code(), body(), headers()}.
3434

35-
-export_type([response/0, response_error/0, status_code/0, body/0, headers/0]).
36-
37-
-spec start() -> ok.
35+
-export_type([response/0, response_error/0, status_code/0, body/0,
36+
headers/0, header/0, url/0, method/0]).
3837

3938
-include_lib("kernel/include/logger.hrl").
4039

40+
-spec start() -> ok.
4141
start() ->
42-
inets:start(httpc, [{profile, ?PROFILE}]).
42+
_ = inets:start(httpc, [{profile, ?PROFILE}]),
43+
ok.
4344

4445
%% @doc Attempt to request a URL with the 3 retries. 3 is the default.
4546
-spec request(method(), url()) -> response().
@@ -58,7 +59,7 @@ request(Method, URL, RequestHeaders) ->
5859
%% successfully get the desired data. That is, it will return an
5960
%% ok tuple with a status code of 500 or 404 or some other HTTP error
6061
%% code and no data.
61-
-spec request(method(), url(), [header()], pos_integer() ) -> response().
62+
-spec request(method(), url(), [header()], pos_integer()) -> response().
6263
request(Method, URL, RequestHeaders, Tries) when is_atom(Method)
6364
andalso is_list(URL)
6465
andalso is_integer(Tries)

src/aws_credentials_provider.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
| aws_credentials_ec2
3939
| module().
4040
-type error_log() :: [{provider(), term()}].
41-
-export_type([ options/0, expiration/0, provider/0 ]).
41+
-export_type([ options/0, expiration/0, provider/0, error_log/0 ]).
4242

4343
-callback fetch(options()) ->
4444
{ok, aws_credentials:credentials(), expiration()} | {error, any()}.

0 commit comments

Comments
 (0)