zkessin
Credo ignore existing errors
I want to add Credo to an existing project, and of course, when it runs it flags a lot of problems. What I want to know is there a built-in way to cause Credo to ignore the known issues, but report an error on new issues that may come up? That way the existing issues can be handled over time while we prevent any more issues from happening
Most Liked
m1dnight
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) "
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








