rust_clippy.bzl
rust_clippy
load("@rules_rust//rust:rust_clippy.bzl", "rust_clippy")
rust_clippy(name, deps)
Executes the clippy checker on a specific target.
Similar to rust_clippy_aspect, but allows specifying a list of dependencies within the build system.
For example, given the following example targets:
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")
rust_library(
name = "hello_lib",
srcs = ["src/lib.rs"],
)
rust_test(
name = "greeting_test",
srcs = ["tests/greeting.rs"],
deps = [":hello_lib"],
)
Rust clippy can be set as a build target with the following:
load("@rules_rust//rust:defs.bzl", "rust_clippy")
rust_clippy(
name = "hello_library_clippy",
testonly = True,
deps = [
":hello_lib",
":greeting_test",
],
)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| deps | Rust targets to run clippy on. | List of labels | optional | [] |