Skip to content

Evaluate @unchecked Sendable usage in XcodeOutputProcessor #40

@diogot

Description

@diogot

Summary

The XcodeOutputProcessor class uses @unchecked Sendable as a workaround because XCBeautifier from XcbeautifyLib does not conform to Sendable.

Current Implementation

The class is marked as @unchecked Sendable with the XCBeautifier stored as a private property.

Concern

A PR review comment suggested using @MainActor instead to provide proper isolation. However, for a CLI tool, @MainActor may not be appropriate as it would require all callers to be on the main actor.

Options to Evaluate

  1. Keep @unchecked Sendable - Current approach, safe if XCBeautifier.format(line:) is synchronous and the processor is only accessed from a single task
  2. Use @mainactor - Provides compiler-enforced isolation but may not be suitable for CLI tools
  3. Make it an actor - Provides proper isolation with async access
  4. Verify XCBeautifier thread safety - If the library is thread-safe, @unchecked Sendable is correct

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions