But you can use -n of xargs to run mix credo sequentially for each file.
Still, you really shouldn’t do that. To get the most benefit from credo, you should always let it scan the full project, or it won’t find some of the consistency stuff.
Interesting, my intent with only running it on the staged files is because I know the rest of my code might still be WIP, and might fail the linter check.
I also plan on running credo on my CI, which would run it on every file. With your statement in mind, am I correct in guessing that credo may fail on CI (running on every file) even if it passed in my pre-commit hook (running on a subset of files)?
For what it’s worth, my POV is that pre-commit hooks must be fast and may not need to be 100% correct, as long as the CI catches any leftover error later on. If they catch 90% of the basic errors, I’m happy.
I’m pretty sure this was added by popular request later on and that the consistency issue still stands, an official confirmation would be welcomed!