Make Configuration introspectable - #268
Conversation
eabae88 to
bbd9ecb
Compare
|
The capability is nice, but I'm a little concerned about the use of enums in public API -- usually that's discouraged. I'm not sure what other good options there are, though. |
|
Making it a |
|
Nice, I was just wondering if something like We could annotate |
|
@broken-circle thanks for the PR! Let's do this post 1.0 (it was originally scheduled for post 1.0) |
231d282 to
32c1b2e
Compare
32c1b2e to
f7734e8
Compare
|
This is ready for review now that we're post-1.0. Earlier I thought If the version bump isn't acceptable, we can make |
894d75b to
c44f40f
Compare
c44f40f to
ae1e3f9
Compare
`@nonexhaustive` (SE-0487) was implemented in Swift 6.2.3.
ae1e3f9 to
d22b745
Compare
Closes #206.
This PR adds public introspection of
Arguments,Executable, andEnvironmentso callers generating subprocess configurations can unit-test them without spawning a subprocess. The current storage of these types is opaque, leaving callers with only string-based descriptions to parse.Argumentsconforms toRandomAccessCollection<Arguments.Value>, whereValueis a public mirror of the internalStringOrRawBytes. AValueenum was chosen over lossy UTF-8 decoding so callers constructing arguments from[UInt8]on POSIX can verify the exact bytes.Arguments.executablePathOverrideis exposed as a separate public property rather than folded into iteration. Folding would makeargv[0]ambiguous between an override and a regular first argument, and would prevent callers from distinguishing the two cases in tests. The internal stored property is renamed to_executablePathOverrideto free the name for the public accessor.ExecutableandEnvironmentexpose their contents through newRepresentationmirror enums rather than exposing their internal storage types directly, decoupling the public introspection surface from internal storage.Environment.Key.pathis promoted frompackagetopublicso callers can use it as a canonical reference to thePATHkey.The Swift tools version is bumped to 6.2.3 to support
@nonexhaustive(SE-0487).