Skip to content

Commit d1f6d21

Browse files
committed
Add shared SwiftLint configuration
Inherit SwiftLint rules from the parent swift-standards repository.
1 parent d94d5d5 commit d1f6d21

File tree

3 files changed

+8
-51
lines changed

3 files changed

+8
-51
lines changed

.swiftlint.yml

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,7 @@
1-
disabled_rules:
2-
- line_length
3-
- identifier_name
4-
- nesting
5-
- type_name
6-
- explicit_enum_raw_value
7-
- file_length
8-
- function_body_length
9-
- redundant_discardable_let # Preserve 'let _ =' in result builder contexts (required for Swift 6.0+)
1+
# SwiftLint configuration for swift-rfc-1123
2+
# Inherits from the shared parent configuration in swift-standards
103

11-
opt_in_rules:
12-
- empty_count
13-
- explicit_init
14-
- sorted_imports
15-
- force_cast
16-
- force_try
17-
- closure_spacing
18-
- operator_usage_whitespace
19-
- private_outlet
20-
- redundant_nil_coalescing
21-
- empty_string
22-
- literal_expression_end_indentation
23-
- single_test_class
24-
- sorted_first_last
25-
- vertical_whitespace
26-
- strict_fileprivate
27-
- legacy_random
28-
- no_extension_access_modifier
29-
- colon
30-
- trailing_comma
31-
32-
included:
33-
- Package.swift
34-
- Sources
35-
- Tests
4+
parent_config: https://raw.githubusercontent.com/swift-standards/swift-standards/main/.swiftlint.yml
365

37-
excluded:
38-
- Carthage
39-
- Pods
40-
- fastlane
41-
- build
42-
43-
analyzer_rules:
44-
- unused_import
45-
46-
colon:
47-
apply_to_dictionaries: true
48-
49-
vertical_whitespace:
50-
max_empty_lines: 1
6+
# Package-specific overrides (if needed)
7+
# Add any swift-rfc-1123 specific rules here

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let package = Package(
2525
.library(name: .rfc1123, targets: [.rfc1123]),
2626
],
2727
dependencies: [
28-
.package(url: "https://github.com/swift-standards/swift-rfc-1035", from: "0.1.0"),
28+
.package(url: "https://github.com/swift-standards/swift-rfc-1035.git", from: "0.1.0"),
2929
.package(url: "https://github.com/swift-standards/swift-standards.git", from: "0.1.0"),
3030
.package(url: "https://github.com/swift-standards/swift-incits-4-1986.git", from: "0.1.0"),
3131
],

Sources/RFC 1123/RFC_1123.Domain.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ extension RFC_1123.Domain {
9292
/// Initialize from bytes representation
9393
///
9494
/// Convenience initializer that decodes bytes as UTF-8 and validates.
95-
public init(_ bytes: [UInt8]) throws(Error) {
95+
public init(ascii bytes: [UInt8]) throws(Error) {
9696
// Decode bytes as UTF-8 and validate
9797
let string = String(decoding: bytes, as: UTF8.self)
9898
try self.init(string)
@@ -145,7 +145,7 @@ extension RFC_1123.Domain {
145145
}
146146

147147
/// Initialize a label from bytes, validating RFC 1123 rules
148-
internal init(_ bytes: [UInt8], validateAs type: ValidationType) throws(Error) {
148+
internal init(ascii bytes: [UInt8], validateAs type: ValidationType) throws(Error) {
149149
// Decode bytes as UTF-8 and validate
150150
let string = String(decoding: bytes, as: UTF8.self)
151151
try self.init(string, validateAs: type)

0 commit comments

Comments
 (0)