SWIFT ANALYZER / LOCAL CLI

Static analysis for Swift

Local Swift analysis with explicit evidence, assumptions, and unknown boundaries. Start with a small compiler-backed SwiftPM example.

Experimental CLI · owner-provided checkout · local analysis

Read the program as one build snapshot

Swift Analyzer connects declarations, references, roots, and explicit dynamic boundaries from one prepared build snapshot.

Reachability

Declaration and reference analysis within a specific build snapshot.

Explanations

Evidence, assumptions, and limitations for individual results.

Local execution

Existing compiler data as input. Canonical JSON as output.

Command-line interface

source-scan prepares a small supported SwiftPM product after explicit build authorization. The separate manifest commands doctor, scan and why require an already supplied admitted snapshot.

For automation, preserve the JSON report and exit code. Exit 3 indicates incomplete capability.

shell · documented grammar
swift-analyzer source-scan --package-path ./Example \
  --product Example --allow-build --format json

Compiler data as input

Source-scan performs managed package discovery and an indexed build after --allow-build. Manifest commands instead consume an existing admitted compiler snapshot supplied with its manifest.

Incomplete inputs or unmodeled dynamic behavior leave affected conclusions unknown. The absence of known references does not prove that code is unused.

Current boundary

The documented source-scan workflow is experimental and bounded to one native profile. Access requires an owner-provided checkout; no public binary download, automatic deletion or default blocking findings gate is offered.

Team workflows and a hosted service are planned. The current scope is the local CLI.