peripheryapp / periphery

A tool to identify unused code in Swift projects.
MIT License
5.2k stars 186 forks source link

Adds a rule that can be used out of the box to use Periphery in bazel… #783

Closed maxwellE closed 1 month ago

maxwellE commented 1 month ago

… projects

Using the example provided here you are able to generate periphery reports for any collection of swift based targets. To run the example run

bazel build //periphery/example:periphery_xcode_report

It is important to note the flags specified in the .bazelrc file, they are critical to periphery working via bazel

ileitch commented 1 month ago

Closing this now that #786 is merged. This PR was a huge help to me, especially the aspect implementation, thank you!

One difference between this PR and the implementation in master is the generation of the report as an output. I think perhaps we could wrap the scan rule with another that executes the scan and uses tee to pipe the output to a file. That way we get the benefit of the Bazel output while also seeing the output printed to stdout.