Skip to content

Add Bazel query override for scan roots#1122

Merged
ileitch merged 2 commits into
peripheryapp:masterfrom
brentleyjones:bj/bazel-query-override
May 14, 2026
Merged

Add Bazel query override for scan roots#1122
ileitch merged 2 commits into
peripheryapp:masterfrom
brentleyjones:bj/bazel-query-override

Conversation

@brentleyjones
Copy link
Copy Markdown
Contributor

Summary

  • add a --bazel-query option that fully overrides Periphery's default Bazel top-level target query
  • only apply --bazel-filter when using the built-in default query
  • make the generated Bazel scan aspect follow embedded bundle and plugin edges transitively
  • update the Bazel README/changelog entries to document the new query override and transitive scan behavior

Why

This makes it possible to avoid building incorrectly transitioned targets while still analyzing code that is only reachable through app extensions, app clips, watch applications, or Swift compiler plugins.

It also gives callers a straightforward way to exclude targets from the generated scan root set, for example by overriding the query to omit targets tagged manual.

Testing

  • swift test on macOS

The local swift test run still had two unrelated pre-existing failures in this environment:

  • FilePathGlobTest.testGlobstarWithSlash
  • XcodeTargetTest.testSourceFileInGroupWithoutFolder

@brentleyjones
Copy link
Copy Markdown
Contributor Author

@ileitch

@ileitch
Copy link
Copy Markdown
Contributor

ileitch commented May 14, 2026

It also gives callers a straightforward way to exclude targets from the generated scan root set, for example by overriding the query to omit targets tagged manual.

This could lead to incorrect results if those excluded targets hold references to other targets. The --report-exclude option might be a preferable approach.

@ileitch ileitch merged commit d711a9f into peripheryapp:master May 14, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants