Credo ignore existing errors

I noticed @hauleth s comment and I decided to figure out how to do it locally.

My workflow would be to run credo on my current changes not staged for committing. To only get reports on the current unstaged changes is done as follows.

mix credo --strict --format=flycheck | reviewdog -efm="%f:%l:%c: %t: %m" -efm="%f:%l: %t: %m" -name="credo" -diff="git diff"

The key here is to play around with the -diff command. That’s the output reviewdog will use to determine which violations (according to credo) are relevant to show you.

Say you want to get only new issues since you created your feature branch off of the develop branch, this will do too:

mix credo --strict --format=flycheck | reviewdog -efm="%f:%l:%c: %t: %m" -efm="%f:%l: %t: %m" -name="credo" -diff="git diff HEAD $(git merge-base HEAD develop) "