Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/periphery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Periphery

on:
push:
branches: [main]
pull_request:

jobs:
periphery:
name: Run Periphery
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- uses: SwiftyLab/setup-swift@latest
with:
swift-version: "6.2"
- name: Install Periphery
run: brew install periphery
- name: Run Periphery
run: periphery scan
1 change: 1 addition & 0 deletions .periphery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
retain_public: true
3 changes: 0 additions & 3 deletions Sources/SwiftCIFP/CIFP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ import Foundation
/// use ``linked()`` to create a ``CIFPData`` actor.
public struct CIFP: Sendable, Codable {

/// Estimated number of records for pre-allocation.
private static let estimatedRecordCount = 400_000

/// The file header information.
public let header: Header

Expand Down
14 changes: 0 additions & 14 deletions Sources/SwiftCIFP/Parser/CIFPByteParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,6 @@ struct ApproachContinuationRecord: Sendable {

/// Parser for CIFP fixed-width records.
struct CIFPByteParser: Sendable {
/// Standard CIFP record length.
static let recordLength = 132

/// Common field positions (0-indexed).
private static let fields = (
recordType: 0..<1,
customerArea: 1..<4,
sectionCode: 4..<6,
airportIdent: 6..<10,
icaoRegion: 10..<12,
fileRecordNumber: 123..<128,
cycleDate: 128..<132
)

/// Parse a single record line.
static func parseRecord(
_ bytes: ArraySlice<UInt8>,
Expand Down
12 changes: 0 additions & 12 deletions Sources/SwiftCIFP/Types/BearingRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,6 @@ extension BearingRange {
public static var fullCircle: BearingRange {
BearingRange(from: 0, to: 360)
}

/// Creates a bearing range from a standard Range.
init(_ range: Range<Double>) {
self.init(from: range.lowerBound, to: range.upperBound)
}

/// Creates a bearing range from a ClosedRange.
///
/// Note: The upper bound is treated as exclusive for consistency.
init(_ range: ClosedRange<Double>) {
self.init(from: range.lowerBound, to: range.upperBound)
}
}

// MARK: - Measurement Support
Expand Down
13 changes: 0 additions & 13 deletions Sources/SwiftCIFP/Types/ByteInitializable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,3 @@ extension ByteInitializable {
self.init(rawValue: Character(UnicodeScalar(byte)))
}
}

/// Protocol for String-based enums that can be initialized from ASCII bytes.
protocol StringByteInitializable: RawRepresentable where RawValue == String {
init?(bytes: some RandomAccessCollection<UInt8>)
}

extension StringByteInitializable {
/// Initialize from ASCII bytes.
init?(bytes: some RandomAccessCollection<UInt8>) {
guard let string = String(bytes: Array(bytes), encoding: .utf8) else { return nil }
self.init(rawValue: string.trimmingCharacters(in: .whitespaces))
}
}
26 changes: 0 additions & 26 deletions Sources/SwiftCIFP/Types/Common/RecordType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,3 @@ enum RecordType: Character, Sendable, Codable, CaseIterable, ByteInitializable {
/// Tailored record.
case tailored = "T"
}

/// Customer/area code (positions 2-4).
enum CustomerAreaCode: String, Sendable, Codable, CaseIterable {
/// United States.
case usa = "USA"

/// Canada.
case canada = "CAN"

/// Pacific.
case pacific = "PAC"

/// Continuation record (blank).
case continuation = " "

/// Initialize from bytes, handling the "S " pattern for continuation records.
init?<T: RandomAccessCollection>(bytes: T) where T.Element == UInt8, T.Index == Int {
let str = bytes.toString()
if str.isEmpty {
self = .continuation
} else {
guard let code = Self(rawValue: str) else { return nil }
self = code
}
}
}