mix precommit (GenServerVirtualTime v0.6.0)

Copy Markdown View Source

Runs all CI checks locally before committing.

This task runs the same checks that CI runs, helping you catch issues before pushing to GitHub.

Usage

mix precommit           # Run all checks except Dialyzer
mix precommit --all     # Run all checks including Dialyzer and coverage

Checks performed

  1. Code formatting (mix format)
  2. Markdown formatting (prettier for docs/)
  3. Format verification (mix format --check-formatted)
  4. Markdown format verification
  5. Compilation with warnings as errors
  6. Tests (mix test)
  7. Code quality (mix credo --strict)
  8. Documentation build (mix docs)
  9. Coverage report (mix coveralls.html) - only with --all flag
  10. Type checking (mix dialyzer) - only with --all flag

Coverage reporting

When run with --all, the task will display the total code coverage percentage and generate an HTML report in cover/excoveralls.html.

Exit codes

  • 0: All checks passed
  • 1: One or more checks failed