add .formatter.exs + format

This commit is contained in:
Martino Visintin
2018-05-22 21:46:54 +01:00
parent 08c90ce0d8
commit b07df7c780
52 changed files with 332 additions and 264 deletions

View File

@@ -2,7 +2,7 @@ defmodule Watcher do
use GenServer
def start_link() do
GenServer.start_link(__MODULE__, [dirs: ["lib/koans"]])
GenServer.start_link(__MODULE__, dirs: ["lib/koans"])
end
def init(args) do
@@ -11,10 +11,11 @@ defmodule Watcher do
{:ok, %{watcher_pid: watcher_pid}}
end
def handle_info({:file_event, watcher_pid, {path, events}}, %{watcher_pid: watcher_pid}=state) do
def handle_info({:file_event, watcher_pid, {path, events}}, %{watcher_pid: watcher_pid} = state) do
if Enum.member?(events, :modified) do
path |> normalize |> reload
end
{:noreply, state}
end
@@ -22,11 +23,11 @@ defmodule Watcher do
if Path.extname(file) == ".ex" do
try do
file
|> Code.load_file
|> Enum.map(&(elem(&1, 0)))
|> Code.load_file()
|> Enum.map(&elem(&1, 0))
|> Enum.find(&Runner.koan?/1)
|> Runner.modules_to_run
|> Runner.run
|> Runner.modules_to_run()
|> Runner.run()
rescue
e -> Display.show_compile_error(e)
end