Code quality checks for AI code generation in Elixir apps

almirsarajcic

almirsarajcic

Created 19 days ago

Good code checks are more important than ever, especially as AI code generation tools increasingly rely on them to verify generated code.

By adding the following alias to your mix.exs, you can ensure your codebase is thoroughly checked by running mix ci:

defp aliases do
  [
    ci: [
      "deps.unlock --check-unused",
      "deps.audit",
      "hex.audit",
      "sobelow --config .sobelow-conf",
      "format --check-formatted",
      "cmd npx prettier -c .",
      "credo --strict",
      "dialyzer",
      "test --cover --warnings-as-errors"
    ],
  ]
end

More info: https://optimum.ba/blog/optimum-elixir-ci-with-github-actions#running-the-checks-locally.

If you don’t want to set this up manually, you can use our infrastructure generator.