Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed Jan 12, 2024
1 parent a07f9a3 commit 91dc1d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/credo/check/consistency/collector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ defmodule Credo.Check.Consistency.Collector do
) do
frequencies_per_source_file =
source_files
|> Task.async_stream(&{&1, collector.collect_matches(&1, params)}, timeout: :infinity, ordered: false)
|> Task.async_stream(&{&1, collector.collect_matches(&1, params)},
timeout: :infinity,
ordered: false
)
|> Enum.map(fn {:ok, frequencies} -> frequencies end)

frequencies = total_frequencies(frequencies_per_source_file)
Expand All @@ -167,7 +170,10 @@ defmodule Credo.Check.Consistency.Collector do
result =
frequencies_per_source_file
|> source_files_with_issues(most_frequent_match)
|> Task.async_stream(&issue_formatter.(most_frequent_match, &1, params), timeout: :infinity, ordered: false)
|> Task.async_stream(&issue_formatter.(most_frequent_match, &1, params),
timeout: :infinity,
ordered: false
)
|> Enum.flat_map(fn {:ok, issue} -> issue end)

result
Expand Down
5 changes: 4 additions & 1 deletion lib/credo/check/design/duplicated_code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ defmodule Credo.Check.Design.DuplicatedCode do
nodes =
source_files
|> Enum.chunk_every(30)
|> Task.async_stream(&calculate_hashes_for_chunk(&1, mass_threshold), timeout: :infinity, ordered: false)
|> Task.async_stream(&calculate_hashes_for_chunk(&1, mass_threshold),
timeout: :infinity,
ordered: false
)
|> Enum.reduce(%{}, fn {:ok, current_hashes}, existing_hashes ->
Map.merge(existing_hashes, current_hashes, fn _hash, node_items1, node_items2 ->
node_items1 ++ node_items2
Expand Down

0 comments on commit 91dc1d6

Please sign in to comment.