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.
Documentation for @aspect_rules_lint@v2.1.0 — View source
rb_binary, rb_library, and rb_test rules.
Typical usage:
Installing Standard Ruby
The recommended approach is to use Bundler with rules_ruby to manage Standard Ruby as a gem dependency:- Add Standard Ruby to your
Gemfile:
-
Run
bundle lockto generateGemfile.lock -
Configure the bundle in your
MODULE.bazel:
- Create an alias to the gem-provided binary in
tools/lint/BUILD.bazel:
- Create the linter aspect, typically in
tools/lint/linters.bzl:
- Hermetic builds with pinned gem versions
- Consistent Standard Ruby versions across all developers
- Integration with Bazel’s dependency management
Configuration
Standard Ruby will automatically discover.standard.yml files according to its
standard configuration hierarchy.
See https://github.com/standardrb/standard for details.
Note: all config files are passed to the action as inputs.
This means that a change to any config file invalidates the action cache
entries for ALL Standard Ruby actions.
Function: standardrb_action
Run Standard Ruby as an action under Bazel.
Standard Ruby will select the configuration file to use for each
source file, as documented here:
https://github.com/standardrb/standard
Note: all config files are passed to the action.
This means that a change to any config file invalidates the action cache
entries for ALL Standard Ruby actions.
However this is needed because Standard Ruby’s logic for selecting the
appropriate config needs to traverse the directory hierarchy.
Parameters
Bazel Rule or Aspect evaluation context
File object for the Standard Ruby executable
list of File objects for Ruby source files to be linted
list of File objects for Standard Ruby config files
(.standard.yml)
File object where linter output will be written
File object where exit code will be written, or None.
If None, the build will fail when Standard Ruby exits non-zero.
See https://github.com/standardrb/standard
boolean, whether to enable color output
output file for patch (optional). If provided, uses run_patcher instead of run_shell.
Function: lint_standardrb_aspect
A factory function to create a linter aspect.
Parameters
Label of the Standard Ruby executable.
Example: “//tools/lint:standardrb” or “@bundle//bin:standardrb”
Label or list of Labels of Standard Ruby config file(s).
Example: [”//:standard.yml”] or ”//:standard.yml”
list of rule kinds to visit.
See https://bazel.build/query/language#kind
list of filegroup tags. Filegroups with these tags
will be visited by the aspect in addition to Ruby rule kinds.

