Currently, the clippy aspect doesn't traverse through deps edges. Therefore, if you build a rust_binary that depends on a rust_library and the rust_library has clippy issues, these won't be reported unless you also build the library.
To reproduce:
- Create this target in
test/clippy/BUILD.bazel:
rust_binary(
name = "bad_transitive_dep",
srcs = ["src/main.rs"],
edition = "2018",
deps = [":bad_library"],
)
- Then, remove the
noclippy tag from :bad_library.
- Run clippy:
bazel build --config=clippy test/clippy:bad_transitive_dep -> Succeeds
bazel build --config=clippy test/clippy:bad_library -> Fails
bazel build --config=clippy test/clippy:bad_library test/clippy:bad_transitive_dep -> Fails
I would have expected building :bad_transitive_dep to fail, since one of their dependencies fails.
I'm happy to implement the traversal functionality, but I wanted to check first before going deep into it: Is there any context I should be aware of? Is this against the philosophy of the the aspect?
I wasn't able to find anything in the Bazel slack or in the open issues, sorry if I missed anything.
Currently, the clippy aspect doesn't traverse through
depsedges. Therefore, if you build arust_binarythat depends on arust_libraryand therust_libraryhas clippy issues, these won't be reported unless you also build the library.To reproduce:
test/clippy/BUILD.bazel:noclippytag from:bad_library.bazel build --config=clippy test/clippy:bad_transitive_dep-> Succeedsbazel build --config=clippy test/clippy:bad_library-> Failsbazel build --config=clippy test/clippy:bad_library test/clippy:bad_transitive_dep-> FailsI would have expected building
:bad_transitive_depto fail, since one of their dependencies fails.I'm happy to implement the traversal functionality, but I wanted to check first before going deep into it: Is there any context I should be aware of? Is this against the philosophy of the the aspect?
I wasn't able to find anything in the Bazel slack or in the open issues, sorry if I missed anything.