Skip to content

Commit 7229749

Browse files
coenttbgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent abf0153 commit 7229749

File tree

699 files changed

+41545
-40812
lines changed

Some content is hidden

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

699 files changed

+41545
-40812
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 & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -18,85 +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(of: "@color-profile\\s+(--[\\w-]+|device-cmyk)\\s*\\{", options: .regularExpression) {
32-
let nameString = String(rawValue[nameRange])
33-
let parts = nameString.components(separatedBy: CharacterSet.whitespacesAndNewlines)
34-
self.name = parts.dropFirst().first ?? ""
35-
} else {
36-
self.name = ""
37-
}
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 = ""
3840
}
41+
}
3942

40-
/// Creates a color profile with the specified name.
41-
///
42-
/// - Parameter name: The name of the color profile. Must start with `--` or be `device-cmyk`.
43-
public init(_ name: String) {
44-
self.name = name
45-
self.rawValue = "@color-profile \(name) {}"
46-
}
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+
}
4750

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

51-
/// Sets the source URL for the color profile.
52-
///
53-
/// - Parameter url: The URL to retrieve the color profile information from.
54-
/// - Returns: An updated ColorProfile instance.
55-
public func src(_ url: String) -> ColorProfile {
56-
var profile = self
57-
profile.descriptors["src"] = "url(\"\(url)\")"
58-
profile.updateRawValue()
59-
return profile
60-
}
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+
}
6164

62-
/// Sets the rendering intent for the color profile.
63-
///
64-
/// - Parameter intent: The rendering intent to use.
65-
/// - Returns: An updated ColorProfile instance.
66-
public func renderingIntent(_ intent: RenderingIntent) -> ColorProfile {
67-
var profile = self
68-
profile.descriptors["rendering-intent"] = intent.rawValue
69-
profile.updateRawValue()
70-
return profile
71-
}
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+
}
7275

73-
/// Updates the raw value based on the current descriptors.
74-
private mutating func updateRawValue() {
75-
let descriptorString = descriptors.map { key, value in
76-
" \(key): \(value);"
77-
}.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")
7881

79-
if descriptorString.isEmpty {
80-
rawValue = "@color-profile \(name) {}"
81-
} else {
82-
rawValue = "@color-profile \(name) {\n\(descriptorString)\n}"
83-
}
82+
if descriptorString.isEmpty {
83+
rawValue = "@color-profile \(name) {}"
84+
} else {
85+
rawValue = "@color-profile \(name) {\n\(descriptorString)\n}"
8486
}
87+
}
8588
}
8689

8790
extension ColorProfile {
88-
/// Represents rendering intent options for color profiles.
89-
public enum RenderingIntent: String, Hashable, Sendable {
90-
/// Media-relative colorimetric intent.
91-
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"
9295

93-
/// ICC-absolute colorimetric intent.
94-
case absoluteColorimetric = "absolute-colorimetric"
96+
/// ICC-absolute colorimetric intent.
97+
case absoluteColorimetric = "absolute-colorimetric"
9598

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

99-
/// Saturation rendering intent, preserves relative saturation.
100-
case saturation
101-
}
102+
/// Saturation rendering intent, preserves relative saturation.
103+
case saturation
104+
}
102105
}

0 commit comments

Comments
 (0)