Skip to content

unused_dependency_checker false positives with _suite macros #617

@gkossakowski

Description

@gkossakowski

Unused dependency checker gives false positives when _suite macros are involved. Let's consider:

scala_library_suite(
   name = "foo",
   srcs = ["A.scala", "B.scala"],
   deps = ["dep1", "dep2"],
)

A.scala depends on dep1 and B.scala depends on dep2. In this scenario, both dep1 and dep2 will be reported as unused. It's because _suite is expanded into several targets with deps copied to each of them.

Users' expectation here is that dependency is reported as an unused only when it's not used in all srcs from the suite but now it's reported if it's unused in some source from the suite. Fixing this would require a post-processing step that takes union of deps information from all expanded targets of the suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dep-trackingStrict/unused deps, label collections related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions