Skip to content
This repository was archived by the owner on Apr 21, 2021. It is now read-only.

Commit 7b5d5b4

Browse files
committed
Add mix format
1 parent 295d400 commit 7b5d5b4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/spawnfest/engine/frequency_engine.ex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,23 @@ defmodule FrequencyEngine do
4141
end
4242

4343
def get_means(frequency) do
44-
day_keys = [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday]
44+
day_keys = [:monday, :tuesday, :wednesday, :thursday, :friday, :saturday, :sunday]
45+
4546
day_hours =
4647
for day <- day_keys do
4748
day = Map.get(frequency, day)
48-
[_struct|values] = Map.values(day)
49+
[_struct | values] = Map.values(day)
4950
values
5051
end
51-
total_hours = day_hours |> List.flatten |> Enum.sum
52+
53+
total_hours = day_hours |> List.flatten() |> Enum.sum()
5254
hours_per_day = for day_hour <- day_hours, do: Enum.sum(day_hour)
5355
get_means_per_day(total_hours, hours_per_day)
5456
end
5557

5658
def get_means_per_day(total, hours_per_day) do
5759
for hours <- hours_per_day do
58-
mean = (hours*100)/total
60+
mean = hours * 100 / total
5961
Kernel.trunc(mean)
6062
end
6163
end

test/spawnfest/frequency_engine_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule FrequencyEngineTest do
1111
commits = get_commits()
1212
frequency = FrequencyEngine.get_frequency(commits)
1313
means = FrequencyEngine.get_means(frequency)
14-
assert means == [0, 0, 50, 25, 0, 0, 25]
14+
assert means == [0, 0, 50, 25, 0, 0, 25]
1515
end
1616

1717
defp get_commits do

0 commit comments

Comments
 (0)