Skip to content

Commit

Permalink
chore(formatting): format files
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoch-cars committed Aug 4, 2022
1 parent e2ee4b8 commit eb1381e
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/ex_factor/callers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ defmodule ExFactor.Callers do
defp mangle_list(list) do
Enum.map(list, fn string ->
[path, type] = String.split(string, " ")

%{
file: path,
dependency_type: type
Expand Down
8 changes: 7 additions & 1 deletion lib/ex_factor/changer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ defmodule ExFactor.Changer do

defp update_caller_groups([], opts) do
source_module = Keyword.fetch!(opts, :source_module)
[%ExFactor{state: [:unchanged], message: "No additional references to source module: (#{source_module}) detected"}]

[
%ExFactor{
state: [:unchanged],
message: "No additional references to source module: (#{source_module}) detected"
}
]
end

defp update_caller_module(callers, opts) do
Expand Down
5 changes: 4 additions & 1 deletion test/ex_factor/callers_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ defmodule ExFactor.CallersTest do
callers = Callers.callers(ExFactor.Parser)

assert Enum.find(callers, fn caller -> caller.file == "lib/ex_factor/callers.ex" end)
%{} = support = Enum.find(callers, fn caller -> caller.file == "test/support/support.ex" end)

%{} =
support = Enum.find(callers, fn caller -> caller.file == "test/support/support.ex" end)

assert support.caller_module == ExFactor.Support
assert support.callee == {ExFactor.Parser, :all_functions, 1}
end
Expand Down
5 changes: 4 additions & 1 deletion test/ex_factor/changer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ defmodule ExFactor.ChangerTest do
]

[change] = Changer.change(opts)
assert change.message == "No additional references to source module: (ExFactor.Tmp.SourceModMissing) detected"

assert change.message ==
"No additional references to source module: (ExFactor.Tmp.SourceModMissing) detected"

assert change.state == [:unchanged]
end

Expand Down
8 changes: 4 additions & 4 deletions test/ex_factor/extractor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ defmodule ExFactor.ExtractorTest do
assert changes.file_contents == ""
# file =
assert_raise File.Error,
"could not read file \"test/tmp/target_module.ex\": no such file or directory",
fn ->
File.read!("test/tmp/target_module.ex")
end
"could not read file \"test/tmp/target_module.ex\": no such file or directory",
fn ->
File.read!("test/tmp/target_module.ex")
end
end

test "create the dir path if necessary" do
Expand Down
2 changes: 1 addition & 1 deletion test/ex_factor/formatter_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule ExFactor.FormatterTest do
"""

File.write("test/tmp/test_module.ex", content)
Formatter.format(["test/tmp/test_module.ex"], [format: false])
Formatter.format(["test/tmp/test_module.ex"], format: false)
{:ok, formatted_file} = File.read("test/tmp/test_module.ex")
assert formatted_file =~ "# unindented line"
assert formatted_file =~ "\n # overindented line"
Expand Down

0 comments on commit eb1381e

Please sign in to comment.