Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quiet new warnings from Xcode 13.3 #673

Merged
merged 3 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/xcodeproj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: GitHub Action for SwiftLint
uses: pepibumur/action-swiftlint@0d4afd006bb24e4525b5afcefd4ab5e2537193ac
uses: norio-nomura/action-swiftlint@3.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Sources/XcodeProj/Workspace/XCWorkspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class XCWorkspace: Writable, Equatable {

/// Initializes a default workspace with a single reference that points to self:
public convenience init() {
let data = XCWorkspaceData(children: [.file(.init(location: .self("")))])
let data = XCWorkspaceData(children: [.file(.init(location: .current("")))])
self.init(data: data)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public enum XCWorkspaceDataElementLocationType {
case container(String) // "Relative to container"
case developer(String) // "Relative to Developer Directory"
case group(String) // "Relative to group"
case `self`(String) // Single project workspace in xcodeproj directory
case current(String) // Single project workspace in xcodeproj directory
case other(String, String)

public var schema: String {
Expand All @@ -22,7 +22,7 @@ public enum XCWorkspaceDataElementLocationType {
return "developer"
case .group:
return "group"
case .self:
case .current:
return "self"
case let .other(schema, _):
return schema
Expand All @@ -39,7 +39,7 @@ public enum XCWorkspaceDataElementLocationType {
return path
case let .group(path):
return path
case let .self(path):
case let .current(path):
return path
case let .other(_, path):
return path
Expand All @@ -62,7 +62,7 @@ public enum XCWorkspaceDataElementLocationType {
case "group":
self = .group(path)
case "self":
self = .self(path)
self = .current(path)
default:
self = .other(schema, path)
}
Expand All @@ -86,7 +86,7 @@ extension XCWorkspaceDataElementLocationType: Equatable {
return lhs == rhs
case let (.group(lhs), .group(rhs)):
return lhs == rhs
case let (.self(lhs), .self(rhs)):
case let (.current(lhs), .current(rhs)):
return lhs == rhs
case let (.other(lhs0, lhs1), .other(rhs0, rhs1)):
return lhs0 == rhs0 && lhs1 == rhs1
Expand Down
6 changes: 3 additions & 3 deletions Tests/XcodeProjTests/Workspace/XCWorkspaceDataTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class XCWorkspaceDataTests: XCTestCase {
override func setUp() {
super.setUp()
fileRef = XCWorkspaceDataFileRef(
location: .self("path")
location: .current("path")
)
subject = XCWorkspaceData(children: [])
}
Expand All @@ -26,7 +26,7 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase {
let path = fixturePath()
let got = try XCWorkspaceData(path: path)
if case let XCWorkspaceDataElement.file(location: fileRef) = got.children.first! {
XCTAssertEqual(fileRef.location, .self(""))
XCTAssertEqual(fileRef.location, .current(""))
} else {
XCTAssertTrue(false, "Expected file reference")
}
Expand All @@ -45,7 +45,7 @@ final class XCWorkspaceDataIntegrationTests: XCTestCase {
initModel: { try? XCWorkspaceData(path: $0) },
modify: {
$0.children.append(
.group(.init(location: .self("shakira"),
.group(.init(location: .current("shakira"),
name: "shakira",
children: []))
)
Expand Down
2 changes: 1 addition & 1 deletion Tests/XcodeProjTests/Workspace/XCWorkspaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class XCWorkspaceIntegrationTests: XCTestCase {

func test_init_returnsAWorkspaceWithTheCorrectReference() {
XCTAssertEqual(XCWorkspace().data.children.count, 1)
XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .self(""))))
XCTAssertEqual(XCWorkspace().data.children.first, .file(.init(location: .current(""))))
}

func test_equatable_emptyWorkspacesAreEqual() {
Expand Down