Skip to content

Commit 5a298bc

Browse files
mix format on Elixir 1.15
1 parent 52b74fc commit 5a298bc

27 files changed

+64
-63
lines changed

deps/rabbitmq_cli/lib/rabbitmq/cli/core/code_path.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ defmodule RabbitMQ.CLI.Core.CodePath do
6161

6262
case :erl_prim_loader.list_dir(app_dir) do
6363
{:ok, list} ->
64-
case Enum.member?(list, 'ebin') do
64+
case Enum.member?(list, ~c"ebin") do
6565
true ->
66-
ebin_dir = :filename.join(app_dir, 'ebin')
66+
ebin_dir = :filename.join(app_dir, ~c"ebin")
6767
Code.append_path(ebin_dir)
6868

6969
false ->

deps/rabbitmq_cli/lib/rabbitmq/cli/core/config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule RabbitMQ.CLI.Core.Config do
4444

4545
def normalise(:longnames, true), do: :longnames
4646
def normalise(:longnames, "true"), do: :longnames
47-
def normalise(:longnames, 'true'), do: :longnames
47+
def normalise(:longnames, ~c"true"), do: :longnames
4848
def normalise(:longnames, "\"true\""), do: :longnames
4949
def normalise(:longnames, _val), do: :shortnames
5050
def normalise(_, value), do: value

deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/shutdown_command.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.ShutdownCommand do
8484
#
8585

8686
def addressing_local_node?(_, remote_hostname) when remote_hostname == :localhost, do: true
87-
def addressing_local_node?(_, remote_hostname) when remote_hostname == 'localhost', do: true
87+
def addressing_local_node?(_, remote_hostname) when remote_hostname == ~c"localhost", do: true
8888
def addressing_local_node?(_, remote_hostname) when remote_hostname == "localhost", do: true
8989

9090
def addressing_local_node?(local_hostname, remote_hostname) do

deps/rabbitmq_cli/lib/rabbitmq/cli/ctl/commands/wait_command.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ defmodule RabbitMQ.CLI.Ctl.Commands.WaitCommand do
155155
end
156156

157157
defp wait_for_pid_funs(node_name, app_names, timeout, quiet) do
158-
app_names_formatted = :io_lib.format('~p', [app_names])
158+
app_names_formatted = :io_lib.format(~c"~p", [app_names])
159159

