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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
clippySet of 'clippy' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'.Dictionary: String -> Stringoptional{}
rustcSet of 'rustc' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'.Dictionary: String -> Stringoptional{}
rustc_check_cfgSet of 'cfg' names and list of values to expect.Dictionary: String -> List of stringsoptional{}
rustdocSet of 'rustdoc' lints to 'allow', 'warn', 'force-warn', 'deny', or 'forbid'.Dictionary: String -> Stringoptional{}