When to use Credo plugins over credo custom checks

We use custom checks in one of our projects but would like to use them in other projects as well. What is the best way to package this for reusability? So far, we have tried having them as git submodules, but we also want to have tests for them. We also tried having them as a hex package, but referencing them under the required files did not work. We would also want to open-source this; what would be the best solution?

I have also come across Credo plugins but do not understand where to use them. Is this one of the scenarios to use them?

2 Likes

A hex package with custom checks is the way to go here in my opinion. Here’s a package you can use as an example: GitHub - mirego/credo_naming: 🏷 A suite of Credo checks to enforce naming best practices in an Elixir project

If you post more details about this then I’m sure it can get figured out.

5 Likes

Thank you for the examples. I was able to figure out how to properly use our hex package.

1 Like

I’m glad to hear you got it figured out! What was the issue? Maybe describing the issue and the fix may help someone in the future.

2 Likes