Skip to content

Commit 209f23f

Browse files
authored
Revert "Format MQTT code with erlfmt"
1 parent 6806a9a commit 209f23f

Some content is hidden

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

47 files changed

+3500
-5385
lines changed

.git-blame-ignore-revs

-1
This file was deleted.

deps/rabbitmq_mqtt/src/Elixir.RabbitMQ.CLI.Ctl.Commands.DecommissionMqttNodeCommand.erl

+17-28
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@
1010

1111
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
1212

13-
-export([
14-
scopes/0,
15-
switches/0,
16-
aliases/0,
17-
usage/0,
18-
usage_doc_guides/0,
19-
banner/2,
20-
validate/2,
21-
merge_defaults/2,
22-
run/2,
23-
output/2,
24-
description/0,
25-
help_section/0
26-
]).
13+
-export([scopes/0,
14+
switches/0,
15+
aliases/0,
16+
usage/0,
17+
usage_doc_guides/0,
18+
banner/2,
19+
validate/2,
20+
merge_defaults/2,
21+
run/2,
22+
output/2,
23+
description/0,
24+
help_section/0]).
2725

2826
scopes() -> [ctl].
2927
switches() -> [].
@@ -50,29 +48,20 @@ usage() ->
5048
usage_doc_guides() ->
5149
[?MQTT_GUIDE_URL].
5250

53-
run([Node], #{
54-
node := NodeName,
55-
timeout := Timeout
56-
}) ->
51+
run([Node], #{node := NodeName,
52+
timeout := Timeout}) ->
5753
case rabbit_misc:rpc_call(NodeName, rabbit_mqtt_collector, leave, [Node], Timeout) of
5854
{badrpc, _} = Error ->
5955
Error;
6056
nodedown ->
61-
{ok,
62-
list_to_binary(
63-
io_lib:format(
64-
"Node ~ts is down but has been successfully removed"
65-
" from the cluster",
66-
[Node]
67-
)
68-
)};
57+
{ok, list_to_binary(io_lib:format("Node ~ts is down but has been successfully removed"
58+
" from the cluster", [Node]))};
6959
Result ->
7060
%% 'ok' or 'timeout'
7161
Result
7262
end.
7363

74-
banner([Node], _) ->
75-
list_to_binary(io_lib:format("Removing node ~ts from the list of MQTT nodes...", [Node])).
64+
banner([Node], _) -> list_to_binary(io_lib:format("Removing node ~ts from the list of MQTT nodes...", [Node])).
7665

7766
output(Result, _Opts) ->
7867
'Elixir.RabbitMQ.CLI.DefaultOutput':output(Result).

deps/rabbitmq_mqtt/src/Elixir.RabbitMQ.CLI.Ctl.Commands.ListMqttConnectionsCommand.erl

+26-36
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@
1010

1111
-behaviour('Elixir.RabbitMQ.CLI.CommandBehaviour').
1212

13-
-export([
14-
formatter/0,
15-
scopes/0,
16-
switches/0,
17-
aliases/0,
18-
usage/0,
19-
usage_additional/0,
20-
usage_doc_guides/0,
21-
banner/2,
22-
validate/2,
23-
merge_defaults/2,
24-
run/2,
25-
output/2,
26-
description/0,
27-
help_section/0
28-
]).
13+
-export([formatter/0,
14+
scopes/0,
15+
switches/0,
16+
aliases/0,
17+
usage/0,
18+
usage_additional/0,
19+
usage_doc_guides/0,
20+
banner/2,
21+
validate/2,
22+
merge_defaults/2,
23+
run/2,
24+
output/2,
25+
description/0,
26+
help_section/0]).
2927

3028
formatter() -> 'Elixir.RabbitMQ.CLI.Formatters.Table'.
3129
scopes() -> [ctl, diagnostics].
@@ -39,14 +37,10 @@ help_section() ->
3937

4038
validate(Args, _) ->
4139
InfoItems = lists:map(fun atom_to_list/1, ?INFO_ITEMS),
42-
case
43-
'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':validate_info_keys(
44-
Args,
45-
InfoItems
46-
)
47-
of
40+
case 'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':validate_info_keys(Args,
41+
InfoItems) of
4842
{ok, _} -> ok;
49-
Error -> Error
43+
Error -> Error
5044
end.
5145

5246
merge_defaults([], Opts) ->
@@ -61,22 +55,19 @@ usage_additional() ->
6155
Prefix = <<" must be one of ">>,
6256
InfoItems = 'Elixir.Enum':join(lists:usort(?INFO_ITEMS), <<", ">>),
6357
[
64-
{<<"<column>">>, <<Prefix/binary, InfoItems/binary>>}
58+
{<<"<column>">>, <<Prefix/binary, InfoItems/binary>>}
6559
].
6660

6761
usage_doc_guides() ->
6862
[?MQTT_GUIDE_URL].
6963

70-
run(Args, #{
71-
node := NodeName,
72-
timeout := Timeout,
73-
verbose := Verbose
74-
}) ->
75-
InfoKeys =
76-
case Verbose of
77-
true -> ?INFO_ITEMS;
78-
false -> 'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':prepare_info_keys(Args)
79-
end,
64+
run(Args, #{node := NodeName,
65+
timeout := Timeout,
66+
verbose := Verbose}) ->
67+
InfoKeys = case Verbose of
68+
true -> ?INFO_ITEMS;
69+
false -> 'Elixir.RabbitMQ.CLI.Ctl.InfoKeys':prepare_info_keys(Args)
70+
end,
8071

8172
Nodes = 'Elixir.RabbitMQ.CLI.Core.Helpers':nodes_in_cluster(NodeName),
8273

@@ -87,8 +78,7 @@ run(Args, #{
8778
[Nodes, InfoKeys],
8879
Timeout,
8980
InfoKeys,
90-
length(Nodes)
91-
).
81+
length(Nodes)).
9282

9383
banner(_, _) -> <<"Listing MQTT connections ...">>.
9484

0 commit comments

Comments
 (0)