Skip to content

Commit 9a85168

Browse files
committed
format scripts
1 parent b60eb9a commit 9a85168

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

.formatter.exs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[
22
inputs: [
33
"*.exs",
4-
"config/**/*.exs"
4+
"config/**/*.exs",
5+
"scripts/**/*.exs"
56
],
67
subdirectories: [
78
"apps/elixir_ls_utils",
89
"apps/elixir_ls_debugger",
9-
"apps/language_server",
10-
"scripts"
10+
"apps/language_server"
1111
]
1212
]

scripts/installer.exs

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ defmodule ElixirLS.Mix do
6565
# with added option to disable stopping apps after install
6666
# we don't want hex app stopped
6767
# The original code is licensed under
68-
68+
6969
# Apache License
7070
# Version 2.0, January 2004
7171
# http://www.apache.org/licenses/
@@ -243,7 +243,6 @@ defmodule ElixirLS.Mix do
243243

244244
# END OF TERMS AND CONDITIONS
245245

246-
247246
def install(deps, opts \\ [])
248247

249248
def install(deps, opts) when is_list(deps) and is_list(opts) do
@@ -476,7 +475,7 @@ defmodule ElixirLS.Installer do
476475
defp run_mix_install({:local, dir}, force?) do
477476
Mix.install(
478477
[
479-
{:elixir_ls, path: dir},
478+
{:elixir_ls, path: dir}
480479
],
481480
force: force?,
482481
start_applications: false,
@@ -488,7 +487,8 @@ defmodule ElixirLS.Installer do
488487
end
489488

490489
defp run_mix_install({:tag, tag}, force?) do
491-
Mix.install([
490+
Mix.install(
491+
[
492492
{:elixir_ls, github: "elixir-lsp/elixir-ls", tag: tag}
493493
],
494494
force: force?,
@@ -503,26 +503,29 @@ defmodule ElixirLS.Installer do
503503
end
504504

505505
defp get_release do
506-
version = Path.expand("#{__DIR__}/VERSION")
507-
|> File.read!()
508-
|> String.trim()
506+
version =
507+
Path.expand("#{__DIR__}/VERSION")
508+
|> File.read!()
509+
|> String.trim()
510+
509511
{:tag, "v#{version}"}
510512
end
511513

512514
def install(force?) do
513515
if local?() do
514516
dir = local_dir()
515517
IO.puts(:stderr, "Installing local ElixirLS from #{dir}")
516-
IO.puts(:stderr, "Running in #{File.cwd!}")
517-
518+
IO.puts(:stderr, "Running in #{File.cwd!()}")
519+
518520
run_mix_install({:local, dir}, force?)
519521
else
520522
{:tag, tag} = get_release()
521523
IO.puts(:stderr, "Installing ElixirLS release #{tag}")
522-
IO.puts(:stderr, "Running in #{File.cwd!}")
523-
524+
IO.puts(:stderr, "Running in #{File.cwd!()}")
525+
524526
run_mix_install({:tag, tag}, force?)
525527
end
528+
526529
IO.puts(:stderr, "Install complete")
527530
end
528531

@@ -540,7 +543,11 @@ defmodule ElixirLS.Installer do
540543
install(false)
541544
catch
542545
kind, error ->
543-
IO.puts(:stderr, "Mix.install failed with #{Exception.format(kind, error, __STACKTRACE__)}")
546+
IO.puts(
547+
:stderr,
548+
"Mix.install failed with #{Exception.format(kind, error, __STACKTRACE__)}"
549+
)
550+
544551
IO.puts(:stderr, "Retrying Mix.install with force: true")
545552
install(true)
546553
end

scripts/launch.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Application.put_env(:elixir, :ansi_enabled, false)
22
Code.eval_file("#{__DIR__}/installer.exs")
33

4-
Mix.start
4+
Mix.start()
55

66
# Put mix into quiet mode so it does not print anything to standard out
77
# especially it makes it surface git command errors such as reported in
@@ -16,6 +16,7 @@ ElixirLS.Installer.install_for_launch()
1616
case System.get_env("ELS_MODE") do
1717
"language_server" ->
1818
ElixirLS.LanguageServer.CLI.main()
19+
1920
"debugger" ->
2021
ElixirLS.Debugger.CLI.main()
2122
end

scripts/quiet_install.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Application.put_env(:elixir, :ansi_enabled, false)
22
Code.eval_file("#{__DIR__}/installer.exs")
33

4-
Mix.start
4+
Mix.start()
55

66
# Put mix into quiet mode so it does not print anything to standard out
77
# especially it makes it surface git command errors such as reported in

0 commit comments

Comments
 (0)