Skip to content

Commit

Permalink
fix credo complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegillet committed Jun 14, 2024
1 parent 926b9e5 commit c755360
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ config :logger, :console,
:analysis_module,
:code_file_path,
:error_message,
:file_name
:file_name,
:exemploid_files,
:submitted_files,
:data,
:exercise_type
]

# It is also possible to import configuration files, relative to this
Expand Down
8 changes: 1 addition & 7 deletions lib/elixir_analyzer/exercise_test/feature/compiler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@ defmodule ElixirAnalyzer.ExerciseTest.Feature.Compiler do
found =
params
|> Enum.chunk_every(unquote(block_params), 1, :discard)
|> Enum.reduce(false, fn
chunk, false ->
Compiler.form_match?(unquote(find_ast), chunk)

_chunk, true ->
true
end)
|> Enum.any?(&Compiler.form_match?(unquote(find_ast), &1))

{node, found}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ defmodule ElixirAnalyzer.ExerciseTest.AssertCall.KernelTest do
[
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
Kernel.dbg()
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
dbg()
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
&Kernel.dbg/0
end
end,
defmodule AssertCallVerification do
def function() do
# credo:disable-for-next-line Credo.Check.Warning.Dbg
&dbg/0
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# credo:disable-for-this-file Credo.Check.Readability.PredicateFunctionNames
defmodule ElixirAnalyzer.ExerciseTest.CommonChecks.BooleanFunctionsTest do
use ExUnit.Case
alias ElixirAnalyzer.Comment
Expand Down
2 changes: 2 additions & 0 deletions test/elixir_analyzer/exercise_test/common_checks_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# credo:disable-for-this-file Credo.Check.Readability.VariableNames
# credo:disable-for-this-file Credo.Check.Readability.ModuleNames
# credo:disable-for-this-file Credo.Check.Warning.IoInspect
# credo:disable-for-this-file Credo.Check.Readability.PredicateFunctionNames

defmodule ElixirAnalyzer.ExerciseTestTest.Empty do
use ElixirAnalyzer.ExerciseTest
Expand Down Expand Up @@ -273,6 +274,7 @@ defmodule ElixirAnalyzer.ExerciseTest.CommonChecksTest do
defmodule MyModule do
def foo() do
(1 + 1)
# credo:disable-for-next-line Credo.Check.Warning.Dbg
|> dbg()
end
end,
Expand Down

0 comments on commit c755360

Please sign in to comment.