ruff --output-format=github: Actions Annotations
ruff --output-format=github prints violations as GitHub Actions workflow commands so they appear as inline annotations on the pull request.
On GitHub Actions, the github output format turns each violation into an annotation pinned to the exact line, no extra action required.
What it does
With --output-format=github, ruff check emits each violation in the ::error file=...,line=...,col=...:: workflow-command syntax. GitHub renders these as inline annotations on the changed lines in the PR, in addition to the normal exit code.
Common usage
ruff check --output-format=github .
# or set it for the whole run via env
RUFF_OUTPUT_FORMAT=github ruff check .Flags
| Flag / env | What it does |
|---|---|
| --output-format github | Emit GitHub Actions annotation commands |
| --output-format full | Default human-readable output |
| --output-format concise | One line per violation |
| RUFF_OUTPUT_FORMAT | Environment variable equivalent |
In CI
Set --output-format=github only when running on GitHub Actions so violations annotate the diff. The exit code is unchanged, so the step still fails on violations; the format only changes how they are displayed.
Common errors in CI
Annotations not appearing usually means the format flag was omitted or the job is not on GitHub Actions, where the ::error:: syntax is interpreted. Using github format in a non-Actions log makes the output look like raw ::error lines. The format never suppresses the non-zero exit, so do not rely on it to make a failing lint pass.