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
--enable_bzlmod, rules_lint installs multitool automatically.
WORKSPACE users must install it manually; see the snippet on the releases page.
Other formatter binaries may be declared in your repository, typically in tools/format/BUILD.bazel.
You can test that they work by running them directly, with bazel run -- //tools/format:some-tool.
Then use the label //tools/format:some-tool as the value of whatever language attribute in format_multirun.
See the example/tools/format/BUILD file in this repo for full examples of declaring formatters.
Rule: languages
Language attributes that may be passed to format_multirun or format_test.
Files with matching extensions from GitHub Linguist will be formatted for the given language.
Some languages have dialects:
javascriptincludes TypeScript, TSX, and JSON.cssincludes Less and Sass.
languages rule directly, it exists only to document the attributes.
Attributes
A unique name for this target.
a
prettier binary, or any other tool that has a matching command-line interface.a
prettier binary, or any other tool that has a matching command-line interface.a
prettier binary, or any other tool that has a matching command-line interface.a
cue-fmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:cue to choose the built-in tool.a
prettier binary, or any other tool that has a matching command-line interface.a
prettier binary, or any other tool that has a matching command-line interface.a
ruff binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:ruff to choose the built-in tool.a
buildifier binary, or any other tool that has a matching command-line interface.a
jsonnetfmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:jsonnetfmt to choose the built-in tool.a
terraform-fmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:terraform to choose the built-in tool.a
taplo binary, or any other tool that has a matching command-line interface.a
ktfmt binary, or any other tool that has a matching command-line interface.a
java-format binary, or any other tool that has a matching command-line interface.a
djlint binary, or any other tool that has a matching command-line interface.a
scalafmt binary, or any other tool that has a matching command-line interface.a
swiftformat binary, or any other tool that has a matching command-line interface.a
gofmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:gofumpt to choose the built-in tool.a
prettier binary, or any other tool that has a matching command-line interface.a
shfmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:shfmt to choose the built-in tool.a
buf binary, or any other tool that has a matching command-line interface.a
clang-format binary, or any other tool that has a matching command-line interface.a
clang-format binary, or any other tool that has a matching command-line interface.a
clang-format binary, or any other tool that has a matching command-line interface.a
yamlfmt binary, or any other tool that has a matching command-line interface. Use @aspect_rules_lint//format:yamlfmt to choose the built-in tool.a
rustfmt binary, or any other tool that has a matching command-line interface.a
prettier binary, or any other tool that has a matching command-line interface.a
prettier binary, or any other tool that has a matching command-line interface.a
fantomas binary, or any other tool that has a matching command-line interface.a
csharpier binary, or any other tool that has a matching command-line interface.Function: format_multirun
Create a multirun binary for the given languages.
Intended to be used with bazel run to update source files in-place.
This macro produces a target named [name].check which does not edit files,
rather it exits non-zero if any sources require formatting.
To check formatting with bazel test, use format_test instead.
Parameters
name of the resulting target, typically “format”
how many language formatters to spawn in parallel, ideally matching how many CPUs are available
whether to print a progress message before calling the formatter of each language.
Note that a line is printed for a formatter even if no files of that language are to be formatted.
Set to True to disable honoring .gitattributes filters
attributes named for each language; see languages.
Additionally supports custom arguments via
{language}_fix_args and {language}_check_args
to override default formatter flags for fix and check modes respectively.Function: format_test
Create test for the given formatters.
Intended to be used with bazel test to verify files are formatted.
This is not recommended, because it is either non-hermetic or requires listing all source files.
To format with bazel run, see format_multirun.
Parameters
name of the resulting target, typically “format”
list of files to verify formatting. Required when no_sandbox is False.
a file in the root directory to verify formatting. Required when no_sandbox is True.
Typically
//:WORKSPACE or //:MODULE.bazel may be used.Set to True to enable formatting all files in the workspace.
This mode causes the test to be non-hermetic and it cannot be cached. Read the documentation in /docs/formatting.md.
Set to True to disable honoring .gitattributes filters
tags to apply to generated targets. In ‘no_sandbox’ mode,
["no-sandbox", "no-cache", "external"] are added to the tags.
