One simple way is to run mix format --check-formatted as a check on the CI pipeline, so that it would fail if the code is not properly formatted. Here you can see an example with GitHub Action on my CubDB project. The action is run for every pull request as part of the build.
I often include the same check as a pre-push Git hook, so I get informed of format issues even before I push my code.
Note that this won’t fix the format issues, but rather just inform about them and cause the pipeline to fail. It is also possible to auto-fix the format and push a new commit, but I normally prefer not to, as it opens up possible issues with concurrent pipelines.






















