Skip to content

3.0 Migration Guide

Ian Leitch edited this page Jan 3, 2025 · 4 revisions

Targets

Version 3.0 is a major breaking release that fundamentally changes how Periphery scans source files. In prior versions, targets need to be explicitly chosen with the -—targets option, whereas in version 3.0, Periphery will scan all source files referenced in the index store (excluding some reasonable defaults). This is a beneficial change for the following reasons:

  1. You no longer need to specify which targets to scan, which was cumbersome, especially for very large projects.
  2. It avoids false positive results in cases where a target was accidentally omitted.
  3. Code generated by Xcode or Swift packages that could not be specified by a target is now scanned automatically.

The --targets option has been removed, and you should now use the various options for excluding files. See Excluding Files in the README for more details.

Workspace

The --workspace option has been removed. The --project option should now be used for both .xcworkspace and .xcodeproj.

Homebrew

Periphery is now included in the official Homebrew repository, and the peripheryapp/periphery tap is no longer updated. To migrate run the following:

brew remove periphery
brew untap peripheryapp/periphery
brew update
brew install periphery

Bazel

Periphery now supports Bazel projects directly, and the -—file-targets-path option is no longer needed. Instead, add the following to your MODULE.bazel file:

bazel_dep(name = "periphery", version = "<version>", dev_dependency = True)
use_repo(use_extension("@periphery//bazel:generated.bzl", "generated"), "periphery_generated")

and use the --bazel option when performing the scan:

bazel run @periphery -- scan --bazel

See the README for more details.

Other Build Systems

The —-file-targets-path option has been replaced with -—generic-project-config. See Build Systems in the README for more details.

Clone this wiki locally