Skip to content

Commit b75cacf

Browse files
committed
Credo
1 parent 164417e commit b75cacf

5 files changed

Lines changed: 17 additions & 18 deletions

File tree

.credo.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
{Credo.Check.Readability.VariableNames, []},
5050
{Credo.Check.Readability.WithSingleClause, []},
5151
{Credo.Check.Refactor.ABCSize, false},
52-
{Credo.Check.Refactor.AppendSingleItem, []},
52+
{Credo.Check.Refactor.AppendSingleItem, false},
5353
{Credo.Check.Refactor.DoubleBooleanNegation, []},
5454
{Credo.Check.Refactor.FilterReject, []},
55+
{Credo.Check.Refactor.FunctionArity, false},
5556
{Credo.Check.Refactor.IoPuts, []},
5657
{Credo.Check.Refactor.MapJoin, []},
5758
{Credo.Check.Refactor.NegatedConditionsInUnless, []},
@@ -60,7 +61,7 @@
6061
{Credo.Check.Refactor.RedundantWithClauseResult, []},
6162
{Credo.Check.Refactor.RejectFilter, []},
6263
{Credo.Check.Refactor.UnlessWithElse, []},
63-
{Credo.Check.Refactor.VariableRebinding, []},
64+
{Credo.Check.Refactor.VariableRebinding, false},
6465
{Credo.Check.Refactor.WithClauses, []},
6566
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, []},
6667
{Credo.Check.Warning.BoolOperationOnSameValues, []},

lib/2015/day_06.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ defmodule AdventOfCode.Y2015.Day06 do
55
Difficulty: m
66
Tags: grid vector reduction slow
77
"""
8-
alias Aja.Vector
98
alias AdventOfCode.Helpers.{InputReader, Transformers}
9+
alias Aja.Vector
1010

1111
def input, do: InputReader.read_from_file(2015, 6)
1212

lib/2018/day_07.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ defmodule AdventOfCode.Y2018.Day07 do
3232
end)
3333

3434
ids
35-
|> Enum.map(&Yog.Model.node(graph, &1))
36-
|> Enum.join("")
35+
|> Enum.map_join("", fn id -> Yog.Model.node(graph, id) end)
3736
end
3837

3938
defp run_2(graph) do

lib/2022/day_24.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ defmodule AdventOfCode.Y2022.Day24 do
3232
{t1, t3}
3333
end
3434

35+
# credo:disable-next-line Credo.Check.Refactor.FunctionArity
3536
defp solve_path({sx, sy}, {gx, gy}, start_t, up, down, left, right, w, h, cycle) do
3637
inner_w = w - 2
3738
inner_h = h - 2

lib/2023/day_22.ex

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,15 @@ defmodule AdventOfCode.Y2023.Day22 do
7373
Range.disjoint?(ay, by))
7474
end)
7575

76-
supports =
77-
Map.update(
78-
supports,
79-
current,
80-
%{is_above: others, is_below: []},
81-
fn %{is_above: above} = existing ->
82-
%{existing | is_above: others ++ above}
83-
end
84-
)
85-
86-
supports =
76+
supports
77+
|> Map.update(
78+
current,
79+
%{is_above: others, is_below: []},
80+
fn %{is_above: above} = existing ->
81+
%{existing | is_above: others ++ above}
82+
end
83+
)
84+
|> then(fn supports ->
8785
Enum.reduce(others, supports, fn other, supports ->
8886
Map.update(
8987
supports,
@@ -94,8 +92,8 @@ defmodule AdventOfCode.Y2023.Day22 do
9492
end
9593
)
9694
end)
97-
98-
support(rest, bricks, supports)
95+
end)
96+
|> then(fn supports -> support(rest, bricks, supports) end)
9997
end
10098

10199
defp free(supports) do

0 commit comments

Comments
 (0)