google / capslock

BSD 3-Clause "New" or "Revised" License
668 stars 25 forks source link

analyzer: support the granularity flag with --output=json #168

Closed jcd2 closed 1 week ago

jcd2 commented 1 week ago

Setting --granularity=function, or leaving granularity unset, gives the existing behavior.

For --granularity=package, the returned list is pruned so that there is only one entry per (capability, queried package) pair.

We also add a new option, --granularity=intermediate. This granularity finds which packages exist anywhere along a path in the callgraph from a function in a queried package to a function with a capability.

This allows users to see when a change in their dependencies results in a capability being reached in a path via a new package, even if the top-level function already had that capability through another path.