Skip to content

Commit ea3505c

Browse files
committed
fixing issues with linting script
1 parent 6291e5f commit ea3505c

20 files changed

+58
-60
lines changed

Sources/PackageDSLKit/Extensions/Property+Extensions.swift

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,30 @@ extension Property {
3636
self.init(name: name, type: type, code: code)
3737
}
3838
}
39-
extension Property {
40-
internal struct MissingFieldsError: OptionSet, Error, Sendable {
41-
internal typealias RawValue = Int
42-
43-
internal static let name = MissingFieldsError(rawValue: 1)
44-
internal static let type = MissingFieldsError(rawValue: 2)
45-
// static let code = MissingFieldsError(rawValue: 4)
46-
47-
internal var rawValue: Int
48-
}
49-
50-
internal init(name: String?, type: String?, code: [String]) throws(MissingFieldsError) {
51-
var error: MissingFieldsError = []
52-
if name == nil {
53-
error.insert(.name)
54-
}
55-
if type == nil {
56-
error.insert(.type)
57-
}
58-
if !error.isEmpty {
59-
throw error
60-
} else {
61-
assert(name != nil && type != nil)
62-
self.init(name: name ?? "", type: type ?? "", code: code)
63-
}
64-
}
65-
}
39+
// extension Property {
40+
// internal struct MissingFieldsError: OptionSet, Error, Sendable {
41+
// internal typealias RawValue = Int
42+
//
43+
// internal static let name = MissingFieldsError(rawValue: 1)
44+
// internal static let type = MissingFieldsError(rawValue: 2)
45+
// // static let code = MissingFieldsError(rawValue: 4)
46+
//
47+
// internal var rawValue: Int
48+
// }
49+
//
50+
// internal init(name: String?, type: String?, code: [String]) throws(MissingFieldsError) {
51+
// var error: MissingFieldsError = []
52+
// if name == nil {
53+
// error.insert(.name)
54+
// }
55+
// if type == nil {
56+
// error.insert(.type)
57+
// }
58+
// if !error.isEmpty {
59+
// throw error
60+
// } else {
61+
// assert(name != nil && type != nil)
62+
// self.init(name: name ?? "", type: type ?? "", code: code)
63+
// }
64+
// }
65+
// }

Sources/PackageDSLKit/Protocols/ComponentBuildable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ internal protocol ComponentBuildable: Sendable {
3434
static var directoryName: String { get }
3535
init(component: Component, requirements: Requirements)
3636
static func requirements(from component: Component) -> Requirements?
37-
func createComponent() -> Component
37+
// func createComponent() -> Component
3838
}

Sources/PackageDSLKit/Types/PackageFiles.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import Foundation
3131

3232
public struct PackageFiles: PackageFilesFactory, Sendable {
33-
public static let `default`: PackageFilesFactory = PackageFiles()
33+
public static let `default`: any PackageFilesFactory = PackageFiles()
3434

3535
private static let defaultTypes:
3636
[PackageFilesInterfaceType: @Sendable () -> any PackageFilesInterface] = [

Sources/PackageDSLKit/Types/PackageParser.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public struct PackageParser: Sendable, Hashable, Codable {
3434
public init() {
3535
}
3636
#if canImport(Foundation) && (os(macOS) || os(Linux))
37-
public func parse(at directoryURL: URL, with fileManager: FileManager)
37+
public func parse(at directoryURL: URL)
3838
async throws(PackageDSLError)
3939
-> PackageSpecifications
4040
{

Sources/PackageDSLKit/Types/PackageWriter.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public struct PackageWriter: Sendable {
4040
]
4141

4242
private let fileInterfaceType: PackageFilesInterfaceType
43-
private let fileAccessor: PackageFilesFactory
44-
private let indexWriter: IndexCodeWriter
45-
private let componentWriter: StructureWriter
43+
private let fileAccessor: any PackageFilesFactory
44+
private let indexWriter: any IndexCodeWriter
45+
private let componentWriter: any StructureWriter
4646

4747
public init() {
4848
self.init(componentWriter: ComponentWriter())

Sources/SwiftPackageManagerKit/Models/Dependency.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public enum Dependency: Codable, Hashable, Sendable {
4848
}
4949
}
5050

51-
public init(from decoder: Decoder) throws {
51+
public init(from decoder: any Decoder) throws {
5252
let container = try decoder.container(keyedBy: CodingKeys.self)
5353

5454
if container.contains(.sourceControl) {
@@ -79,7 +79,7 @@ public enum Dependency: Codable, Hashable, Sendable {
7979
}
8080
}
8181

82-
public func encode(to encoder: Encoder) throws {
82+
public func encode(to encoder: any Encoder) throws {
8383
var container = encoder.container(keyedBy: CodingKeys.self)
8484

8585
switch self {

Sources/SwiftPackageManagerKit/Models/DependencyLocation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public enum DependencyLocation: Codable, Hashable, Sendable {
4343
let urlString: String
4444
}
4545

46-
public init(from decoder: Decoder) throws {
46+
public init(from decoder: any Decoder) throws {
4747
let container = try decoder.container(keyedBy: CodingKeys.self)
4848

4949
if container.contains(.remote) {
@@ -66,7 +66,7 @@ public enum DependencyLocation: Codable, Hashable, Sendable {
6666
}
6767
}
6868

69-
public func encode(to encoder: Encoder) throws {
69+
public func encode(to encoder: any Encoder) throws {
7070
var container = encoder.container(keyedBy: CodingKeys.self)
7171

7272
switch self {

Sources/SwiftPackageManagerKit/Models/PackageKind.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public enum PackageKind: Codable, Hashable, Sendable {
4141
case remote
4242
}
4343

44-
public init(from decoder: Decoder) throws {
44+
public init(from decoder: any Decoder) throws {
4545
let container = try decoder.container(keyedBy: CodingKeys.self)
4646

4747
if let rootPaths = try? container.decode([String].self, forKey: .root) {
@@ -60,7 +60,7 @@ public enum PackageKind: Codable, Hashable, Sendable {
6060
}
6161
}
6262

63-
public func encode(to encoder: Encoder) throws {
63+
public func encode(to encoder: any Encoder) throws {
6464
var container = encoder.container(keyedBy: CodingKeys.self)
6565

6666
switch self {

Sources/SwiftPackageManagerKit/Models/Product.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct Product: Codable, Hashable, Sendable {
5353
}
5454

5555
// Custom decoding to handle missing settings field
56-
public init(from decoder: Decoder) throws {
56+
public init(from decoder: any Decoder) throws {
5757
let container = try decoder.container(keyedBy: CodingKeys.self)
5858

5959
self.name = try container.decode(String.self, forKey: .name)

Sources/SwiftPackageManagerKit/Models/ProductType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public enum ProductType: Codable, Hashable, Sendable {
4747
case plugin
4848
}
4949

50-
public init(from decoder: Decoder) throws {
50+
public init(from decoder: any Decoder) throws {
5151
let container = try decoder.container(keyedBy: CodingKeys.self)
5252

5353
if let libraryTypes = try? container.decode([LibraryType].self, forKey: .library) {
@@ -65,7 +65,7 @@ public enum ProductType: Codable, Hashable, Sendable {
6565
}
6666
}
6767

68-
public func encode(to encoder: Encoder) throws {
68+
public func encode(to encoder: any Encoder) throws {
6969
var container = encoder.container(keyedBy: CodingKeys.self)
7070

7171
switch self {

0 commit comments

Comments
 (0)