Skip to content

Commit da2db9a

Browse files
xfumihirojosevalim
authored andcommitted
Run the code formatter on Mix.Tasks.Local.Rebar (#6665)
1 parent 756a7ab commit da2db9a

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

lib/mix/lib/mix/tasks/local.rebar.ex

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
defmodule Mix.Tasks.Local.Rebar do
22
use Mix.Task
33

4-
@rebar2_list_url "/installs/rebar-1.x.csv"
5-
@rebar2_escript_url "/installs/[ELIXIR_VERSION]/rebar-[REBAR_VERSION]"
6-
@rebar3_list_url "/installs/rebar3-1.x.csv"
7-
@rebar3_escript_url "/installs/[ELIXIR_VERSION]/rebar3-[REBAR_VERSION]"
4+
@rebar2_list_url "/installs/rebar-1.x.csv"
5+
@rebar2_escript_url "/installs/[ELIXIR_VERSION]/rebar-[REBAR_VERSION]"
6+
@rebar3_list_url "/installs/rebar3-1.x.csv"
7+
@rebar3_escript_url "/installs/[ELIXIR_VERSION]/rebar3-[REBAR_VERSION]"
88

9-
@shortdoc "Installs Rebar locally"
9+
@shortdoc "Installs Rebar locally"
1010

1111
@moduledoc """
1212
Fetches a copy of `rebar` or `rebar3` from the given path or URL.
@@ -47,15 +47,20 @@ defmodule Mix.Tasks.Local.Rebar do
4747

4848
case argv do
4949
["rebar", path | _] ->
50-
install_from_path(:rebar, path, opts)
50+
install_from_path(:rebar, path, opts)
51+
5152
["rebar3", path | _] ->
52-
install_from_path(:rebar3, path, opts)
53+
install_from_path(:rebar3, path, opts)
54+
5355
[] ->
5456
install_from_s3(:rebar, @rebar2_list_url, @rebar2_escript_url, opts)
5557
install_from_s3(:rebar3, @rebar3_list_url, @rebar3_escript_url, opts)
58+
5659
_ ->
57-
Mix.raise "Invalid arguments given to mix local.rebar. " <>
58-
"To find out the proper call syntax run \"mix help local.rebar\""
60+
Mix.raise(
61+
"Invalid arguments given to mix local.rebar. " <>
62+
"To find out the proper call syntax run \"mix help local.rebar\""
63+
)
5964
end
6065
end
6166

@@ -68,13 +73,16 @@ defmodule Mix.Tasks.Local.Rebar do
6873
File.mkdir_p!(Path.dirname(local))
6974
File.write!(local, binary)
7075
File.chmod!(local, 0o755)
71-
Mix.shell.info [:green, "* creating ", :reset, Path.relative_to_cwd(local)]
76+
Mix.shell().info([:green, "* creating ", :reset, Path.relative_to_cwd(local)])
77+
7278
:badpath ->
73-
Mix.raise "Expected #{inspect path} to be a URL or a local file path"
79+
Mix.raise("Expected #{inspect(path)} to be a URL or a local file path")
80+
7481
{:local, message} ->
75-
Mix.raise message
82+
Mix.raise(message)
83+
7684
{kind, message} when kind in [:remote, :checksum] ->
77-
Mix.raise """
85+
Mix.raise("""
7886
#{message}
7987
8088
Could not fetch #{manager} at:
@@ -84,15 +92,15 @@ defmodule Mix.Tasks.Local.Rebar do
8492
Please download the file above manually to your current directory and run:
8593
8694
mix local.rebar #{manager} ./#{Path.basename(local)}
87-
"""
95+
""")
8896
end
8997
end
9098

9199
true
92100
end
93101

94102
defp install_from_s3(manager, list_url, escript_url, opts) do
95-
hex_mirror = Mix.Hex.mirror
103+
hex_mirror = Mix.Hex.mirror()
96104
list_url = hex_mirror <> list_url
97105

98106
{elixir_version, rebar_version, sha512} =

0 commit comments

Comments
 (0)