Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent dialyzer warnings on OTP 23 #105

Merged
merged 3 commits into from
Nov 9, 2020
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
9 changes: 9 additions & 0 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
case os:getenv("TARGET_ERLANG_VERSION") of
false -> CONFIG;
[] -> CONFIG;
TargetErlangVersionString ->
GpbOpts = proplists:get_value(gpb_opts, CONFIG),
TargetErlangVersion = {target_erlang_version, list_to_integer(TargetErlangVersionString)},
NewGpbOpts = lists:keystore(target_erlang_version, 1, GpbOpts, TargetErlangVersion),
lists:keystore(gpb_opts, 1, CONFIG, {gpb_opts, NewGpbOpts})
end.
2 changes: 1 addition & 1 deletion src/hex_api_release.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ publish(Config, Tarball) -> publish(Config, Tarball, []).
%% }}}
%% '''
%% @end
-spec publish(hexcore:config(), binary(), publish_params()) -> hex_api:response().
-spec publish(hex_core:config(), binary(), publish_params()) -> hex_api:response().
publish(Config, Tarball, Params) when is_map(Config) andalso is_binary(Tarball) andalso is_list(Params)->
QueryString = hex_api:encode_query_string([{replace, proplists:get_value(replace, Params, false)}]),
Path = hex_api:join_path_segments(hex_api:build_repository_path(Config, ["publish"])),
Expand Down
2 changes: 2 additions & 0 deletions src/hex_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

-type method() :: get | post | put | patch | delete.
-type status() :: non_neg_integer().
-export_type([status/0]).
-type headers() :: #{binary() => binary()}.
-export_type([headers/0]).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll be changing this type in the future (#77) but it's probably ok to export it since we use it elsewhere, otherwise we get the warnings.

-type body() :: {ContentType :: binary(), Body :: binary()} | undefined.
-type adapter_config() :: map().

Expand Down
4 changes: 2 additions & 2 deletions src/hex_registry.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
]).
-include_lib("public_key/include/public_key.hrl").

-type private_key() :: public_key:rsa_private_key() | binary().
-type public_key() :: public_key:rsa_public_key() | binary().
-type private_key() :: #'RSAPrivateKey'{} | binary().
-type public_key() :: #'RSAPublicKey'{} | binary().

%%====================================================================
%% API functions
Expand Down