Skip to content

Commit 751bfca

Browse files
committed
Trivial: Format
1 parent ae7a174 commit 751bfca

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/mix/tasks/e2e/update_examples_workflow.ex

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ defmodule Mix.Tasks.E2e.UpdateExamplesWorkflow do
7979
end
8080

8181
defp generate_job(%Entry{} = entry) do
82-
pre_indented_script_lines = entry.script |> String.trim_trailing |> dedent_string |> indent_string(10)
82+
pre_indented_script_lines =
83+
entry.script |> String.trim_trailing() |> dedent_string |> indent_string(10)
84+
8385
# ↑
8486
# No trailing empty lines because we tightly control how script-lines are placed within the template
8587
# ↑↑
@@ -119,12 +121,15 @@ defmodule Mix.Tasks.E2e.UpdateExamplesWorkflow do
119121
@spec dedent_string(String.t()) :: String.t()
120122
defp dedent_string(str) do
121123
lines = String.split(str, "\n")
124+
122125
smallest_indent =
123126
lines
124-
|> Enum.reject(&String.trim(&1) == "") # Ignore empty or whitespace-only lines
127+
# Ignore empty or whitespace-only lines
128+
|> Enum.reject(&(String.trim(&1) == ""))
125129
|> Enum.map(&String.length(Regex.replace(~r/^(\s*).*$/, &1, "\\1")))
126130
|> Enum.min()
127-
|> Kernel.||(0) # Default to 0 if the list is empty
131+
# Default to 0 if the list is empty
132+
|> Kernel.||(0)
128133

129134
lines
130135
|> Enum.map(fn line ->

0 commit comments

Comments
 (0)