Skip to content

Commit 4a8d0c3

Browse files
HoloRinmergify-bot
authored andcommitted
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)
1 parent 3e10ad1 commit 4a8d0c3

File tree

41 files changed

+226
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+226
-74
lines changed

deps/amqp10_client/BUILD.bazel

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

5051
dialyze(
5152
plt = ":base_plt",
5253
tags = ["dialyze"],
53-
warnings_as_errors = False,
5454
)
5555

5656
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
@@ -51,6 +51,7 @@ plt(
5151
name = "base_plt",
5252
apps = EXTRA_APPS,
5353
plt = "//:base_plt",
54+
deps = DEPS,
5455
)
5556

5657
dialyze(

deps/rabbit/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ plt(
227227
name = "base_plt",
228228
apps = plt_apps,
229229
plt = "//:base_plt",
230+
deps = DEPS,
230231
)
231232

232233
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", "rabbitmq_suite")
44

55
APP_NAME = "rabbitmq_prelaunch"
@@ -34,8 +34,13 @@ xref(
3434
tags = ["xref"],
3535
)
3636

37+
plt(
38+
name = "base_plt",
39+
deps = DEPS,
40+
)
41+
3742
dialyze(
38-
plt = "//:base_plt",
43+
plt = ":base_plt",
3944
tags = ["dialyze"],
4045
warnings_as_errors = False,
4146
)

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",
@@ -48,10 +48,17 @@ xref(
4848
tags = ["xref"],
4949
)
5050

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

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",
@@ -48,9 +48,14 @@ rabbitmq_app(
4848

4949
xref(tags = ["xref"])
5050

51+
plt(
52+
name = "base_plt",
53+
deps = DEPS,
54+
)
55+
5156
dialyze(
5257
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
53-
plt = "//:base_plt",
58+
plt = ":base_plt",
5459
tags = ["dialyze"],
5560
warnings_as_errors = False,
5661
)

deps/rabbitmq_auth_backend_http/BUILD.bazel

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

5859
dialyze(

deps/rabbitmq_auth_backend_ldap/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ plt(
6868
name = "base_plt",
6969
apps = EXTRA_APPS,
7070
plt = "//:base_plt",
71+
deps = DEPS,
7172
)
7273

7374
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"
@@ -41,9 +42,17 @@ rabbitmq_app(
4142

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

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

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",
@@ -35,9 +35,13 @@ rabbitmq_app(
3535

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

38+
plt(
39+
name = "base_plt",
40+
deps = DEPS,
41+
)
42+
3843
dialyze(
3944
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
40-
plt = "//:base_plt",
45+
plt = ":base_plt",
4146
tags = ["dialyze"],
42-
warnings_as_errors = False,
4347
)

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",
@@ -35,9 +35,14 @@ rabbitmq_app(
3535

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

38+
plt(
39+
name = "base_plt",
40+
deps = DEPS,
41+
)
42+
3843
dialyze(
39-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
40-
plt = "//:base_plt",
44+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
45+
plt = ":base_plt",
4146
tags = ["dialyze"],
4247
warnings_as_errors = False,
4348
)

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",
@@ -27,9 +27,14 @@ rabbitmq_app(
2727

2828
xref(tags = ["xref"])
2929

30+
plt(
31+
name = "base_plt",
32+
deps = DEPS,
33+
)
34+
3035
dialyze(
3136
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
32-
plt = "//:base_plt",
37+
plt = ":base_plt",
3338
tags = ["dialyze"],
3439
warnings_as_errors = False,
3540
)

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",
@@ -44,9 +44,14 @@ rabbitmq_app(
4444

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

47+
plt(
48+
name = "base_plt",
49+
deps = DEPS,
50+
)
51+
4752
dialyze(
48-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
49-
plt = "//:base_plt",
53+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
54+
plt = ":base_plt",
5055
tags = ["dialyze"],
5156
warnings_as_errors = False,
5257
)

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",
@@ -41,11 +41,15 @@ rabbitmq_app(
4141

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

44+
plt(
45+
name = "base_plt",
46+
deps = BUILD_DEPS + DEPS,
47+
)
48+
4449
dialyze(
4550
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
46-
plt = "//:base_plt",
51+
plt = ":base_plt",
4752
tags = ["dialyze"],
48-
warnings_as_errors = False,
4953
)
5054

5155
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",
@@ -34,9 +34,14 @@ rabbitmq_app(
3434

3535
xref(tags = ["xref"])
3636

37+
plt(
38+
name = "base_plt",
39+
deps = DEPS,
40+
)
41+
3742
dialyze(
3843
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
39-
plt = "//:base_plt",
44+
plt = ":base_plt",
4045
tags = ["dialyze"],
4146
warnings_as_errors = False,
4247
)

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",
@@ -79,9 +79,14 @@ rabbitmq_app(
7979

8080
xref(tags = ["xref"])
8181

82+
plt(
83+
name = "base_plt",
84+
deps = DEPS,
85+
)
86+
8287
dialyze(
8388
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
84-
plt = "//:base_plt",
89+
plt = ":base_plt",
8590
tags = ["dialyze"],
8691
warnings_as_errors = False,
8792
)

deps/rabbitmq_management_agent/BUILD.bazel

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

6869
dialyze(
69-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
70+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
7071
plt = ":base_plt",
7172
tags = ["dialyze"],
7273
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",
@@ -73,9 +73,14 @@ rabbitmq_app(
7373

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

76+
plt(
77+
name = "base_plt",
78+
deps = DEPS,
79+
)
80+
7681
dialyze(
77-
dialyzer_opts = RABBITMQ_DIALYZER_OPTS,
78-
plt = "//:base_plt",
82+
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_behaviours"],
83+
plt = ":base_plt",
7984
tags = ["dialyze"],
8085
warnings_as_errors = False,
8186
)

deps/rabbitmq_peer_discovery_aws/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ plt(
4242
name = "base_plt",
4343
apps = EXTRA_APPS,
4444
plt = "//:base_plt",
45+
deps = DEPS,
4546
)
4647

4748
dialyze(

deps/rabbitmq_peer_discovery_common/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ plt(
4444
name = "base_plt",
4545
apps = EXTRA_APPS,
4646
plt = "//:base_plt",
47+
deps = DEPS,
4748
)
4849

4950
dialyze(

0 commit comments

Comments
 (0)