Skip to content

Commit

Permalink
Fix :files/:included param for checks
Browse files Browse the repository at this point in the history
This was a bug, where when no files where found for a set param
then all files would be used.
  • Loading branch information
rrrene committed Jan 30, 2024
1 parent cf88086 commit f1c7695
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/credo/check/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ defmodule Credo.Check.Runner do
exec
|> Execution.working_dir()
|> Credo.Sources.find_in_dir(files_included, files_excluded)
|> case do
[] -> :skip_run
files -> files
end
end

source_files =
Expand Down
4 changes: 2 additions & 2 deletions lib/credo/check/warning/wrong_test_file_extension.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Credo.Check.Warning.WrongTestFileExtension do
id: "EX5025",
base_priority: :high,
param_defaults: [
files: %{included: ["test/**/*_test.exs"]}
files: %{included: ["test/**/*_test.ex"]}
],
explanations: [
check: """
Expand All @@ -12,7 +12,7 @@ defmodule Credo.Check.Warning.WrongTestFileExtension do
(from the `ex_unit` docs)
This check ensures that test files are not ending with `.ex` (which would cause them to be skipped).
This check ensures that test files are not ending with `_test.ex` (which would cause them to be skipped).
"""
]

Expand Down

0 comments on commit f1c7695

Please sign in to comment.