Skip to content

Commit

Permalink
chore: fix dialyzer (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilianobovetti authored Nov 14, 2022
1 parent 4dfe36d commit aa3a6d8
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 35 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ jobs:
container: erlang:21
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Rebar cache
uses: actions/cache@v3
with:
path: |
~/.cache/rebar3
_build
key: ${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-${{ hashFiles('**/*rebar.lock') }}
restore-keys: |
${{ runner.os }}-erlang-${{ env.OTP_VERSION }}-
- name: Dialyzer
run: rebar3 dialyzer

- name: Run tests
run: make ct
26 changes: 13 additions & 13 deletions src/soap.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
soap_action = [] :: string(),
wrapper_ns = [] :: string() | undefined, %% namespace for the wrapper element (in
%% case of rpc style)
op_type :: notification | request_response,
op_type :: notification | request_response | undefined,
in_type :: [{string(), atom()}] | atom(), %% the list type is only used
%% during construction of the
%% interface
Expand All @@ -37,25 +37,25 @@

-record(interface, {
service :: string(),
module :: module(), %% The module that makes the interface available
version :: '1.1' | '1.2',
http_client :: module(),
module :: module() | undefined, %% The module that makes the interface available
version :: '1.1' | '1.2' | undefined,
http_client :: module() | undefined,
http_server :: module() | undefined,
server_handler :: module() | undefined,
client_handler :: module() | undefined,
http_options = [] :: [any()],
target_ns :: string(),
soap_ns :: string(),
http_options = [] :: [any()] | undefined,
target_ns :: string() | undefined,
soap_ns :: string() | undefined,
style :: string() | undefined, %% "rpc" | "document"
decoders :: [{string(), module}] | undefined,
url :: string(),
url :: string() | undefined,
port :: string(),
binding :: string(),
port_type :: string(),
ops = [] :: [op()],
model :: erlsom:model(),
binding :: string() | undefined,
port_type :: string() | undefined,
ops = [] :: [op()] | undefined,
model :: erlsom:model() | undefined,
%% the fields below are only used during the creation of the interface
prefix_count = 0 :: integer(), %% used to assign unique prefixes
prefix_count = 0 :: integer() | undefined, %% used to assign unique prefixes
tns_prefix :: string() | undefined, %% used for rpc type wsdl if the target ns
%% is also used as the ns of an operation.
imported = [] :: [{string(), string() | undefined}] %% imported namespaces,
Expand Down
8 changes: 4 additions & 4 deletions src/soap_client_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
version :: '1.1' | '1.2',
soap_ns :: string(),
state :: atom(),
parser :: fun(),
header_parser :: fun(),
fault_parser :: fun(),
parser :: fun() | undefined,
header_parser :: fun() | undefined,
fault_parser :: fun() | undefined,
parser_state :: any(),
soap_headers = [] :: [string() | tuple()],
soap_body :: string() | tuple(),
soap_body :: string() | tuple() | undefined,
is_fault = false :: boolean(),
namespaces = [] :: [{prefix(), uri()}]
}).
Expand Down
16 changes: 8 additions & 8 deletions src/soap_fault.erl
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@
-record(pf_state, {
version :: atom(),
state :: atom(),
characters = "" :: string(),
code :: fault_code_object(),
fault_string :: fault_string(),
actor :: fault_actor(),
reasons = [] :: [fault_reason()],
language :: string(),
detail_tag :: {tag(), uri()},
details = [] :: [{tag(), uri(), string()}]
characters = "" :: string() | undefined,
code :: fault_code_object() | undefined,
fault_string :: fault_string() | undefined,
actor :: fault_actor() | undefined,
reasons = [] :: [fault_reason()] | undefined,
language :: string() | undefined,
detail_tag :: {tag(), uri()} | undefined,
details = [] :: [{tag(), uri(), string()}] | undefined
}).

-record(attribute, {
Expand Down
4 changes: 2 additions & 2 deletions src/soap_fault.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
tag :: string(),
text :: string()}).

-record(faultcode, {uri :: string(),
-record(faultcode, {uri :: string() | undefined,
code :: string() | atom(),
subcode :: #faultcode{} % only v. 1.2
subcode :: #faultcode{} | undefined % only v. 1.2
}).

-record(faultreason, {text :: string(),
Expand Down
6 changes: 3 additions & 3 deletions src/soap_hrl2wsdl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
-type option() :: {target_namespace, string()}.

-record(operation, {
name :: string(),
in :: string(),
out :: string()
name :: atom(),
in :: atom(),
out :: atom()
}).


Expand Down
2 changes: 1 addition & 1 deletion src/soap_req.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
server_req :: server_req(),
handler :: module(),
handler_state :: any(),
http_body :: binary(),
http_body :: binary() | undefined,
server :: atom(),
req_soap_attachments = [] :: [soap_attachment()],
mime_headers = [] :: [http_header()], %% headers of the mime part
Expand Down
6 changes: 3 additions & 3 deletions src/soap_server_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
type :: soap_error_code(),
stacktrace :: any(),
description :: string(),
soap_req :: soap_req(),
soap_req :: soap_req() | undefined,
class :: atom(),
handler :: module(),
handler_state :: any(),
handler :: module() | undefined,
handler_state :: any() | undefined,
reason :: any()}).

-type soap_error() :: #soap_error{}.
Expand Down

0 comments on commit aa3a6d8

Please sign in to comment.