rust-doctor

CI/CD Integration

Add rust-doctor to GitHub Actions, GitLab CI, and other CI/CD pipelines.

GitHub Actions

Add the official action to your workflow:

name: Code Health
on: [push, pull_request]

jobs:
  rust-doctor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: ArthurDEV44/rust-doctor@v1
        with:
          fail-on: warning

The action posts a PR comment with the health score, error/warning counts, and top diagnostics.

Options

InputDescriptionDefault
fail-onExit with failure on this severity (error or warning)
diffScan only changed files vs base branchfalse
verboseInclude file:line detailsfalse

SARIF output

For GitHub Code Scanning integration:

- name: Run rust-doctor
  run: npx -y rust-doctor@latest --sarif . > results.sarif

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: results.sarif

Generic CI

Use the --score flag for simple pass/fail:

SCORE=$(npx -y rust-doctor@latest --score .)
if [ "$SCORE" -lt 50 ]; then
  echo "Health score too low: $SCORE/100"
  exit 1
fi

Or use --fail-on for severity-based gating:

npx -y rust-doctor@latest --fail-on error .

Diff mode in CI

Scan only changed files on a PR to speed up CI feedback:

npx -y rust-doctor@latest --diff main --fail-on warning .

On this page