rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.93k stars 417 forks source link

Checking multiple files (not all the project) does not work #1016

Closed pierrelegall closed 10 months ago

pierrelegall commented 1 year ago

Environment

What was I trying to do?

I am trying to check multiple files with Credo, not all my project.

When I use mix credo file.ex, it works as expected. However, this is not the case when you check multiple file (e.g. mix credo file1.ex file2.ex).

In my case, this is useful to speed up my pre-commit Git hook as below:

#!/bin/sh

set -e

STAGED_FILES=$(git diff --name-only --cached)

mix credo $STAGED_FILES

Bug or feature? That is the question.

Expected outcome

Every listed files should be checked by Credo.

Actual outcome

Only the first file is checked by Credo.

rrrene commented 10 months ago

This is now possible. Please re-open if you run into any issues 👍