Skip to content

Commit d6a590c

Browse files
committed
Update dependencies and fix lint violations
- Update swift-incits-4-1986 to 0.6.0 and swift-rfc-1123 to 0.4.0 - Remove commented-out String+RFC_5321.swift - Fix opening brace position
1 parent a230305 commit d6a590c

File tree

7 files changed

+36
-126
lines changed

7 files changed

+36
-126
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ Thumbs.db
2323
!CODE_OF_CONDUCT.md
2424
!SECURITY.md
2525
!**/*.docc/**/*.md
26+
27+
28+
# SwiftLint Remote Config Cache
29+
.swiftlint/RemoteConfigCache

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ let package = Package(
1414
.library(name: "RFC 5321", targets: ["RFC 5321"]),
1515
],
1616
dependencies: [
17-
.package(url: "https://github.com/swift-standards/swift-incits-4-1986.git", from: "0.1.0"),
18-
.package(url: "https://github.com/swift-standards/swift-rfc-1123.git", from: "0.3.1")
17+
.package(url: "https://github.com/swift-standards/swift-incits-4-1986.git", from: "0.6.0"),
18+
.package(url: "https://github.com/swift-standards/swift-rfc-1123.git", from: "0.4.0")
1919
],
2020
targets: [
2121
.target(

Sources/RFC 5321/RFC_5321.EmailAddress.Error.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
//
1616
// EmailAddress-level validation errors
1717

18-
import Standards
1918
public import RFC_1123
19+
import Standards
2020

2121
extension RFC_5321.EmailAddress {
2222
/// Errors that can occur during email address validation

Sources/RFC 5321/RFC_5321.EmailAddress.LocalPart.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// LocalPart implementation with canonical byte storage
66
//
77

8-
import Standards
98
import INCITS_4_1986
9+
import Standards
1010

1111
extension RFC_5321.EmailAddress {
1212
/// RFC 5321 compliant local-part
@@ -69,8 +69,8 @@ extension RFC_5321.EmailAddress {
6969
// MARK: - Format
7070

7171
private enum Format: Hashable, Codable {
72-
case dotAtom // Regular unquoted format
73-
case quoted // Quoted string format
72+
case dotAtom // Regular unquoted format
73+
case quoted // Quoted string format
7474
}
7575
}
7676
}
@@ -169,26 +169,26 @@ extension RFC_5321.EmailAddress.LocalPart: UInt8.ASCII.Serializable {
169169
var index = bytes.startIndex
170170

171171
for byte in bytes {
172-
let isAtext = byte.ascii.isLetter || byte.ascii.isDigit ||
173-
byte == 0x21 || // !
174-
byte == 0x23 || // #
175-
byte == 0x24 || // $
176-
byte == 0x25 || // %
177-
byte == 0x26 || // &
178-
byte == 0x27 || // '
179-
byte == 0x2A || // *
180-
byte == 0x2B || // +
181-
byte == 0x2D || // -
182-
byte == 0x2F || // /
183-
byte == 0x3D || // =
184-
byte == 0x3F || // ?
185-
byte == 0x5E || // ^
186-
byte == 0x5F || // _
187-
byte == 0x60 || // `
188-
byte == 0x7B || // {
189-
byte == 0x7C || // |
190-
byte == 0x7D || // }
191-
byte == 0x7E // ~
172+
let isAtext =
173+
byte.ascii.isLetter || byte.ascii.isDigit || byte == 0x21 // !
174+
|| byte == 0x23 // #
175+
|| byte == 0x24 // $
176+
|| byte == 0x25 // %
177+
|| byte == 0x26 // &
178+
|| byte == 0x27 // '
179+
|| byte == 0x2A // *
180+
|| byte == 0x2B // +
181+
|| byte == 0x2D // -
182+
|| byte == 0x2F // /
183+
|| byte == 0x3D // =
184+
|| byte == 0x3F // ?
185+
|| byte == 0x5E // ^
186+
|| byte == 0x5F // _
187+
|| byte == 0x60 // `
188+
|| byte == 0x7B // {
189+
|| byte == 0x7C // |
190+
|| byte == 0x7D // }
191+
|| byte == 0x7E // ~
192192

193193
let isDot = byte == .ascii.period
194194

Sources/RFC 5321/RFC_5321.EmailAddress.swift

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// EmailAddress implementation
66
//
77

8-
import Standards
98
import INCITS_4_1986
109
public import RFC_1123
10+
import Standards
1111

1212
extension RFC_5321 {
1313
/// RFC 5321 compliant email address (basic SMTP format)
@@ -75,22 +75,6 @@ extension RFC_5321 {
7575
}
7676
}
7777

78-
//// MARK: - Convenience Initializers
79-
//
80-
//extension RFC_5321.EmailAddress {
81-
// /// Initialize from string representation ("Name <local@domain>" or "local@domain")
82-
// ///
83-
// /// Convenience initializer that converts String to bytes and delegates to byte parser.
84-
// ///
85-
// /// String parsing is derived composition:
86-
// /// ```
87-
// /// String → [UInt8] (UTF-8) → EmailAddress
88-
// /// ```
89-
// public init(_ string: some StringProtocol) throws(Error) {
90-
// try self.init(ascii: Array(string.utf8))
91-
// }
92-
//}
93-
9478
// MARK: - Byte-Level Parsing (UInt8.ASCII.Serializable)
9579

9680
extension RFC_5321.EmailAddress: UInt8.ASCII.Serializable {
@@ -124,8 +108,8 @@ extension RFC_5321.EmailAddress: UInt8.ASCII.Serializable {
124108
guard !bytes.isEmpty else { throw Error.missingAtSign }
125109

126110
// Check for angle bracket format: [display-name] <local@domain>
127-
if let openAngle = bytes.firstIndex(where: { $0 == 0x3C }), // <
128-
let closeAngle = bytes.firstIndex(where: { $0 == 0x3E }) { // >
111+
if let openAngle = bytes.firstIndex(where: { $0 == 0x3C }), // <
112+
let closeAngle = bytes.firstIndex(where: { $0 == 0x3E }) { // >
129113

130114
// Extract display name if present
131115
let displayName: String?
@@ -271,4 +255,4 @@ extension RFC_5321.EmailAddress {
271255
}
272256

273257
// MARK: - Protocol Conformances
274-
extension RFC_5321.EmailAddress: CustomStringConvertible { }
258+
extension RFC_5321.EmailAddress: CustomStringConvertible {}

Sources/RFC 5321/String+RFC_5321.swift

Lines changed: 0 additions & 78 deletions
This file was deleted.

Tests/RFC 5321 Tests/RFC 5321 Tests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Created by Coen ten Thije Boonkkamp on 28/12/2024.
66
//
77

8-
import RFC_5321
9-
import RFC_1123
108
import Foundation
9+
import RFC_1123
10+
import RFC_5321
1111
import Testing
1212

1313
@Suite

0 commit comments

Comments
 (0)