Skip to main content
Rosetta’s lint task (Workflows 5.x) ran bazel lint with environment-specific flags injected automatically, parsed a proprietary JSON diagnostics file, and posted GitHub annotations directly from the task runner. aspect lint replaces it. aspect lint runs a standard Bazel build with rules_lint aspects enabled, reads SARIF output, and exposes lifecycle hooks for custom reporting.
GitHub PR annotations are no longer baked into the task. They’re posted by the GithubLintComments feature, which authenticates via the Aspect Workflows GitHub App and is enabled by default on GitHub Actions.

What changed

Configuration

Most settings below can be applied either way:
  • CLI flag: pass the flag at invocation time (e.g. aspect lint --strategy=hard //...). Good for overrides on individual task invocations, or experimenting with a setting before committing it.
  • .aspect/config.axl: declare it once in your repo’s AXL config so every aspect lint invocation picks it up. Good for settings that should apply to all invocations of a task type. AXL can also compute values (e.g. branching on CI host or environment).
Pick whichever fits; you only need one. Where both work, the sections below show them side-by-side under After.

Lint aspects (--aspect)

In the legacy Aspect CLI, the bazel lint command picked up its rules_lint aspects from the lint.aspects list in .aspect/cli/config.yaml:
aspect lint makes the aspect list explicit at the task site. At least one rules_lint aspect must reach Bazel — via --aspect=<label>, .aspect/config.axl, Bazel’s own --aspects=, or a bazelrc --config — but --aspect itself is optional, and the CI examples below leave it out because they declare their aspects in config.axl. Repeat the flag to run multiple aspects in a single invocation; each --aspect=<label> becomes a Bazel --aspects=<label> on the underlying build. Recommended: declare aspects in .aspect/config.axl so the same aspect lint invocation runs the same aspects locally as in CI, and your CI step doesn’t enumerate them:
.aspect/config.axl
The CLI flag is also fine for one-off invocations, parallel CI jobs that need different aspect sets, or experimenting with a new linter before committing it:
CLI flags override .aspect/config.axl defaults, so a job that wants only the fast linters can pass --aspect=//tools/lint:linters.bzl%shellcheck and skip the rest. linters.bzl defines the aspects via rules_lint helpers (e.g. lint_shellcheck_aspect, lint_eslint_aspect). See the rules_lint setup docs for the canonical pattern, or the aspect-cli lint example for a minimal working setup.

Failure strategy

Before: .aspect/workflows/config.yaml:
After: CLI flag or config.axl:
Strategy reference:

Lint targets

Before: .aspect/workflows/config.yaml:
After: positional CLI args or config.axl:
The default (no arguments) is ..., which expands to all rule targets in the package at and beneath your current directory. To lint the entire workspace explicitly, run aspect lint //... from the repo root (equivalent to the legacy targets: ['//...']).

GitHub PR review comments

On a GitHub pull request build, the GithubLintComments feature posts lint findings to the PR as inline review comments. It is enabled by default, so no extra configuration is needed beyond authenticating the runner (see Authentication below). What it does:
  • Posts inline review comments on the lines of the PR diff that the linter flagged.
  • Includes fix suggestions as GitHub suggestion blocks where the linter provides them, so reviewers can apply the fix with one click.
  • Deduplicates comments across re-runs of the lint task on the same PR, and cleans up stale ones once a violation is fixed.
GithubLintComments computes per-line changed regions the same way as the lint verdict (see the Diff base row of What changed). Override with —merge-base=<sha> to skip the merge-base resolution.

Authentication

GithubLintComments needs:
  • An Aspect credential: aspect-api-token on GitHub Actions, a Buildkite secret (secrets: [ASPECT_API_TOKEN]), ASPECT_API_TOKEN in the environment on GitLab and CircleCI.
  • The Aspect Workflows GitHub App installed on the GitHub org/repository and linked to your Aspect account, so the CLI can use the App to post the review comments.
See the GitHub App page for installing and linking the app, and Authenticating the Aspect CLI for generating the API token. If no comments appear on a pull request build, search the log for GitHub lint comments:. A missing credential logs one line per aspect lint invocation naming what’s missing, for example on GitLab or CircleCI:
Outside a pull request build (push events, local development) the feature has nothing to post to.

Disabling

CI integration examples

Post comments

Run aspect lint on pull requests so GithubLintComments can post annotations as review comments.

Auto commit fixes

Run aspect lint --fix on feature branches and push the resulting diff back so developers don’t have to re-run locally. Each platform needs a push credential with write access to the branch.