Skip to content

deprecate netrc #287

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

Merged
merged 1 commit into from
Feb 22, 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
8 changes: 8 additions & 0 deletions Sources/TSCUtility/Netrc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ extension AuthorizationProviding {
which is only available in macOS 10.13+, iOS 11+, etc at this time.
*/
/// Container of parsed netrc connection settings
// FIXME: deprecate 2/2022, remove once clients transitioned
@available(*, deprecated, message: "moved to SwiftPM")
@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
public struct Netrc {
/// Representation of `machine` connection settings & `default` connection settings.
Expand Down Expand Up @@ -98,6 +100,8 @@ public struct Netrc {
@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
extension Netrc: AuthorizationProviding {}

// FIXME: deprecate 2/2022, remove once clients transitioned
@available(*, deprecated, message: "moved to SwiftPM")
@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
public extension Netrc {
enum Error: Swift.Error {
Expand Down Expand Up @@ -136,13 +140,17 @@ public extension Netrc {
}
}

// FIXME: deprecate 2/2022, remove once clients transitioned
@available(*, deprecated, message: "moved to SwiftPM")
@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
extension Netrc.Error: CustomNSError {
public var errorUserInfo: [String : Any] {
return [NSLocalizedDescriptionKey: "\(self)"]
}
}

// FIXME: deprecate 2/2022, remove once clients transitioned
@available(*, deprecated, message: "moved to SwiftPM")
@available (macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
fileprivate enum RegexUtil {
@frozen fileprivate enum Token: String, CaseIterable {
Expand Down
4 changes: 3 additions & 1 deletion Tests/TSCUtilityTests/NetrcTests.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import XCTest
import TSCUtility

@available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
// FIXME: deprecate 2/2022, remove once clients transitioned
@available(*, deprecated, message: "moved to SwiftPM")
/// Netrc feature depends upon `NSTextCheckingResult.range(withName name: String) -> NSRange`,
/// which is only available in macOS 10.13+ at this time.
@available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *)
class NetrcTests: XCTestCase {
/// should load machines for a given inline format
func testLoadMachinesInline() {
Expand Down