Include
- π Business descripcion and diagrams
- π Especify what feedback are you waiting
- π Functions + Tests + Dialyzer + Credo
- π Code readability feedback will come from your teammates
Documentation
- Set a proper description in the
@moduledoc
. - Put the complete typespec for schemas.
Cosmetic and readability
- Private functions doesn't need
@spec
. - Use global values and default arguments if you need to put an specific value
@default_algorithm :sha256
Ecto
- Validate errors in changesets.
Git
- Squash your commits before merge.
Function naming
- π Organize funcions in order by alphabet.
- π Add
@doc
detached an important piece of logic. - π For functions to raise errors put ! in the function name.
- π Instead of use
maybe
useensure
.
Logic considerations
- π Repo operations should use with statement.
- π Instead of case, use pattern matching.
- π Resolve names in specs.
- π Always give a off-ramp to handle error values in functions.
Unit tests
- π Use present tense in test descriptions.
- π Unit test: Arrange, act and assert.
- π Don't assert before act in unit tests.