Acton
Linting

Outputs and CI

Use JSON, SARIF, GitHub annotations and GitLab Code Quality in automation

TODO: should just become a part of ci-setup.mdx, and the linting/overview.mdx plus linting/configuration would become a single howto page. Didn't make the change as to not perform content edits yet.

Console Output

Default mode prints diagnostics in terminal with source locations.

If autofixes are available and --fix is not used, Acton prints a reminder to rerun with --fix.

JSON Output

acton check --output-format json

This prints a JSON object to stdout with:

  • success
  • diagnostics (array)

Each diagnostic includes:

  • file as an absolute file path
  • severity, name, message, and optional code / help
  • annotations[] with 0-based range.start/end.{line,character}, is_primary, optional message, and optional tags
  • fixes[] with message, applicability (auto or manual), and structured edits[]

Use this mode for editor integrations and custom tooling.

To validate this output or generate client types from it, print the built-in JSON Schema:

acton meta get-schema lint-report

JSON output never applies file edits. Even if you pass --fix, fixes are only reported and must be applied separately.

SARIF Report

Write SARIF to a file:

acton check --output-format sarif --output-file .acton/reports/lint.sarif

Or configure format in Acton.toml:

[lint]
output-format = "sarif"

Then choose destination for that run:

acton check --output-file reports/ci.sarif

SARIF output never applies file edits. Even if you pass --fix, fixes are only reported and must be applied separately.

Acton's SARIF output includes:

  • SRCROOT-relative artifact locations when possible
  • primary location plus relatedLocations
  • per-rule metadata such as docs helpUri, lifecycle status, and fixability
  • structured SARIF fixes with Acton-specific applicability metadata

GitHub Annotations

acton check --output-format github

This format prints GitHub Actions workflow commands (::warning ..., ::error ...) so diagnostics appear as annotations in Actions logs and checks.

For GitHub Actions annotations, keep this output on stdout so the runner can parse workflow commands.

Like other non-plain formats, this mode never applies file edits.

This format is intentionally lossy: it emits one workflow command per diagnostic using only the primary location and one message string.

GitLab Code Quality

acton check --output-format gitlab --output-file gl-code-quality-report.json

This format writes GitLab Code Quality JSON report entries (Code Climate style), so merge requests can show inline findings and the Code Quality widget.

Like other non-plain formats, this mode never applies file edits.

Each GitLab issue includes:

  • a severity-mapped Code Climate entry
  • a stable fingerprint derived from rule, file, and primary span
  • flattened help, related-annotation text, and fix hints inside content.body

Exit Code Rules

acton check exits with non-zero code when:

  • At least one error is reported
  • Warning count is greater than max-warnings

max-warnings = 0 means "fail on any warning".

Example CI policy:

[lint]
max-warnings = 0

These exit rules are the same for all output formats (plain, json, sarif, github, gitlab).

Non-plain formats still flush their output before Acton returns a non-zero exit status, so CI systems can keep the machine-readable artifact and still fail the job.

--fix limits

Autofix is intentionally conservative.

  • Only plain terminal mode rewrites files.
  • Only fixes marked as automatically applicable are rewritten.
  • When one diagnostic advertises multiple fix variants, Acton applies only the first one.
  • After rewriting, exit status is computed from the remaining diagnostics and max-warnings, so acton check --fix can still fail.

Last updated on

On this page