rust_lint_config.bzl
rust_lint_config
load("@rules_rust//rust:rust_lint_config.bzl", "rust_lint_config")
rust_lint_config(name, clippy, rustc, rustc_check_cfg, rustdoc)
Defines a group of lints that can be applied when building Rust targets.
For example, you can define a single group of lints:
load("@rules_rust//rust:defs.bzl", "rust_lint_config")
rust_lint_config(
name = "workspace_lints",
rustc = {
"unknown_lints": "allow",
"unexpected_cfgs": "warn",
},
rustc_check_cfg = {
"bazel": [],
"fuzzing": [],
"mz_featutres": ["laser", "rocket"],
},
clippy = {
"box_default": "allow",
"todo": "warn",
"unused_async": "warn",
},
rustdoc = {
"unportable_markdown": "allow",
},
)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| clippy | Set of 'clippy' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'. | Dictionary: String -> String | optional | {} |
| rustc | Set of 'rustc' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'. | Dictionary: String -> String | optional | {} |
| rustc_check_cfg | Set of 'cfg' names and list of values to expect. | Dictionary: String -> List of strings | optional | {} |
| rustdoc | Set of 'rustdoc' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'. | Dictionary: String -> String | optional | {} |