Skip to content

Commit 89c0ab7

Browse files
committed
chore: apply swift-format with 4-space indentation
1 parent 6996757 commit 89c0ab7

File tree

696 files changed

+41223
-41047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

696 files changed

+41223
-41047
lines changed

Sources/CSSAtRuleTypes/AtRule.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
//
77

88
public protocol AtRule: RawRepresentable & Hashable & Sendable {
9-
static var identifier: String { get }
9+
static var identifier: String { get }
1010
}

Sources/CSSAtRuleTypes/CharSet.swift

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,35 @@ import Foundation
1515
/// CharSet("iso-8859-15")
1616
/// ```
1717
public struct CharSet: AtRule {
18-
public static let identifier: String = "charset"
18+
public static let identifier: String = "charset"
1919

20-
public var rawValue: String
20+
public var rawValue: String
2121

22-
public init(rawValue: String) {
23-
self.rawValue = rawValue
24-
}
22+
public init(rawValue: String) {
23+
self.rawValue = rawValue
24+
}
2525

26-
/// Creates a charset declaration with the specified encoding.
27-
///
28-
/// - Parameter encoding: The character encoding name. Must be a valid encoding name.
29-
public init(_ encoding: String) {
30-
self.rawValue = "@charset \"\(encoding)\";"
31-
}
26+
/// Creates a charset declaration with the specified encoding.
27+
///
28+
/// - Parameter encoding: The character encoding name. Must be a valid encoding name.
29+
public init(_ encoding: String) {
30+
self.rawValue = "@charset \"\(encoding)\";"
31+
}
3232

33-
// Common character encodings as static properties
33+
// Common character encodings as static properties
3434

35-
/// UTF-8 character encoding.
36-
public static let utf8 = CharSet("UTF-8")
35+
/// UTF-8 character encoding.
36+
public static let utf8 = CharSet("UTF-8")
3737

38-
/// UTF-16 character encoding.
39-
public static let utf16 = CharSet("UTF-16")
38+
/// UTF-16 character encoding.
39+
public static let utf16 = CharSet("UTF-16")
4040

41-
/// ISO-8859-1 character encoding (Latin-1).
42-
public static let latin1 = CharSet("ISO-8859-1")
41+
/// ISO-8859-1 character encoding (Latin-1).
42+
public static let latin1 = CharSet("ISO-8859-1")
4343

44-
/// ISO-8859-15 character encoding (Latin-9).
45-
public static let latin9 = CharSet("ISO-8859-15")
44+
/// ISO-8859-15 character encoding (Latin-9).
45+
public static let latin9 = CharSet("ISO-8859-15")
4646

47-
/// Windows-1252 character encoding.
48-
public static let windows1252 = CharSet("windows-1252")
47+
/// Windows-1252 character encoding.
48+
public static let windows1252 = CharSet("windows-1252")
4949
}

