Skip to content

Commit

Permalink
Merge pull request #1057 from scohen/speed-up-stdio
Browse files Browse the repository at this point in the history
If reading from standard input, do not consult the filesystem
  • Loading branch information
rrrene authored Jul 25, 2023
2 parents 8dbe37b + 185160d commit f3ac864
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/credo/check/runner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ defmodule Credo.Check.Runner do
files_excluded = Params.files_excluded(params, check)

found_relevant_files =
if files_included == [] and files_excluded == [] do
[]
else
exec
|> Execution.working_dir()
|> Credo.Sources.find_in_dir(files_included, files_excluded)
cond do
files_included == [] and files_excluded == [] ->
[]

exec.read_from_stdin ->
[]

true ->
exec
|> Execution.working_dir()
|> Credo.Sources.find_in_dir(files_included, files_excluded)
end

source_files =
Expand Down

0 comments on commit f3ac864

Please sign in to comment.