Repository navigation
Trace unresolved requirements by default - #74
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No objective defects were found and all callers of the updated Config and resolveRequirements signatures remain consistent with the intentional new default.
No open issues 🎉
What changed in this PR
This PR flips the analyzer's traceUnresolved option to default to true, so that any caller of the static analyzer gets the full call-chain trace for unresolved implicit requirements automatically, rather than only bare errors. Since both in-tree callers (the SPM plugin and the external browser build tool) already always requested tracing, the option is removed from the plugin's serialized args schema and now simply relies on the new default.
Changes:
StaticAnalysis.Config.initnow defaultstraceUnresolvedtotrue.- The
traceUnresolvedfield is dropped from both copies of theImplicitsToolSPMPluginArgsCodable schema, and the plugin no longer passes it when constructing args/config. RequirementsGraph.resolveRequirementsdrops its ownfalsedefault; its only caller passesconfig.traceUnresolvedexplicitly.
| File | Description |
|---|---|
Sources/ImplicitsTool/StaticAnalysis.swift |
Changes the public Config default for traceUnresolved to true. |
Sources/ImplicitsTool/RequirementsGraph.swift |
Removes the false default on resolveRequirements(traceUnresolved:), making the argument required. |
Sources/implicits-tool-spm-plugin/entry.swift |
Drops traceUnresolved from the tool-side args schema and simplifies the Config construction. |
Plugins/ImplicitsAnalysisPlugin/ImplicitsAnalysisPlugin.swift |
Drops traceUnresolved from the plugin-side args schema and stops passing it. |
I reviewed the full change set and did not find objective defects. The two ImplicitsToolSPMPluginArgs schema copies remain in sync, the only production/test callers of Config and resolveRequirements are consistent with the new signatures, and there are no stale traceUnresolved references in docs or elsewhere. The behavioral change to the public Config default is intentional and matches the PR's stated goal.
Review effort: Balanced
Every caller of the analyzer turns on tracing of unresolved requirements: the SPM plugin always passes
traceUnresolved: true, and so does the browser's build tool. The default still saidfalse, so a new caller would get errors without the call chain unless it knew to ask.Changes
StaticAnalysis.Configtraces unresolved requirements by default.traceUnresolved: the plugin only ever senttrue, which is now the default.resolveRequirementsno longer has its ownfalsedefault; its only caller passes the config's value.Test plan
swift:6.2Linux container, with the CI commands: the build, including the Showcase targets that run the plugin, and all 121 tests pass. The tests settraceUnresolvedexplicitly, so they don't depend on the default.