Sources/CSSAtRuleTypes/ColorProfile.swift

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -18,88 +18,88 @@ import Foundation
1818
/// .renderingIntent(.perceptual)
1919
/// ```
2020
public struct ColorProfile: AtRule {
21-
public static let identifier: String = "color-profile"
21+
public static let identifier: String = "color-profile"
2222

23-
public var rawValue: String
24-
private var name: String
25-
private var descriptors: [String: String] = [:]
23+
public var rawValue: String
24+
private var name: String
25+
private var descriptors: [String: String] = [:]
2626

27-
public init(rawValue: String) {
28-
self.rawValue = rawValue
29-
// Extract name from rawValue for future reference
30-
// This is a simplified implementation; a proper parser would be more complex
31-
if let nameRange = rawValue.range(
32-
of: "@color-profile\\s+(--[\\w-]+|device-cmyk)\\s*\\{",
33-
options: .regularExpression
34-
) {
35-
let nameString = String(rawValue[nameRange])
36-
let parts = nameString.components(separatedBy: CharacterSet.whitespacesAndNewlines)
37-
self.name = parts.dropFirst().first ?? ""
38-
} else {
39-
self.name = ""
27+
public init(rawValue: String) {
28+
self.rawValue = rawValue
29+
// Extract name from rawValue for future reference
30+
// This is a simplified implementation; a proper parser would be more complex
31+
if let nameRange = rawValue.range(
32+
of: "@color-profile\\s+(--[\\w-]+|device-cmyk)\\s*\\{",
33+
options: .regularExpression
34+
) {
35+
let nameString = String(rawValue[nameRange])
36+
let parts = nameString.components(separatedBy: CharacterSet.whitespacesAndNewlines)
37+
self.name = parts.dropFirst().first ?? ""
38+
} else {
39+
self.name = ""
40+
}
4041
}
41-
}
4242

43-
/// Creates a color profile with the specified name.
44-
///
45-
/// - Parameter name: The name of the color profile. Must start with `--` or be `device-cmyk`.
46-
public init(_ name: String) {
47-
self.name = name
48-
self.rawValue = "@color-profile \(name) {}"
49-
}
43+
/// Creates a color profile with the specified name.
44+
///
45+
/// - Parameter name: The name of the color profile. Must start with `--` or be `device-cmyk`.
46+
public init(_ name: String) {
47+
self.name = name
48+
self.rawValue = "@color-profile \(name) {}"
49+
}
5050

51-
/// Predefined device-cmyk color profile.
52-
public static let deviceCMYK = ColorProfile("device-cmyk")
51+
/// Predefined device-cmyk color profile.
52+
public static let deviceCMYK = ColorProfile("device-cmyk")
5353

54-
/// Sets the source URL for the color profile.
55-
///
56-
/// - Parameter url: The URL to retrieve the color profile information from.
57-
/// - Returns: An updated ColorProfile instance.
58-
public func src(_ url: String) -> ColorProfile {
59-
var profile = self
60-
profile.descriptors["src"] = "url(\"\(url)\")"
61-
profile.updateRawValue()
62-
return profile
63-
}
54+
/// Sets the source URL for the color profile.
55+
///
56+
/// - Parameter url: The URL to retrieve the color profile information from.
57+
/// - Returns: An updated ColorProfile instance.
58+
public func src(_ url: String) -> ColorProfile {
59+
var profile = self
60+
profile.descriptors["src"] = "url(\"\(url)\")"
61+
profile.updateRawValue()
62+
return profile
63+
}
6464

65-
/// Sets the rendering intent for the color profile.
66-
///
67-
/// - Parameter intent: The rendering intent to use.
68-
/// - Returns: An updated ColorProfile instance.
69-
public func renderingIntent(_ intent: RenderingIntent) -> ColorProfile {
70-
var profile = self
71-
profile.descriptors["rendering-intent"] = intent.rawValue
72-
profile.updateRawValue()
73-
return profile
74-
}
65+
/// Sets the rendering intent for the color profile.
66+
///
67+
/// - Parameter intent: The rendering intent to use.
68+
/// - Returns: An updated ColorProfile instance.
69+
public func renderingIntent(_ intent: RenderingIntent) -> ColorProfile {
70+
var profile = self
71+
profile.descriptors["rendering-intent"] = intent.rawValue
72+
profile.updateRawValue()
73+
return profile
74+
}
7575

76-
/// Updates the raw value based on the current descriptors.
77-
private mutating func updateRawValue() {
78-
let descriptorString = descriptors.map { key, value in
79-
" \(key): \(value);"
80-
}.joined(separator: "\n")
76+
/// Updates the raw value based on the current descriptors.
77+
private mutating func updateRawValue() {
78+
let descriptorString = descriptors.map { key, value in
79+
" \(key): \(value);"
80+
}.joined(separator: "\n")
8181

82-
if descriptorString.isEmpty {
83-
rawValue = "@color-profile \(name) {}"
84-
} else {
85-
rawValue = "@color-profile \(name) {\n\(descriptorString)\n}"
82+
if descriptorString.isEmpty {
83+
rawValue = "@color-profile \(name) {}"
84+
} else {
85+
rawValue = "@color-profile \(name) {\n\(descriptorString)\n}"
86+
}
8687
}
87-
}
8888
}
8989

9090
extension ColorProfile {
91-
/// Represents rendering intent options for color profiles.
92-
public enum RenderingIntent: String, Hashable, Sendable {
93-
/// Media-relative colorimetric intent.
94-
case relativeColorimetric = "relative-colorimetric"
91+
/// Represents rendering intent options for color profiles.
92+
public enum RenderingIntent: String, Hashable, Sendable {
93+
/// Media-relative colorimetric intent.
94+
case relativeColorimetric = "relative-colorimetric"
9595

96-
/// ICC-absolute colorimetric intent.
97-
case absoluteColorimetric = "absolute-colorimetric"
96+
/// ICC-absolute colorimetric intent.
97+
case absoluteColorimetric = "absolute-colorimetric"
9898

99-
/// Perceptual rendering intent, often preferred for images.
100-
case perceptual
99+
/// Perceptual rendering intent, often preferred for images.
100+
case perceptual
101101

102-
/// Saturation rendering intent, preserves relative saturation.
103-
case saturation
104-
}
102+
/// Saturation rendering intent, preserves relative saturation.
103+
case saturation
104+
}
105105
}

0 commit comments

Comments
 (0)