160160
[
161161
log_param(

deps/rabbitmq_cli/lib/rabbitmq/cli/diagnostics/commands/remote_shell_command.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ defmodule RabbitMQ.CLI.Diagnostics.Commands.RemoteShellCommand do
2020
else
2121
_ = Supervisor.terminate_child(:kernel_sup, :user)
2222
Process.flag(:trap_exit, true)
23-
user_drv = :user_drv.start(['tty_sl -c -e', {node_name, :shell, :start, []}])
23+
user_drv = :user_drv.start([~c"tty_sl -c -e", {node_name, :shell, :start, []}])
2424
Process.link(user_drv)
2525

2626
receive do
27-
{'EXIT', _user_drv, _} ->
27+
{~c"EXIT", _user_drv, _} ->
2828
{:ok, "Disconnected from #{node_name}."}
2929
end
3030
end

deps/rabbitmq_cli/lib/rabbitmqctl.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ defmodule RabbitMQCtl do
617617
## {:fun, fun} - run a custom function to enable distribution.
618618
## custom mode is usefult for commands which should have specific node name.
619619
## Runs code if distribution is successful, or not needed.
620-
@spec maybe_with_distribution(module(), options(), (() -> command_result())) :: command_result()
620+
@spec maybe_with_distribution(module(), options(), (-> command_result())) :: command_result()
621621
defp maybe_with_distribution(command, options, code) do
622622
try do
623623
maybe_with_distribution_without_catch(command, options, code)

deps/rabbitmq_cli/test/core/default_output_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ defmodule DefaultOutputTest do
2121
end
2222

2323
test "enumerable is passed as stream" do
24-
assert match?({:stream, 'list'}, ExampleCommand.output({:ok, 'list'}, %{}))
25-
assert match?({:stream, 'list'}, ExampleCommand.output('list', %{}))
24+
assert match?({:stream, ~c"list"}, ExampleCommand.output({:ok, ~c"list"}, %{}))
25+
assert match?({:stream, ~c"list"}, ExampleCommand.output(~c"list", %{}))
2626

2727
assert match?({:stream, [1, 2, 3]}, ExampleCommand.output({:ok, [1, 2, 3]}, %{}))
2828
assert match?({:stream, [1, 2, 3]}, ExampleCommand.output([1, 2, 3], %{}))
@@ -53,13 +53,13 @@ defmodule DefaultOutputTest do
5353
test "error_string is converted to string" do
5454
assert match?(
5555
{:error, "I am charlist"},
56-
ExampleCommand.output({:error_string, 'I am charlist'}, %{})
56+
ExampleCommand.output({:error_string, ~c"I am charlist"}, %{})
5757
)
5858
end
5959

6060
test "error is formatted" do
6161
{:error, "I am formatted \"string\""} =
62-
ExampleCommand.output({:error, 'I am formatted ~p', ['string']}, %{})
62+
ExampleCommand.output({:error, ~c"I am formatted ~p", [~c"string"]}, %{})
6363
end
6464

6565
test "non atom value is ok" do

deps/rabbitmq_cli/test/core/helpers_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ defmodule HelpersTest do
122122
rabbitmq_home = :rabbit_misc.rpc_call(node(), :code, :lib_dir, [:rabbit])
123123
opts = %{plugins_dir: to_string(plugins_directory_03), rabbitmq_home: rabbitmq_home}
124124

125-
desc = 'A mock RabbitMQ plugin to be used in tests'
126-
vsn = '0.1.0'
125+
desc = ~c"A mock RabbitMQ plugin to be used in tests"
126+
vsn = ~c"0.1.0"
127127

128128
assert Enum.member?(Application.loaded_applications(), {:mock_rabbitmq_plugins_03, desc, vsn}) ==
129129
false
@@ -138,8 +138,8 @@ defmodule HelpersTest do
138138
rabbitmq_home = :rabbit_misc.rpc_call(node(), :code, :lib_dir, [:rabbit])
139139
opts = %{plugins_dir: to_string(plugins_directory_04), rabbitmq_home: rabbitmq_home}
140140

141-
desc = 'A mock RabbitMQ plugin to be used in tests'
142-
vsn = 'rolling'
141+
desc = ~c"A mock RabbitMQ plugin to be used in tests"
142+
vsn = ~c"rolling"
143143

144144
assert Enum.member?(Application.loaded_applications(), {:mock_rabbitmq_plugins_04, desc, vsn}) ==
145145
false

deps/rabbitmq_cli/test/core/table_formatter_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defmodule TableFormatterTest do
1717
"apple\tbeer\t1"
1818
]
1919

20-
assert @formatter.format_output(%{a: "apple", b: 'beer', c: 1}, %{}) == [
20+
assert @formatter.format_output(%{a: "apple", b: ~c"beer", c: 1}, %{}) == [
2121
"a\tb\tc",
2222
"apple\t\"beer\"\t1"
2323
]
@@ -31,15 +31,15 @@ defmodule TableFormatterTest do
3131
"apple\tbeer\t1"
3232
]
3333

34-
assert @formatter.format_output([a: "apple", b: 'beer', c: 1], %{}) == [
34+
assert @formatter.format_output([a: "apple", b: ~c"beer", c: 1], %{}) == [
3535
"a\tb\tc",
3636
"apple\t\"beer\"\t1"
3737
]
3838
end
3939

4040
test "format_stream tab-separates map values" do
4141
assert @formatter.format_stream(
42-
[%{a: :apple, b: :beer, c: 1}, %{a: "aadvark", b: 'bee', c: 2}],
42+
[%{a: :apple, b: :beer, c: 1}, %{a: "aadvark", b: ~c"bee", c: 2}],
4343
%{}
4444
)
4545
|> Enum.to_list() ==
@@ -48,7 +48,7 @@ defmodule TableFormatterTest do
4848

4949
test "format_stream tab-separates keyword values" do
5050
assert @formatter.format_stream(
51-
[[a: :apple, b: :beer, c: 1], [a: "aadvark", b: 'bee', c: 2]],
51+
[[a: :apple, b: :beer, c: 1], [a: "aadvark", b: ~c"bee", c: 2]],
5252
%{}
5353
)
5454
|> Enum.to_list() ==

deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule ClearGlobalParameterCommandTest do
4444
assert @command.run(
4545
[context[:key]],
4646
context[:opts]
47-
) == {:error_string, 'Parameter does not exist'}
47+
) == {:error_string, ~c"Parameter does not exist"}
4848
end
4949

5050
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do

0 commit comments

Comments
 (0)