blob: bcd81594a7299e970333b4c04ed219a8d40b12c2 [file] [log] [blame]
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_clippy", "rust_library", "rust_test")
package(default_visibility = ["//test:__subpackages__"])
# Declaration of passing targets.
rust_binary(
name = "ok_binary",
srcs = ["src/main.rs"],
edition = "2018",
)
rust_library(
name = "ok_library",
srcs = ["src/lib.rs"],
edition = "2018",
)
rust_test(
name = "ok_test",
srcs = ["src/lib.rs"],
edition = "2018",
)
# Clippy analysis of passing targets.
rust_clippy(
name = "ok_binary_clippy",
deps = [":ok_binary"],
)
rust_clippy(
name = "ok_library_clippy",
deps = [":ok_library"],
)
rust_clippy(
name = "ok_test_clippy",
testonly = True,
deps = [":ok_test"],
)
# Declaration of failing targets.
rust_binary(
name = "bad_binary",
srcs = ["bad_src/main.rs"],
edition = "2018",
tags = ["noclippy"],
)
rust_library(
name = "bad_library",
srcs = ["bad_src/lib.rs"],
edition = "2018",
tags = ["noclippy"],
)
rust_test(
name = "bad_test",
srcs = ["bad_src/lib.rs"],
edition = "2018",
tags = ["noclippy"],
)
# Clippy analysis of failing targets.
rust_clippy(
name = "bad_binary_clippy",
tags = ["manual"],
deps = [":bad_binary"],
)
rust_clippy(
name = "bad_library_clippy",
tags = ["manual"],
deps = [":bad_library"],
)
rust_clippy(
name = "bad_test_clippy",
testonly = True,
tags = ["manual"],
deps = [":bad_test"],
)
sh_binary(
name = "clippy_failure_test",
srcs = ["clippy_failure_test.sh"],
)