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 everyaspect lintinvocation 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).
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
.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:
config.axl:
Lint targets
Before:.aspect/workflows/config.yaml:
config.axl:
..., 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, theGithubLintComments 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.
Authentication
GithubLintComments needs:
- An Aspect credential:
aspect-api-tokenon GitHub Actions, a Buildkite secret (secrets: [ASPECT_API_TOKEN]),ASPECT_API_TOKENin 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.
GitHub lint comments:. A missing credential logs one line per aspect lint invocation naming what’s missing, for example on GitLab or CircleCI:
Disabling
CI integration examples
Post comments
Runaspect lint on pull requests so GithubLintComments can post annotations as review comments.
Auto commit fixes
Runaspect 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.

