Skip to content

Commit cc1a6be

Browse files
committed
Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps (cherry picked from commit 226e00f) (cherry picked from commit 34f25b3) (cherry picked from commit 4a8d0c3) # Conflicts: # deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel # deps/rabbitmq_stream/BUILD.bazel # deps/rabbitmq_stream_management/BUILD.bazel
1 parent 3cfd987 commit cc1a6be

File tree

40 files changed

+212
-69
lines changed

40 files changed

+212
-69
lines changed

deps/amqp10_client/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ plt(
4646
name = "base_plt",
4747
apps = EXTRA_APPS,
4848
plt = "//:base_plt",
49+
deps = BUILD_DEPS + DEPS,
4950
)
5051

5152
dialyze(
5253
plt = ":base_plt",
5354
tags = ["dialyze"],
54-
warnings_as_errors = False,
5555
)
5656

5757
rabbitmq_home(

deps/amqp10_client/src/amqp10_client_frame_reader.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ handle_event(cast, {unregister_session, _Session, OutgoingChannel, IncomingChann
138138
incoming_channels = IncomingChannels1},
139139
{keep_state, State1};
140140
handle_event(cast, close, _StateName, State = #state{socket = Socket}) ->
141-
close_socket(Socket),
141+
_ = close_socket(Socket),
142142
{stop, normal, State#state{socket = undefined}};
143143

144144
handle_event({call, From}, _Action, _State, _Data) ->

deps/amqp_client/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ plt(
5252
name = "base_plt",
5353
apps = EXTRA_APPS,
5454
plt = "//:base_plt",
55+
deps = DEPS,
5556
)
5657

5758
dialyze(

deps/rabbit/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ plt(
219219
"mnesia",
220220
] + EXTRA_APPS,
221221
plt = "//:base_plt",
222+
deps = DEPS,
222223
)
223224

224225
dialyze(

deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load("//:rabbitmq.bzl", "APP_VERSION", "rabbitmq_app")
44

55
APP_NAME = "rabbitmq_prelaunch"
@@ -31,8 +31,13 @@ xref(
3131
tags = ["xref"],
3232
)
3333

34+
plt(
35+
name = "base_plt",
36+
deps = DEPS,
37+
)
38+
3439
dialyze(
35-
plt = "//:base_plt",
40+
plt = ":base_plt",
3641
tags = ["dialyze"],
3742
warnings_as_errors = False,
3843
)

deps/rabbitmq_amqp1_0/BUILD.bazel

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -49,10 +49,17 @@ xref(
4949
tags = ["xref"],
5050
)
5151

52+
plt(
53+
name = "base_plt",
54+
# this ought to include BUILD_DEPS, but not sure how to
55+
# get dialyze of elixir code working yet
56+
deps = DEPS,
57+
)
58+
5259
dialyze(
5360
size = "medium",
54-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
55-
plt = "//:base_plt",
61+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
62+
plt = ":base_plt",
5663
tags = ["dialyze"],
5764
warnings_as_errors = False,
5865
)

deps/rabbitmq_auth_backend_cache/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -53,9 +53,14 @@ rabbitmq_app(
5353

5454
xref(tags = ["xref"])
5555

56+
plt(
57+
name = "base_plt",
58+
deps = DEPS,
59+
)
60+
5661
dialyze(
5762
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
58-
plt = "//:base_plt",
63+
plt = ":base_plt",
5964
tags = ["dialyze"],
6065
warnings_as_errors = False,
6166
)

deps/rabbitmq_auth_backend_http/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ plt(
5858
name = "base_plt",
5959
apps = EXTRA_APPS,
6060
plt = "//:base_plt",
61+
deps = DEPS,
6162
)
6263

6364
dialyze(

deps/rabbitmq_auth_backend_ldap/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ plt(
7373
name = "base_plt",
7474
apps = EXTRA_APPS,
7575
plt = "//:base_plt",
76+
deps = DEPS,
7677
)
7778

7879
dialyze(

deps/rabbitmq_auth_backend_oauth2/BUILD.bazel

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@rules_erlang//:erlc.bzl", "erlc")
22
load("@rules_erlang//:xref.bzl", "xref")
3-
load("@rules_erlang//:dialyze.bzl", "dialyze")
3+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
44
load(
55
"//:rabbitmq.bzl",
66
"RABBITMQ_DIALYZER_OPTS",
@@ -10,6 +10,7 @@ load(
1010
"rabbitmq_app",
1111
"rabbitmq_integration_suite",
1212
"rabbitmq_suite",
13+
"without",
1314
)
1415

1516
APP_NAME = "rabbitmq_auth_backend_oauth2"
@@ -42,9 +43,17 @@ rabbitmq_app(
4243

4344
xref(tags = ["xref"])
4445

46+
plt(
47+
name = "base_plt",
48+
deps = without(
49+
"//deps/rabbitmq_cli:rabbitmqctl",
50+
BUILD_DEPS + DEPS,
51+
),
52+
)
53+
4554
dialyze(
46-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
47-
plt = "//:base_plt",
55+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
56+
plt = ":base_plt",
4857
tags = ["dialyze"],
4958
warnings_as_errors = False,
5059
)

deps/rabbitmq_auth_mechanism_ssl/BUILD.bazel

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -40,9 +40,13 @@ rabbitmq_app(
4040

4141
xref(tags = ["xref"])
4242

43+
plt(
44+
name = "base_plt",
45+
deps = DEPS,
46+
)
47+
4348
dialyze(
4449
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
45-
plt = "//:base_plt",
50+
plt = ":base_plt",
4651
tags = ["dialyze"],
47-
warnings_as_errors = False,
4852
)

deps/rabbitmq_consistent_hash_exchange/BUILD.bazel

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -36,9 +36,14 @@ rabbitmq_app(
3636

3737
xref(tags = ["xref"])
3838

39+
plt(
40+
name = "base_plt",
41+
deps = DEPS,
42+
)
43+
3944
dialyze(
40-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
41-
plt = "//:base_plt",
45+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
46+
plt = ":base_plt",
4247
tags = ["dialyze"],
4348
warnings_as_errors = False,
4449
)

deps/rabbitmq_event_exchange/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -32,9 +32,14 @@ rabbitmq_app(
3232

3333
xref(tags = ["xref"])
3434

35+
plt(
36+
name = "base_plt",
37+
deps = DEPS,
38+
)
39+
3540
dialyze(
3641
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
37-
plt = "//:base_plt",
42+
plt = ":base_plt",
3843
tags = ["dialyze"],
3944
warnings_as_errors = False,
4045
)

deps/rabbitmq_federation/BUILD.bazel

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@rules_erlang//:erlc.bzl", "erlc")
22
load("@rules_erlang//:xref.bzl", "xref")
3-
load("@rules_erlang//:dialyze.bzl", "dialyze")
3+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
44
load(
55
"//:rabbitmq.bzl",
66
"RABBITMQ_DIALYZER_OPTS",
@@ -45,9 +45,14 @@ rabbitmq_app(
4545

4646
xref(tags = ["xref"])
4747

48+
plt(
49+
name = "base_plt",
50+
deps = DEPS,
51+
)
52+
4853
dialyze(
49-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
50-
plt = "//:base_plt",
54+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
55+
plt = ":base_plt",
5156
tags = ["dialyze"],
5257
warnings_as_errors = False,
5358
)

deps/rabbitmq_federation_management/BUILD.bazel

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -42,11 +42,15 @@ rabbitmq_app(
4242

4343
xref(tags = ["xref"])
4444

45+
plt(
46+
name = "base_plt",
47+
deps = BUILD_DEPS + DEPS,
48+
)
49+
4550
dialyze(
4651
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
47-
plt = "//:base_plt",
52+
plt = ":base_plt",
4853
tags = ["dialyze"],
49-
warnings_as_errors = False,
5054
)
5155

5256
broker_for_integration_suites()

deps/rabbitmq_jms_topic_exchange/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@rules_erlang//:xref.bzl", "xref")
2-
load("@rules_erlang//:dialyze.bzl", "dialyze")
2+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
33
load(
44
"//:rabbitmq.bzl",
55
"RABBITMQ_DIALYZER_OPTS",
@@ -39,9 +39,14 @@ rabbitmq_app(
3939

4040
xref(tags = ["xref"])
4141

42+
plt(
43+
name = "base_plt",
44+
deps = DEPS,
45+
)
46+
4247
dialyze(
4348
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
44-
plt = "//:base_plt",
49+
plt = ":base_plt",
4550
tags = ["dialyze"],
4651
warnings_as_errors = False,
4752
)

deps/rabbitmq_management/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@rules_erlang//:erlc.bzl", "erlc")
22
load("@rules_erlang//:xref.bzl", "xref")
3-
load("@rules_erlang//:dialyze.bzl", "dialyze")
3+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
44
load(
55
"//:rabbitmq.bzl",
66
"APP_VERSION",
@@ -84,9 +84,14 @@ rabbitmq_app(
8484

8585
xref(tags = ["xref"])
8686

87+
plt(
88+
name = "base_plt",
89+
deps = DEPS,
90+
)
91+
8792
dialyze(
8893
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
89-
plt = "//:base_plt",
94+
plt = ":base_plt",
9095
tags = ["dialyze"],
9196
warnings_as_errors = False,
9297
)

deps/rabbitmq_management_agent/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ plt(
6464
name = "base_plt",
6565
apps = plt_apps,
6666
plt = "//:base_plt",
67+
deps = DEPS,
6768
)
6869

6970
dialyze(
70-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
71+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
7172
plt = ":base_plt",
7273
tags = ["dialyze"],
7374
warnings_as_errors = False,

deps/rabbitmq_mqtt/BUILD.bazel

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@rules_erlang//:erlc.bzl", "erlc")
22
load("@rules_erlang//:xref.bzl", "xref")
3-
load("@rules_erlang//:dialyze.bzl", "dialyze")
3+
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
44
load(
55
"//:rabbitmq.bzl",
66
"RABBITMQ_DIALYZER_OPTS",
@@ -74,9 +74,14 @@ rabbitmq_app(
7474

7575
xref(tags = ["xref"])
7676

77+
plt(
78+
name = "base_plt",
79+
deps = DEPS,
80+
)
81+
7782
dialyze(
78-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
79-
plt = "//:base_plt",
83+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
84+
plt = ":base_plt",
8085
tags = ["dialyze"],
8186
warnings_as_errors = False,
8287
)

deps/rabbitmq_peer_discovery_aws/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ plt(
4747
name = "base_plt",
4848
apps = EXTRA_APPS,
4949
plt = "//:base_plt",
50+
deps = DEPS,
5051
)
5152

5253
dialyze(

deps/rabbitmq_peer_discovery_common/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ plt(
4949
name = "base_plt",
5050
apps = EXTRA_APPS,
5151
plt = "//:base_plt",
52+
deps = DEPS,
5253
)
5354

5455
dialyze(

0 commit comments

Comments
 (0)