Skip to content

Rename SwiftGitX enum to SwiftGitXRuntime - #6

Merged
ibrahimcetin merged 1 commit into
mainfrom
rename-swiftigitxruntime
Nov 26, 2025
Merged

Rename SwiftGitX enum to SwiftGitXRuntime#6
ibrahimcetin merged 1 commit into
mainfrom
rename-swiftigitxruntime

Conversation

@ibrahimcetin

Copy link
Copy Markdown
Owner

Problem

The SwiftGitX enum name conflicts with the module name, making it impossible to reference module-level types when the enum is in scope. This particularly affects tests using Swift Testing where Testing.Tag and SwiftGitX.Tag create ambiguity.

Before - Ambiguous, doesn't work

let tag = try #require(references.first as? SwiftGitX.Tag)
// Error: SwiftGitX.Tag resolves to the enum, not the module

Solution

Rename the enum to SwiftGitXRuntime to eliminate the naming conflict.

After - Clear and unambiguous

try SwiftGitXRuntime.initialize()
let tag = try #require(references.first as? SwiftGitX.Tag)
// SwiftGitX now correctly resolves to the module

Breaking Changes

Simply rename SwiftGitX to SwiftGitXRuntime.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves a naming conflict between the SwiftGitX enum and the SwiftGitX module by renaming the enum to SwiftGitXRuntime. This prevents ambiguity when trying to reference module-level types, particularly in Swift Testing contexts where Testing.Tag and SwiftGitX.Tag would collide.

Key changes:

  • Renamed the SwiftGitX enum to SwiftGitXRuntime in the main source file
  • Updated all test references to use the new SwiftGitXRuntime name
  • Maintained backward-compatible documentation comments that refer to "the SwiftGitX library" (the module)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Sources/SwiftGitX/SwiftGitX.swift Renamed the public enum from SwiftGitX to SwiftGitXRuntime to eliminate naming conflict with the module
Tests/SwiftGitXTests/SwiftGitXTests.swift Updated all test code to use SwiftGitXRuntime for initialization, shutdown, and version access across XCTest and Swift Testing frameworks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ibrahimcetin
ibrahimcetin merged commit 611c696 into main Nov 26, 2025
7 checks passed
@ibrahimcetin
ibrahimcetin deleted the rename-swiftigitxruntime branch November 26, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants