Skip to content

Commit 8ac0829

Browse files
Merge pull request #7196 from rabbitmq/dialyzer-enable-Wunkown
Fix all dependencies for the dialyzer
2 parents 12558a9 + 949b535 commit 8ac0829

File tree

27 files changed

+154
-83
lines changed

27 files changed

+154
-83
lines changed

deps/rabbit/BUILD.bazel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ load(
1010
"rabbitmq_integration_suite",
1111
"rabbitmq_suite",
1212
"rabbitmq_test_helper",
13+
"without",
1314
)
1415
load(":bats.bzl", "bats")
1516

@@ -213,7 +214,8 @@ plt(
213214
)
214215

215216
dialyze(
216-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
217+
# A few `lg` functions are unknown
218+
dialyzer_opts = without("-Wunknown", RABBITMQ_DIALYZER_OPTS),
217219
plt = ":base_plt",
218220
)
219221

@@ -518,7 +520,7 @@ rabbitmq_integration_suite(
518520
size = "small",
519521
additional_srcs = [
520522
"test/mirrored_supervisor_SUITE_gs.erl",
521-
]
523+
],
522524
)
523525

524526
rabbitmq_suite(

deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ load("@rules_erlang//:xref2.bzl", "xref")
22
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
5-
"RABBITMQ_DIALYZER_OPTS",
65
"APP_VERSION",
6+
"RABBITMQ_DIALYZER_OPTS",
77
"rabbitmq_app",
88
"rabbitmq_suite",
99
)
@@ -41,7 +41,10 @@ xref(
4141

4242
plt(
4343
name = "base_plt",
44-
apps = ["runtime_tools", "eunit"],
44+
apps = [
45+
"runtime_tools",
46+
"eunit",
47+
],
4548
plt = "//:base_plt",
4649
deps = DEPS + RUNTIME_DEPS + [
4750
"@systemd//:erlang_app",
@@ -50,8 +53,8 @@ plt(
5053
)
5154

5255
dialyze(
53-
plt = ":base_plt",
5456
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
57+
plt = ":base_plt",
5558
)
5659

5760
suites = [

deps/rabbit/src/rabbit_access_control.erl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616

1717
%%----------------------------------------------------------------------------
1818

19-
-export_type([permission_atom/0]).
20-
21-
-type permission_atom() :: 'configure' | 'write' | 'read'.
22-
23-
%%----------------------------------------------------------------------------
24-
2519
-spec check_user_pass_login
2620
(rabbit_types:username(), rabbit_types:password()) ->
2721
{'ok', rabbit_types:user()} |
@@ -179,7 +173,7 @@ create_vhost_access_authz_data(PeerAddr, Context) ->
179173
maps:merge(PeerAddr, Context).
180174

181175
-spec check_resource_access
182-
(rabbit_types:user(), rabbit_types:r(atom()), permission_atom(), rabbit_types:authz_context()) ->
176+
(rabbit_types:user(), rabbit_types:r(atom()), rabbit_types:permission_atom(), rabbit_types:authz_context()) ->
183177
'ok' | rabbit_types:channel_exit().
184178

185179
check_resource_access(User, R = #resource{kind = exchange, name = <<"">>},

deps/rabbit/src/rabbit_channel.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225

226226
-export_type([channel_number/0]).
227227

228-
-type channel_number() :: non_neg_integer().
228+
-type channel_number() :: rabbit_types:channel_number().
229229

230230
-export_type([channel/0]).
231231

deps/rabbit/src/rabbit_exchange.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
%%----------------------------------------------------------------------------
2323

2424
-export_type([name/0, type/0]).
25-
-type name() :: rabbit_types:r('exchange').
26-
-type type() :: atom().
25+
-type name() :: rabbit_types:exchange_name().
26+
-type type() :: rabbit_types:exchange_type().
2727
-type fun_name() :: atom().
2828

2929
%%----------------------------------------------------------------------------

deps/rabbit/src/rabbit_guid.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
-export_type([guid/0]).
2727

28-
-type guid() :: binary().
28+
-type guid() :: rabbit_types:guid().
2929

3030
%%----------------------------------------------------------------------------
3131

deps/rabbit/src/rabbit_router.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
-export_type([routing_key/0, match_result/0]).
1717

18-
-type routing_key() :: binary().
18+
-type routing_key() :: rabbit_types:routing_key().
1919
-type match_result() :: [rabbit_types:binding_destination()].
2020

2121
%%----------------------------------------------------------------------------

deps/rabbit/src/vhost.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
-define(record_version, vhost_v2).
3636

37-
-type(name() :: binary()).
37+
-type(name() :: rabbit_types:vhost()).
3838

3939
-type(limits() :: list()).
4040

deps/rabbit_common/BUILD.bazel

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ load("@rules_erlang//:xref2.bzl", "xref")
22
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
5+
"RABBITMQ_DIALYZER_OPTS",
56
"assert_suites",
67
"rabbitmq_app",
78
"rabbitmq_suite",
@@ -55,6 +56,7 @@ RUNTIME_DEPS = [
5556
"@thoas//:erlang_app",
5657
"@recon//:erlang_app",
5758
"@credentials_obfuscation//:erlang_app",
59+
"@ranch//:erlang_app",
5860
]
5961

6062
APP_NAME = "rabbit_common"
@@ -89,6 +91,8 @@ EXTRA_APPS = [
8991
"syntax_tools",
9092
"tools",
9193
"xmerl",
94+
"runtime_tools",
95+
"os_mon",
9296
]
9397

9498
rabbitmq_app(
@@ -106,23 +110,17 @@ rabbitmq_app(
106110
runtime_deps = RUNTIME_DEPS,
107111
)
108112

109-
xref(
110-
additional_libs = [
111-
"@ranch//:erlang_app",
112-
],
113-
)
113+
xref()
114114

115115
plt(
116116
name = "base_plt",
117-
apps = [
118-
"mnesia",
119-
"crypto",
120-
"ssl",
121-
] + EXTRA_APPS,
117+
apps = EXTRA_APPS + ["mnesia"],
122118
plt = "//:base_plt",
119+
deps = RUNTIME_DEPS,
123120
)
124121

125122
dialyze(
123+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
126124
plt = ":base_plt",
127125
)
128126

deps/rabbit_common/src/rabbit_authz_backend.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
%% Something went wrong. Log and die.
5151
-callback check_resource_access(rabbit_types:auth_user(),
5252
rabbit_types:r(atom()),
53-
rabbit_access_control:permission_atom(),
53+
rabbit_types:permission_atom(),
5454
rabbit_types:authz_context()) ->
5555
boolean() | {'error', any()}.
5656

@@ -63,7 +63,7 @@
6363
%% Something went wrong. Log and die.
6464
-callback check_topic_access(rabbit_types:auth_user(),
6565
rabbit_types:r(atom()),
66-
rabbit_access_control:permission_atom(),
66+
rabbit_types:permission_atom(),
6767
rabbit_types:topic_access_context()) ->
6868
boolean() | {'error', any()}.
6969

0 commit comments

Comments
 (0)