Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

The lint task of Aspect Workflows automates the execution of static code analysis tools like linters on the Bazel workspace, leveraging the rules_lint infrastructure. The goal is to ensure code quality and compliance with defined standards, integrating the results directly into the CI/CD pipeline and code review platforms like GitHub.

Key features

The lint task provides granular control over which code targets you check and how the CI pipeline reacts to detected errors.

Scope and customization

  • Minimal Configuration: You can enable the task in its most basic form to run linters on all Bazel targets.
  • Target Definition: You can specify patterns of targets to include or exclude from the analysis. Exclusions use a hyphen prefix before the pattern.

Failure strategies (failure_strategy)

To balance code quality with developer productivity, the task offers three modes of control over how lint errors affect the build status:
ModeBuild BehaviorRecommended Use
hardFails the build for any lint error with a non-zero exit code from the linter.Strict quality enforcement, blocking merge.
softReports lint errors during the build but ignores the linters’ exit codes.Allows the build and merge to complete with warnings.
hold_the_lineReports errors during the build and fails only on Pull Requests if the lint issues are in files modified by the PR.Recommended for introducing linting in existing codebases—doesn’t fail branch builds.

GitHub integration

The task integrates with the Marvin bot to provide direct feedback on Pull Requests:
  • Annotations and Suggestions: Marvin annotates Pull Requests with lint results and can provide correction suggestions. You can turn off both features.
  • Annotation Filter: By default, the system displays annotations only for files and regions explicitly modified in the PR. It’s possible to configure it to show all annotations, respecting GitHub’s limit.
  • Command-line tool Commands: You can turn off the display of Aspect command-line tool replay/fix commands in the GitHub App.

Linter support

Aspect Workflows is compatible with linters you configure in rules_lint.
  • SARIF: Linters that produce output in the Static Analysis Results Interchange Format work by default, as long as you configure rules_lint to generate this output.
  • Supported Linters Examples: ESLint, Flake8, Programming Mistake Detector, Ruff, Buf, Vale, Clang-Tidy, ShellCheck, and Stylelint are examples of currently supported linters.