Enhance my precommit checks

I would add some more Credo checks. There are some custom ones here.

You should also look into the Boundary library for your projects.

I don’t see any Dialyzer here, either. I think that, if you’re spinning up a new PETAL stack application in this day and age, you should be rigorous about specs on everything and running Dialyzer. You should also think long and hard about your philosophy on specs. For my part, I define a custom type for every custom struct in my Elixir codebases and any function that takes/returns any custom struct must use the corresponding custom type in its spec. There are also important questions about how you handle specs for behaviours/callbacks, e.g. whether callbacks should have specs or just implementations or both and if so, how those should relate.

Look into PropEr or StreamData for property-based testing if you haven’t already. And make sure your agent contract enforces TDD discipline, i.e. failing tests first and property tests over normal ones.

2 Likes