Refactor file organization for improved maintainability#38
Conversation
Split large test and source files into focused, maintainable units: **AppStorageDateTests Split:** - Created enum-based test suite pattern with extensions - Separated non-optional date tests into AppStorageDateTests+NonOptional.swift - Separated optional date tests into AppStorageDateTests+Optional.swift - Main file now contains enum namespace and shared test helper types - All 7 tests organized into 2 logical suites with @suite attributes **ObservableDownloader Split:** - Extracted internal implementation helpers to ObservableDownloader+Internal.swift - Main file focuses on public API and core class definition - Improved separation of concerns while maintaining functionality **DevContainer Updates:** - Added Swift 6.2 and 6.3 devcontainer configurations - Updated existing devcontainer images to stable releases - Improved container naming for clarity All changes verified with swift test (7/7 tests passing) and lint checks (0 violations). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughUpdates devcontainer configs for Swift 6.x, upgrades formatting/lint tooling, expands InitializablePackageOptions API, reorganizes ObservableDownloader download event handling, adds progress formatting utility and AppStorage Date tests, and applies widespread documentation/formatting tweaks across RadiantKit and RadiantProgress. Changes
Sequence Diagram(s)sequenceDiagram
participant URLSession as URLSession
participant DownloadDelegate as DownloadDelegate
participant ObservableDownloader as ObservableDownloader
participant Subjects as Subjects (location/resume/progress)
Note over URLSession,DownloadDelegate: Download lifecycle (changed parameter labels)
URLSession->>DownloadDelegate: didFinishDownloadingTo(location)
DownloadDelegate->>ObservableDownloader: forward finishedDownloadingToAsync(location)
ObservableDownloader->>Subjects: locationURLSubject.send(location)
URLSession->>DownloadDelegate: didWriteData(...)
DownloadDelegate->>ObservableDownloader: forward progressUpdatedAsync(progress)
ObservableDownloader->>Subjects: downloadUpdate.send(progress)
URLSession->>DownloadDelegate: didCompleteWithError(error?)
DownloadDelegate->>ObservableDownloader: didCompleteAsync(withError)
ObservableDownloader->>Subjects: resumeDataSubject.send(resumeData?) / completion
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
========================================
+ Coverage 3.66% 3.71% +0.05%
========================================
Files 24 24
Lines 355 404 +49
========================================
+ Hits 13 15 +2
- Misses 342 389 +47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code Review - PR #38: Refactor file organization for improved maintainabilityI've completed a thorough review of this PR. Overall, this is a well-structured refactoring that improves code organization and maintainability. Here's my detailed feedback: ✅ Strengths1. Excellent Test OrganizationThe split of
2. Good Separation of ConcernsThe
3. DevContainer Improvements
🔍 Code Quality ObservationsTooling Configuration Changesswift-format changes (
SwiftLint changes (
Code Formatting ChangesThe diff shows many files with reformatted code (indentation, line breaks, spacing). Examples:
Recommendation: These formatting changes, while consistent with the new config, make code review more difficult. Future PRs should separate:
🎯 Specific FeedbackTest FilesAppStorageDateTests split (
ObservableDownloader SplitObservableDownloader.swift + ObservableDownloader+Internal.swift:
Documentation UpdatesMultiple files show improved parameter documentation formatting:
🔒 Security & Concurrency
📊 Test CoveragePer the PR description:
Note: I cannot verify CI status without running checks, but the PR indicates all checks pass. 🎨 Best Practices AlignmentComparing against
📝 RecommendationsHigh Priority
Medium Priority
Low Priority
✅ Final VerdictApproved with minor recommendations This PR successfully improves code organization and maintainability. The test file split follows best practices, and the The code quality is high, concurrency safety is maintained, and the new lint rules (especially Great work on this refactoring! 🚀 |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Sources/RadiantProgress/ProgressOperation.swift (1)
46-57: Critical: Division by zero when totalValue is zero.The function doesn't handle the case where
totalValueis0(but notnil). This will causeratioValueto beinfinityorNaN, whichNumberFormatterwill convert to an unexpected string representation rather than a meaningful percentage.🐛 Proposed fix to handle zero totalValue
public func percentValue(withFractionDigits fractionDigits: Int = 0) -> String? { - guard let totalValue else { + guard let totalValue, totalValue > 0 else { return nil } let formatter = NumberFormatter() formatter.maximumFractionDigits = fractionDigits formatter.minimumFractionDigits = fractionDigits let ratioValue = Double(currentValue) / Double(totalValue) * 100.0 let string = formatter.string(from: .init(value: ratioValue)) assert(string != nil) return string }
🤖 Fix all issues with AI agents
In @Mintfile:
- Around line 1-3: Update CI/tooling and config to account for the upgraded
Mintfile deps: ensure the Xcode/swift toolchain is Swift 6+ before upgrading
swift-format to 602.0.0 and SwiftLint to 0.62.2, update .swiftlint.yml to handle
the changed sorted_imports behavior and add/opt-out
incompatible_concurrency_annotation if you must support older concurrency
semantics, and test/rerun swift-format to verify import ordering; for periphery
3.2.0 remove usages of the removed flags (--targets, --workspace) in any scripts
or CI and switch installation method away from CocoaPods if used (use
brew/mint), then run the full lint and periphery analysis with the new versions
and confirm the project still reports 0 violations, adjusting configs or code
until it does.
In @Sources/RadiantKit/AppKit/NSWindowAdaptorModifier.swift:
- Around line 55-56: Remove the orphaned documentation dash from the SwiftDoc
comment above the NSWindowAdaptorModifier declaration: delete the stray line
containing only "/// -" so the doc comment reads cleanly (e.g., keep "/// -
Parameter _: The context provided by the SwiftUI framework." and remove the
incomplete trailing bullet).
In @Sources/RadiantProgress/ObserverContainer.swift:
- Line 32: The property modifier order on the DownloadObserver property is
incorrect; change the declaration of the `observer` property from
`nonisolated(unsafe) private var observer: DownloadObserver?` to put the access
control first by using `private nonisolated(unsafe) var observer:
DownloadObserver?` so it conforms to Swift conventions and the project's
`modifier_order` SwiftLint rule; update the `observer` declaration in
ObserverContainer (the `observer` property) accordingly.
🧹 Nitpick comments (5)
Sources/RadiantKit/AppKit/NSWindowAdaptorModifier.swift (1)
114-115: Consider normalizing the spacing on line 115.The extra spacing before "does nothing" on line 115 is inconsistent with typical documentation formatting. This is a minor nitpick.
📝 Proposed fix
/// Adds a no-op `nsWindowAdaptor` modifier to the `View`. -/// - Parameter _: A closure that will be called with `Any?`, but -/// does nothing. +/// - Parameter _: A closure that will be called with `Any?`, but does nothing. /// - Returns: The original `View`. public func nsWindowAdaptor(_: @escaping (Any?) -> Void) -> some View { self }Sources/RadiantProgress/DownloadDelegate.swift (1)
82-97: Consider marking unusedbytesWrittenparameter with_for consistency.The
bytesWrittenparameter is not used in the function body (onlytotalBytesWrittenandtotalBytesExpectedToWriteare used). For consistency with the pattern applied todownloadTaskandtaskparameters, consider using_as the internal name.♻️ Proposed refactor for consistency
internal func urlSession( _ session: URLSession, downloadTask _: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, + didWriteData _: Int64, totalBytesWritten: Int64, totalBytesExpectedToWrite: Int64 ) {Update the corresponding doc comment:
/// - Parameters: /// - session: The URL session that initiated the download task. /// - _: The download task that is reporting progress. - /// - bytesWritten: The amount of data that has been written to the file. + /// - _: The amount of data that has been written since the last progress update. /// - totalBytesWritten: The total number of bytes written to the file so far. /// - totalBytesExpectedToWrite: The total number of bytes expected to be /// written to the file..devcontainer/swift-6.3/devcontainer.json (1)
3-3: Nightly image may be unstable.Using
swiftlang/swift:nightly-6.3-jammyis appropriate for early testing, but nightly builds can introduce breaking changes. Consider documenting this in the container name or README so developers understand the stability expectations.Sources/RadiantProgress/ObservableDownloader+Internal.swift (2)
39-42: Consider consistent nil-handling forcompletion.The
assert(completion != nil)followed by optional chaining (completion?(result)) creates inconsistent behavior between debug and release builds. Ifcompletionmust always be non-nil at this point, use a force unwrap or precondition; if it's legitimately optional, remove the assertion.♻️ Suggested alternatives
Option 1: If completion must exist (use precondition):
- assert(completion != nil) - completion?(result) + guard let completion else { + preconditionFailure("completion must be set before calling onCompletion") + } + completion(result)Option 2: If completion is legitimately optional (remove assertion):
- assert(completion != nil) completion?(result)
52-56: Clarify the success case comment.The comment "Handle success case" is misleading since the method simply returns early when there's no error. Consider clarifying that no action is needed on success.
📝 Suggested comment improvement
internal func didCompleteAsync(withError error: (any Error)?) { guard let error else { - // Handle success case. + // No action needed on success. return }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (45)
.devcontainer/devcontainer.json.devcontainer/swift-6.0/devcontainer.json.devcontainer/swift-6.1/devcontainer.json.devcontainer/swift-6.2/devcontainer.json.devcontainer/swift-6.3/devcontainer.json.swift-format.swiftlint.ymlMintfileSources/RadiantDocs/CodablePackageDocument.swiftSources/RadiantDocs/Primitives/FileType.swiftSources/RadiantDocs/Primitives/InitializablePackage.swiftSources/RadiantDocs/Primitives/InitializablePackageOptions.swiftSources/RadiantDocs/UTType.swiftSources/RadiantKit/AppKit/NSWindowAdaptorModifier.swiftSources/RadiantKit/Color.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+AppStored.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+DefaultWrapped.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+ExpressibleByNilLiteral.swiftSources/RadiantKit/PropertyWrappers/AppStored.swiftSources/RadiantKit/TransformedValueObject.swiftSources/RadiantKit/URLImage.swiftSources/RadiantKit/ViewExtensions/IdentifiableViewBuilder.swiftSources/RadiantKit/Views/Button.swiftSources/RadiantKit/Views/GuidedLabeledContent.swiftSources/RadiantKit/Views/GuidedLabeledContentDescriptionView.swiftSources/RadiantKit/Views/PreferredLayout.swiftSources/RadiantKit/Views/SliderStepperView.swiftSources/RadiantKit/Views/ValueTextBubble.swiftSources/RadiantKit/Views/Video.swiftSources/RadiantPaging/ContainerView.swiftSources/RadiantPaging/PageView.swiftSources/RadiantProgress/CopyOperation.swiftSources/RadiantProgress/DownloadDelegate.swiftSources/RadiantProgress/DownloadOperation.swiftSources/RadiantProgress/Downloader.swiftSources/RadiantProgress/FileOperationProgress.swiftSources/RadiantProgress/ObservableDownloader+Internal.swiftSources/RadiantProgress/ObservableDownloader.swiftSources/RadiantProgress/ObserverContainer.swiftSources/RadiantProgress/PreviewOperation.swiftSources/RadiantProgress/ProgressOperation.swiftSources/RadiantProgress/ProgressOperationView.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests+Optional.swiftTests/RadiantKitTests/AppStorageDateTests.swift
💤 Files with no reviewable changes (1)
- Sources/RadiantProgress/PreviewOperation.swift
🧰 Additional context used
📓 Path-based instructions (5)
**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.swift: All Swift source files require copyright headers managed byScripts/header.sh
Use swift-format (v600.0.0) with configuration in.swift-formatfor code formatting
Use SwiftLint (v0.58.0) with rules defined in.swiftlint.ymlfor Swift style validation
All UI components must be isolated with the@MainActorattribute
Closures crossing actor boundaries must be marked as@Sendable
Usenonisolatedsparingly and only when necessary in actor-isolated code
Use protocol names as descriptive nouns (e.g., CodablePackage, ProgressOperation, FileTypeSpecification) for protocol definitions
Use full words for generic type parameters (e.g., FileType, ValueType) instead of single letters
Follow the environment key naming pattern:<Action>Key(e.g., NextPageKey, PreviousPageKey, CancelPageKey) for SwiftUI EnvironmentKey definitions
Use#if canImport()or#if os()directives for platform-specific code
Implement strict concurrency checking with Sendable conformance requirements throughout the codebase
Use the@Observablemacro for iOS 17+ reactive state management in observable types
Use property wrappers@AppStoredand@DefaultWrappedfor persistent storage patterns
Code must be compatible with strict concurrency checking and Sendable requirements across all platforms
Files:
Sources/RadiantProgress/ProgressOperation.swiftSources/RadiantKit/Views/PreferredLayout.swiftSources/RadiantKit/TransformedValueObject.swiftSources/RadiantDocs/CodablePackageDocument.swiftSources/RadiantDocs/UTType.swiftSources/RadiantKit/Views/Button.swiftSources/RadiantKit/Views/GuidedLabeledContentDescriptionView.swiftSources/RadiantKit/Views/GuidedLabeledContent.swiftSources/RadiantKit/AppKit/NSWindowAdaptorModifier.swiftSources/RadiantDocs/Primitives/InitializablePackage.swiftTests/RadiantKitTests/AppStorageDateTests+Optional.swiftSources/RadiantProgress/ObservableDownloader+Internal.swiftSources/RadiantProgress/Downloader.swiftSources/RadiantKit/Views/ValueTextBubble.swiftSources/RadiantKit/ViewExtensions/IdentifiableViewBuilder.swiftSources/RadiantProgress/ProgressOperationView.swiftSources/RadiantPaging/PageView.swiftSources/RadiantDocs/Primitives/FileType.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftSources/RadiantKit/URLImage.swiftSources/RadiantProgress/FileOperationProgress.swiftSources/RadiantKit/PropertyWrappers/AppStored.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+AppStored.swiftSources/RadiantProgress/CopyOperation.swiftSources/RadiantKit/Color.swiftSources/RadiantProgress/ObservableDownloader.swiftSources/RadiantPaging/ContainerView.swiftTests/RadiantKitTests/AppStorageDateTests.swiftSources/RadiantKit/Views/Video.swiftSources/RadiantProgress/DownloadOperation.swiftSources/RadiantDocs/Primitives/InitializablePackageOptions.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+DefaultWrapped.swiftSources/RadiantKit/Views/SliderStepperView.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+ExpressibleByNilLiteral.swiftSources/RadiantProgress/DownloadDelegate.swiftSources/RadiantProgress/ObserverContainer.swift
**/RadiantProgress/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
**/RadiantProgress/**/*.swift: UseProgressOperation<ValueType: BinaryInteger & Sendable>for flexible progress reporting in RadiantProgress module
RadiantProgress module should use swift-log for Linux compatibility when reporting progress
Files:
Sources/RadiantProgress/ProgressOperation.swiftSources/RadiantProgress/ObservableDownloader+Internal.swiftSources/RadiantProgress/Downloader.swiftSources/RadiantProgress/ProgressOperationView.swiftSources/RadiantProgress/FileOperationProgress.swiftSources/RadiantProgress/CopyOperation.swiftSources/RadiantProgress/ObservableDownloader.swiftSources/RadiantProgress/DownloadOperation.swiftSources/RadiantProgress/DownloadDelegate.swiftSources/RadiantProgress/ObserverContainer.swift
**/RadiantDocs/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
Use
DocumentFile<FileType: FileTypeSpecification>for type-safe file handling in RadiantDocs module
Files:
Sources/RadiantDocs/CodablePackageDocument.swiftSources/RadiantDocs/UTType.swiftSources/RadiantDocs/Primitives/InitializablePackage.swiftSources/RadiantDocs/Primitives/FileType.swiftSources/RadiantDocs/Primitives/InitializablePackageOptions.swift
**/Tests/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
**/Tests/**/*.swift: Run tests usingswift testand filter specific tests withswift test --filter RadiantKitTests.<TestClassName>/<testMethodName>
Ensure tests pass on both macOS and Linux platforms
Files:
Tests/RadiantKitTests/AppStorageDateTests+Optional.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests.swift
**/Tests/RadiantKitTests/**/*.swift
📄 CodeRabbit inference engine (CLAUDE.md)
Add tests to
Tests/RadiantKitTests/for new features targeting the appropriate module
Files:
Tests/RadiantKitTests/AppStorageDateTests+Optional.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests.swift
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/Tests/RadiantKitTests/**/*.swift : Add tests to `Tests/RadiantKitTests/` for new features targeting the appropriate module
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to Package.swift : Build the package using Swift 6.0 or later with `swift build` command
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to Package.swift : Apply `swiftSettings` for experimental Swift 6 features to all new targets in Package.swift (AccessLevelOnImport, BitwiseCopyable, IsolatedAny, MoveOnlyPartialConsumption, NestedProtocols, NoncopyableGenerics, TransferringArgsAndResults, VariadicGenerics)
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/RadiantProgress/**/*.swift : Use `ProgressOperation<ValueType: BinaryInteger & Sendable>` for flexible progress reporting in RadiantProgress module
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/RadiantProgress/**/*.swift : Use `ProgressOperation<ValueType: BinaryInteger & Sendable>` for flexible progress reporting in RadiantProgress module
Applied to files:
Sources/RadiantProgress/ProgressOperation.swiftSources/RadiantProgress/ObservableDownloader+Internal.swiftSources/RadiantProgress/ProgressOperationView.swiftSources/RadiantProgress/FileOperationProgress.swiftSources/RadiantProgress/CopyOperation.swiftSources/RadiantProgress/DownloadOperation.swiftSources/RadiantProgress/DownloadDelegate.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/RadiantDocs/**/*.swift : Use `DocumentFile<FileType: FileTypeSpecification>` for type-safe file handling in RadiantDocs module
Applied to files:
Sources/RadiantKit/Views/PreferredLayout.swiftSources/RadiantDocs/UTType.swiftSources/RadiantKit/Views/GuidedLabeledContentDescriptionView.swiftSources/RadiantKit/AppKit/NSWindowAdaptorModifier.swiftSources/RadiantDocs/Primitives/FileType.swiftSources/RadiantProgress/FileOperationProgress.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to Package.swift : Apply `swiftSettings` for experimental Swift 6 features to all new targets in Package.swift (AccessLevelOnImport, BitwiseCopyable, IsolatedAny, MoveOnlyPartialConsumption, NestedProtocols, NoncopyableGenerics, TransferringArgsAndResults, VariadicGenerics)
Applied to files:
.devcontainer/swift-6.3/devcontainer.json.devcontainer/swift-6.2/devcontainer.json.devcontainer/swift-6.0/devcontainer.json.swiftlint.yml.devcontainer/swift-6.1/devcontainer.json.swift-formatSources/RadiantDocs/Primitives/InitializablePackageOptions.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to Package.swift : Build the package using Swift 6.0 or later with `swift build` command
Applied to files:
.devcontainer/swift-6.3/devcontainer.jsonMintfile.devcontainer/swift-6.2/devcontainer.json.devcontainer/swift-6.0/devcontainer.json.devcontainer/devcontainer.json.devcontainer/swift-6.1/devcontainer.json
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Use swift-format (v600.0.0) with configuration in `.swift-format` for code formatting
Applied to files:
Mintfile.swift-format
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Use SwiftLint (v0.58.0) with rules defined in `.swiftlint.yml` for Swift style validation
Applied to files:
Mintfile.swiftlint.yml.swift-format
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Use the lint script (`./Scripts/lint.sh`) to format code, add copyright headers, and validate against swift-format and swiftlint rules
Applied to files:
Mintfile
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Code must be compatible with strict concurrency checking and Sendable requirements across all platforms
Applied to files:
.swiftlint.yml
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Implement strict concurrency checking with Sendable conformance requirements throughout the codebase
Applied to files:
.swiftlint.yml
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/Tests/RadiantKitTests/**/*.swift : Add tests to `Tests/RadiantKitTests/` for new features targeting the appropriate module
Applied to files:
Tests/RadiantKitTests/AppStorageDateTests+Optional.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Use property wrappers `AppStored` and `DefaultWrapped` for persistent storage patterns
Applied to files:
Tests/RadiantKitTests/AppStorageDateTests+Optional.swiftTests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftSources/RadiantKit/PropertyWrappers/AppStored.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+AppStored.swiftTests/RadiantKitTests/AppStorageDateTests.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+DefaultWrapped.swiftSources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+ExpressibleByNilLiteral.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Use the `Observable` macro for iOS 17+ reactive state management in observable types
Applied to files:
Sources/RadiantProgress/ObservableDownloader+Internal.swiftSources/RadiantProgress/FileOperationProgress.swiftSources/RadiantProgress/ObserverContainer.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Use full words for generic type parameters (e.g., FileType, ValueType) instead of single letters
Applied to files:
Sources/RadiantDocs/Primitives/FileType.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/Tests/**/*.swift : Ensure tests pass on both macOS and Linux platforms
Applied to files:
Tests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests.swift
📚 Learning: 2026-01-07T01:07:59.379Z
Learnt from: CR
Repo: brightdigit/RadiantKit PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T01:07:59.379Z
Learning: Applies to **/*.swift : Follow the environment key naming pattern: `<Action>Key` (e.g., NextPageKey, PreviousPageKey, CancelPageKey) for SwiftUI EnvironmentKey definitions
Applied to files:
Sources/RadiantKit/PropertyWrappers/AppStored.swift
🧬 Code graph analysis (1)
Tests/RadiantKitTests/AppStorageDateTests+NonOptional.swift (1)
Tests/RadiantKitTests/AppStorageDateTests+Optional.swift (4)
enabled(42-70)enabled(72-99)enabled(101-133)enabled(135-163)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: claude-review
- GitHub Check: Build on macOS (watchos, macos-15, /Applications/Xcode_16.4.app, Apple Watch Ultra 2 (49mm), 11.5)
- GitHub Check: Build on macOS (macos, macos-26, /Applications/Xcode_26.2.app)
- GitHub Check: Build on macOS (ios, macos-15, /Applications/Xcode_16.4.app, iPhone 16 Pro, 18.6)
- GitHub Check: Build on macOS (visionos, macos-26, /Applications/Xcode_26.2.app, Apple Vision Pro, 26.2)
- GitHub Check: Build on macOS (watchos, macos-26, /Applications/Xcode_26.2.app, Apple Watch Ultra 3 (49mm), 26.2)
- GitHub Check: Build on Android (6.1, 28)
- GitHub Check: Build on Android (nightly-main, 34)
- GitHub Check: Build on Android (6.2, 33)
- GitHub Check: Build on Windows (windows-2025, swift-6.2-release, 6.2-RELEASE)
- GitHub Check: Build on Windows (windows-2022, swift-6.2-release, 6.2-RELEASE)
🔇 Additional comments (68)
Sources/RadiantKit/TransformedValueObject.swift (1)
110-111: Documentation formatting improvement looks good.The indentation adjustment for the
transformparameter description improves readability and aligns with Swift documentation conventions.Sources/RadiantKit/AppKit/NSWindowAdaptorModifier.swift (1)
69-70: LGTM!The documentation correctly aligns with the function signature where both parameters are intentionally unused.
Sources/RadiantKit/PropertyWrappers/AppStored.swift (1)
48-55: LGTM!The formatting adjustments to the switch cases improve readability while maintaining the existing key generation logic.
Sources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+ExpressibleByNilLiteral.swift (1)
43-52: LGTM!The documentation comment indentation and brace placement adjustments are consistently applied across all initializers, improving readability without changing functionality.
Sources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+AppStored.swift (1)
61-62: LGTM!Documentation comment formatting and brace placement adjustments are consistent with the other AppStorage extension files in this PR.
Also applies to: 189-203
Tests/RadiantKitTests/AppStorageDateTests+NonOptional.swift (3)
38-66: Well-structured test organization with proper platform guards.The test structure correctly:
- Uses
@MainActoras required by coding guidelines- Implements proper cleanup with
defer { store.removePersistentDomain(...) }- Guards for platform availability with both compile-time (
#if canImport(SwiftUI)) and runtime (#available) checks- Uses
#functionfor unique UserDefaults suite names to prevent test pollutionThe
Issue.recordcalls for unavailable platforms ensure tests report clearly rather than silently passing on Linux.
68-98: LGTM!The update test properly verifies both the
wrappedValuemutation and the underlyingUserDefaultspersistence.
100-127: LGTM!The reflecting key test validates that the
.reflectingkey type generates keys containing the type name, which is the expected behavior from theAppStoredprotocol extension.Sources/RadiantKit/PropertyWrappers/AppStorage/AppStorage+DefaultWrapped.swift (1)
41-42: LGTM!Formatting adjustments are consistent with the other AppStorage extension files in this PR.
Also applies to: 143-144
Tests/RadiantKitTests/AppStorageDateTests.swift (2)
40-58: Clean test type definitions with appropriate key types.The four test enums correctly define:
TestDateStoredandTestOptionalDateStoredwith.describingkey typeTestReflectingDateStoredandTestReflectingOptionalDateStoredwith.reflectingkey typeThis allows the test extensions to verify both key generation strategies.
62-75: Good use of enum namespace pattern for test organization.The
AppStorageDateTestsenum serves as a namespace for the test extensions in the+NonOptional.swiftand+Optional.swiftfiles. The centralizedisAppStorageDateAvailableproperty enables consistent platform gating via@Test(.enabled(if:)).Tests/RadiantKitTests/AppStorageDateTests+Optional.swift (3)
38-70: Well-structured optional date storage tests.The test suite correctly:
- Uses
@MainActoras required by coding guidelines- Verifies that optional storage starts as
nil- Tests mutation from
nilto a value and verifies underlying storage- Follows the same platform guard pattern as the non-optional tests
101-133: Comprehensive nil lifecycle testing.The
testOptionalDateSetToNiltest properly verifies the complete optional value lifecycle: initial state → set value → verify → set nil → verify both wrapper and underlying storage are nil.
135-163: LGTM!The reflecting key test for optional dates properly validates both the key generation and storage persistence, complementing the non-optional reflecting key test.
Sources/RadiantProgress/DownloadDelegate.swift (2)
49-71: LGTM! Documentation and parameter naming are clear.The updated documentation accurately reflects the parameter naming changes. Using
_for the unuseddownloadTaskparameter improves code clarity.
99-112: LGTM! Documentation and implementation are correct.The parameter naming and documentation accurately reflect the usage. The
taskparameter is appropriately marked as unused with_.Sources/RadiantDocs/Primitives/FileType.swift (1)
54-54: LGTM! Documentation formatting improved.The additional indentation aligns the parameter description consistently with SwiftDoc formatting conventions.
Sources/RadiantKit/URLImage.swift (1)
39-39: LGTM! Documentation added for View body property.The documentation comment follows standard SwiftUI conventions and improves API documentation completeness.
Sources/RadiantProgress/Downloader.swift (1)
51-52: LGTM! Documentation formatting improved.The multi-line parameter description is now properly indented for better readability.
Sources/RadiantDocs/UTType.swift (1)
59-61: LGTM! Code formatting improved for consistency.The opening brace placement aligns with swift-format conventions and improves readability of the if-let binding.
Sources/RadiantKit/Views/PreferredLayout.swift (1)
79-82: LGTM! Documentation improvements enhance API clarity.The formatting adjustments for multi-line parameter descriptions and addition of explicit
Returns:sections improve the documentation quality and follow Swift documentation conventions.Also applies to: 117-117, 129-131
.devcontainer/swift-6.0/devcontainer.json (1)
2-2: LGTM! Improved container naming for clarity.The name change from "Swift" to "Swift 6.0" provides better identification when multiple Swift version containers are available (6.0, 6.1, 6.2, 6.3 as indicated in the PR).
Sources/RadiantProgress/FileOperationProgress.swift (1)
35-35: LGTM! Public API documentation added.The documentation comment accurately describes the class's role as an observable wrapper for SwiftUI views, improving API discoverability.
Sources/RadiantKit/Views/GuidedLabeledContentDescriptionView.swift (2)
53-56: LGTM! Concise formatting improves readability.The switch cases have been reformatted to single-line expressions, making the code more concise while maintaining identical logic.
Also applies to: 61-64, 69-72
75-75: LGTM! Documentation enhancements.The addition of a view description comment and improved parameter documentation formatting enhance API clarity.
Also applies to: 86-89
Sources/RadiantKit/Views/Button.swift (1)
38-42: LGTM!Documentation parameter descriptions are properly reformatted to respect line length while maintaining clarity.
Also applies to: 52-53
Sources/RadiantKit/Views/GuidedLabeledContent.swift (1)
56-70: LGTM!Good addition of documentation for the
bodyproperty and the primary initializer. The parameter descriptions are well-formatted and provide clear guidance.Also applies to: 92-93
Sources/RadiantKit/Color.swift (1)
50-63: LGTM!Formatting cleanup improves readability. The hex color parsing logic remains correct for 3-digit (RGB 12-bit), 6-digit (RGB 24-bit), and 8-digit (ARGB 32-bit) formats.
.swift-format (2)
9-13: Configuration changes look reasonable.The disabled options (
indentSwitchCaseLabels, line break settings,BeginDocumentationCommentWithOneLineSummary) align with the formatting patterns observed in the updated source files. These provide more flexibility in code layout while maintaining consistency through other enforced rules.Also applies to: 29-29
45-45: TheNoLeadingUnderscoresrule is safe to enable and poses no compatibility issues with property wrapper usage.Property wrapper backing storage is synthesized by the compiler with leading underscores (e.g.,
_currentPageID) but does not appear in source code. Swift-format's rule only triggers on explicitly written underscore-prefixed identifiers in your source, and the codebase contains no such patterns.Likely an incorrect or invalid review comment.
Sources/RadiantKit/ViewExtensions/IdentifiableViewBuilder.swift (1)
57-60: LGTM!Formatting adjustment aligns with swift-format configuration. The result builder logic remains correct.
Sources/RadiantPaging/PageView.swift (2)
54-65: LGTM!Switch case formatting and body documentation are well-aligned with the project's updated style guidelines. The navigation availability logic correctly handles all edge cases.
Also applies to: 68-68
88-105: LGTM!Documentation parameter formatting is consistent with other files in this PR.
.devcontainer/swift-6.3/devcontainer.json (1)
5-8: Remove this comment — claim about inconsistency is incorrect.All devcontainers in this repository (swift-6.0, swift-6.1, swift-6.2, swift-6.3, and the main config) consistently use
"remoteUser": "root". The swift-6.3 configuration is not inconsistent with other devcontainers; it follows the same pattern. The mismatch between thevscodeuser created by the common-utils feature and the root remoteUser exists uniformly across all configurations and appears intentional.Likely an incorrect or invalid review comment.
.devcontainer/swift-6.1/devcontainer.json (1)
2-3: LGTM! Container configuration updated to stable release.The changes update the container to use the stable Swift 6.1 image instead of the nightly build, and improve the container name for better clarity. This aligns with the broader devcontainer standardization across Swift versions in this PR.
Sources/RadiantPaging/ContainerView.swift (2)
99-99: Documentation improvement LGTM.The added inline documentation for the
bodyproperty follows SwiftUI conventions and improves code readability.
118-119: Documentation reflow LGTM.The parameter documentation has been reflowed for better readability with no semantic changes.
Sources/RadiantProgress/CopyOperation.swift (2)
55-55: LGTM! Modifier ordering standardized.The reordering of
nonisolatedand access control modifiers (private,public) improves consistency across the codebase. This appears to be an automated formatting change from swift-format.Also applies to: 68-68, 104-104
76-77: Documentation reflow LGTM.The parameter documentation has been reflowed for improved readability with no semantic changes.
Also applies to: 80-81
Sources/RadiantKit/Views/SliderStepperView.swift (2)
72-72: Documentation improvement LGTM.The added inline documentation for the
bodyproperty follows SwiftUI conventions and improves consistency.
101-102: Documentation reflow LGTM.The parameter documentation has been reflowed for better readability with no semantic changes.
Also applies to: 106-107
Sources/RadiantProgress/ObservableDownloader.swift (3)
77-77: LGTM! Visibility change necessary for file split refactoring.Changing
completionfromprivatetointernalis appropriate given the extraction of internal helpers toObservableDownloader+Internal.swift. This allows the extension to access the completion callback.
172-172: Documentation reflow LGTM.The parameter documentation has been reflowed for improved readability with no semantic changes.
190-203: All three async methods are properly defined in the extension file.The extension file
ObservableDownloader+Internal.swiftcorrectly defines:
finishedDownloadingToAsync(_:)at line 44progressUpdatedAsync(_:)at line 48didCompleteAsync(withError:)at line 52The internal implementation helpers have been successfully extracted as intended.
Sources/RadiantKit/Views/ValueTextBubble.swift (1)
44-45: LGTM! Formatting and documentation improvements.The changes improve code consistency by standardizing where-clause formatting and adding documentation for the body property. All modifications are non-functional and align with the PR's maintainability objectives.
Also applies to: 58-58, 94-96, 113-117, 127-128
Sources/RadiantKit/Views/Video.swift (1)
52-54: LGTM! Improved parameter clarity.Renaming unused
contextparameters to_appropriately signals that these NSViewRepresentable protocol conformance parameters are not utilized in the implementation.Also applies to: 65-67
Sources/RadiantProgress/ObservableDownloader+Internal.swift (2)
44-50: LGTM! Clean forwarding implementations.The async forwarding methods for location and progress updates are straightforward and appropriate. Combine subjects handle thread-safety internally.
34-62: Integration verified: all properties and method calls are correctly implemented.All referenced properties (
locationURLSubject,downloadUpdate,resumeDataSubject,completion) are defined in the mainObservableDownloaderclass with correct types. All internal methods are properly called fromObservableDownloader.swift(lines 191-202) with appropriateTask { @MainActor in ... }wrapping for concurrency safety, andonCompletionis called fromSetupPublishers.swift. The integration is complete and functioning as expected..swiftlint.yml (2)
133-138: Excellent addition! Enforces strict concurrency safety.The
no_unchecked_sendablecustom rule directly supports the project's coding guidelines requiring strict concurrency checking. Preventing@unchecked Sendableensures proper Sendable conformance throughout the codebase.As per coding guidelines: "Implement strict concurrency checking with Sendable conformance requirements throughout the codebase."
90-92: LGTM! Improved linting configuration.The additions strengthen code quality checks:
- Analyzer rules catch unused imports and declarations
- Error-level severity for
file_nameandfatal_error_messageensures consistency- Disabled rules prevent noise in areas where the team has made intentional style choices
Also applies to: 120-132
.devcontainer/devcontainer.json (1)
3-3: Use the officialswift:6.2stable image instead of the nightly build.The change from
swiftlang/swift:nightly-6.1-jammytoswift:6.2improves build stability by using an official, stable release image from Docker Hub's library instead of a nightly build.Sources/RadiantDocs/CodablePackageDocument.swift (1)
85-87: LGTM! Formatting adjustment aligns with project style.The brace placement on a new line for the if-let binding is a formatting-only change with no functional impact.
Sources/RadiantProgress/ProgressOperationView.swift (1)
47-47: LGTM! Documentation improvement.The added documentation comment improves clarity for the public
bodyproperty.Sources/RadiantProgress/DownloadOperation.swift (5)
43-45: LGTM! ProgressOperation conformance enables flexible progress reporting.The conformance to
ProgressOperationaligns with the RadiantProgress module's pattern for flexible progress reporting.Based on learnings, this is the recommended approach for progress operations in the RadiantProgress module.
52-52: LGTM! Appropriate use of nonisolated for Sendable URL.The
nonisolatedmodifier is correctly applied to theidproperty sinceURLisSendableand immutable, making it safe for concurrent access across actor boundaries.
59-61: LGTM! totalValue property enables progress percentage calculations.The computed property correctly maps
download.totalBytesExpectedToWriteto the genericValueType, enabling progress percentage calculations via theProgressOperationprotocol.
67-74: LGTM! Documentation formatting improves readability.The improved line breaks and indentation in the parameter documentation enhance readability without changing semantic meaning.
97-97: LGTM! Documentation formatting improves consistency.The single-line documentation for the
destinationURLparameter improves consistency with the rest of the codebase.Sources/RadiantDocs/Primitives/InitializablePackage.swift (1)
52-53: LGTM! Documentation formatting adjustment.The indentation adjustment to the parameter documentation improves consistency without changing the semantic meaning.
.devcontainer/swift-6.2/devcontainer.json (1)
1-40: Swift 6.2 image is available and stable.The
swiftlang/swift:6.2Docker image exists on Docker Hub and is stable. Swift 6.2 was officially released on September 15, 2025. The dev container configuration is valid.Sources/RadiantProgress/ProgressOperation.swift (2)
32-32: LGTM!The protocol documentation clearly describes the purpose of
ProgressOperation.
42-45: LGTM!The function documentation is clear and follows proper documentation patterns.
Sources/RadiantDocs/Primitives/InitializablePackageOptions.swift (6)
32-32: LGTM!The struct documentation clearly describes the purpose of
InitializablePackageOptions.
50-50: Appropriate use of SwiftLint directive.The
swiftlint:disable/enable identifier_namedirectives are correctly placed around the long identifiercompleteFileProtectionUntilFirstUserAuthentication, which matches Foundation's naming convention and should not be shortened.Also applies to: 55-55
64-65: LGTM!The documentation for the
.noneconstant is clear and appropriate.
66-67: LGTM!The documentation for the
rawValueproperty follows standard patterns.
72-75: LGTM!The initializer documentation is clear and follows proper documentation patterns.
81-81: LGTM!The minor documentation wording improvement enhances clarity.
| swiftlang/swift-format@602.0.0 | ||
| realm/SwiftLint@0.62.2 | ||
| peripheryapp/periphery@3.2.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
SwiftLint 0.59.0 0.60.0 0.61.0 0.62.0 0.62.2 breaking changes new rules
💡 Result:
Summary of notable breaking changes and new/renamed rules in SwiftLint 0.59.0 → 0.62.2
-
0.59.0
- Breaking: removed tracking of correction positions; SwiftLint now prints number of corrections instead. [1]
-
0.60.0
- Breaking:
- Removed boolean support for the validates_start_with_lowercase option — use severity values (off/warning/error). [1][2]
- Requires macOS 13+ to run. [1][2]
- swiftlint_linux.zip renamed to swiftlint_linux_amd64.zip (arm64 added separately). [1][2]
- redundant_optional_initialization replaced by implicit_optional_initialization (redundant_optional_initialization remains an alias). [1][2]
- Breaking:
-
0.61.0
- Breaking:
- If SWIFTLINT_DISABLE_SOURCEKIT is set to block loading libsourcekitdInProc, SourceKit‑dependent rules are disabled and a warning is printed per rule. [1]
- operator_whitespace rule removed and merged into function_name_whitespace (which gained additional spacing checks and autocorrect). [1]
- Breaking:
-
0.62.0
-
Breaking:
- SwiftLint now requires Swift 6+ to build. (SPM plugins still work down to Swift 5.9.) [1]
- The SwiftLintBinary.artifactbundle.zip internal structure/path layout simplified (affects Xcode Run Script path usage). [1]
- sorted_imports behavior changed: imports directly adjacent are treated as a group; groups separated by non-imports or blank lines remain separate; comments attach to their import group. [1]
-
New rule (added in 0.62.0):
- prefer_asset_symbols (suggest using asset symbols vs string image names). [1]
-
-
0.62.2
- New rule:
- incompatible_concurrency_annotation (flags declarations that need @preconcurrency to stay Swift 5 compatible). [3]
- Enhancements:
- modifier_order: added isolation modifier group to configure nonisolated position. [3]
- Bug fixes: several fixes to sorted_imports correction and closure_end_indentation handling of #Preview macros. [3]
- New rule:
Sources:
- SwiftLint release notes (GitHub Releases). [1]
- SwiftLint 0.60.0 release details. [2]
- SwiftLint 0.62.2 release details. [3]
If you want I can paste the exact release-note lines or link to each release.
🌐 Web query:
periphery 3.0.0 breaking changes migration from 2.x
💡 Result:
Summary of Periphery 3.0.0 breaking changes and migration steps
Breaking changes
- Periphery 3.0 changes how files are selected: it now scans all source files referenced in the index store (no more explicit --targets). The --targets option is removed. [1]
- --workspace removed; use --project for both .xcworkspace and .xcodeproj. [1]
- CocoaPods installer support removed. [2]
- Swift 5.9 / Xcode 15.2 support removed. [2]
- Homebrew distribution moved to the official Homebrew repo (peripheryapp/periphery tap is deprecated). [1][2]
- Bazel support changed: file-targets-path removed; use built-in Bazel support and the --bazel option (and add periphery dep to MODULE.bazel). [1]
Key migration actions
- Replace any use of --targets by configuring file exclusions (see README Excluding Files) or rely on the new index-store-based scanning. [1]
- Replace --workspace with --project in scripts/CI. [1]
- If you installed via the old Homebrew tap, remove/untap and reinstall from official Homebrew:
brew remove periphery
brew untap peripheryapp/periphery
brew update
brew install periphery. [2] - If you used CocoaPods to install Periphery, switch to Homebrew, Mint, or another supported installer. [2]
- For Bazel users, remove -—file-targets-path usage and follow the MODULE.bazel instructions, then run scans with --bazel. [1]
- Verify your Xcode/Swift toolchain compatibility (Swift 5.9 / Xcode 15.2 no longer supported by Periphery 3.0). [2]
References
- 3.0 Migration Guide (peripheryapp/periphery wiki). [1]
- GitHub Releases — 3.0.0 release notes. [2]
- periphery README (usage / indexing behavior). [3]
🏁 Script executed:
# Check if .swiftlint.yml references operator_whitespace (removed in 0.61.0)
find . -name ".swiftlint.yml" -o -name ".swiftlint.yaml" | head -5Repository: brightdigit/RadiantKit
Length of output: 82
🏁 Script executed:
# Check how periphery is configured (look for scripts/config that use --targets)
find . -type f \( -name "Mintfile" -o -name "*.sh" -o -name "*.yml" -o -name "*.yaml" \) | xargs grep -l "periphery" 2>/dev/null | head -10Repository: brightdigit/RadiantKit
Length of output: 76
🏁 Script executed:
cat .swiftlint.ymlRepository: brightdigit/RadiantKit
Length of output: 3318
🏁 Script executed:
# Check for periphery configuration or usage in build scripts/ci
grep -r "periphery" . --include="*.sh" --include="*.yml" --include="*.yaml" -A 2 -B 2 2>/dev/null | head -50Repository: brightdigit/RadiantKit
Length of output: 48
Verify compatibility and configuration updates for dependency upgrades.
The dependency versions are being updated significantly with breaking changes:
- swift-format: 600.0.0 → 602.0.0 (minor version bump)
- SwiftLint: 0.58.0 → 0.62.2 (breaking changes across multiple versions: 0.60.0 requires macOS 13+; 0.61.0 removes
operator_whitespacerule; 0.62.0 requires Swift 6+ to build, changessorted_importsbehavior) - periphery: 2.20.0 → 3.2.0 (major version bump with breaking changes:
--targetsremoved,--workspaceremoved, CocoaPods support dropped)
SwiftLint considerations:
.swiftlint.ymlincludessorted_imports, which has behavior changes in 0.62.0 (adjacency grouping, comment attachment). Verify imports remain correctly organized after upgrade.- SwiftLint 0.62.2 adds a new
incompatible_concurrency_annotationrule. If enabled or discovered, it could flag Swift 5 code lacking proper concurrency annotations. - SwiftLint 0.62.0+ requires Swift 6+ to build. Confirm your Xcode toolchain and build environment support this.
Periphery considerations:
- Periphery 3.0.0 removes
--targetsand--workspaceoptions. Verify any build scripts or CI configurations have been updated accordingly, or rely on the new index-store-based file scanning. - If the project uses CocoaPods for Periphery installation, switch to Homebrew, Mint, or another supported installer.
Confirm that the "0 violations" claim holds after running lint and analysis checks with these new versions.
🤖 Prompt for AI Agents
In @Mintfile around lines 1 - 3, Update CI/tooling and config to account for the
upgraded Mintfile deps: ensure the Xcode/swift toolchain is Swift 6+ before
upgrading swift-format to 602.0.0 and SwiftLint to 0.62.2, update .swiftlint.yml
to handle the changed sorted_imports behavior and add/opt-out
incompatible_concurrency_annotation if you must support older concurrency
semantics, and test/rerun swift-format to verify import ordering; for periphery
3.2.0 remove usages of the removed flags (--targets, --workspace) in any scripts
or CI and switch installation method away from CocoaPods if used (use
brew/mint), then run the full lint and periphery analysis with the new versions
and confirm the project still reports 0 violations, adjusting configs or code
until it does.
| internal actor ObserverContainer { | ||
| /// The download observer. | ||
| private nonisolated(unsafe) var observer: DownloadObserver? | ||
| nonisolated(unsafe) private var observer: DownloadObserver? |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check the project for similar modifier ordering patterns to verify consistency
# Search for nonisolated(unsafe) patterns followed by access modifiers
echo "=== Searching for nonisolated(unsafe) followed by access modifiers ==="
rg -n 'nonisolated\(unsafe\)\s+(private|internal|public|fileprivate)' --type swift
echo ""
echo "=== Searching for access modifiers followed by nonisolated(unsafe) ==="
# Search for access modifiers followed by nonisolated(unsafe)
rg -n '(private|internal|public|fileprivate)\s+nonisolated\(unsafe\)' --type swiftRepository: brightdigit/RadiantKit
Length of output: 321
🏁 Script executed:
# Check the swift-format configuration for modifier ordering
echo "=== Swift Format Configuration ==="
cat .swift-format
echo ""
echo "=== SwiftLint Configuration ==="
cat .swiftlint.ymlRepository: brightdigit/RadiantKit
Length of output: 5859
🏁 Script executed:
# Check the actual file context
echo "=== Context from ObserverContainer.swift ==="
sed -n '25,40p' Sources/RadiantProgress/ObserverContainer.swiftRepository: brightdigit/RadiantKit
Length of output: 644
Fix modifier ordering to comply with Swift conventions and SwiftLint rules.
Change nonisolated(unsafe) private to private nonisolated(unsafe). Swift conventions and the project's enabled modifier_order SwiftLint rule require access control modifiers to precede other modifiers like nonisolated(unsafe).
🤖 Prompt for AI Agents
In @Sources/RadiantProgress/ObserverContainer.swift at line 32, The property
modifier order on the DownloadObserver property is incorrect; change the
declaration of the `observer` property from `nonisolated(unsafe) private var
observer: DownloadObserver?` to put the access control first by using `private
nonisolated(unsafe) var observer: DownloadObserver?` so it conforms to Swift
conventions and the project's `modifier_order` SwiftLint rule; update the
`observer` declaration in ObserverContainer (the `observer` property)
accordingly.
Addresses CodeRabbit review comments by removing orphaned documentation line and fixes CI workflow to properly detect cache restoration via restore-keys, preventing unnecessary mint installation failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Code Review - PR #38: Refactor file organization for improved maintainabilityI've completed a thorough review of this PR. Overall, this is an excellent refactoring that significantly improves code organization and maintainability. The changes demonstrate strong architectural planning and adherence to project conventions. ✅ Strengths1. Excellent Test Organization
2. Clean Code Separation
3. DevContainer Improvements
4. Linting Configuration Updates
|
| Category | Rating | Notes |
|---|---|---|
| Code Quality | ⭐⭐⭐⭐⭐ | Excellent separation of concerns |
| Architecture | ⭐⭐⭐⭐⭐ | Follows established patterns |
| Testing | ⭐⭐⭐⭐⭐ | Comprehensive and well-organized |
| Documentation | ⭐⭐⭐⭐ | Good, could add more examples |
| CI/Build | Critical bug in cache condition |
✅ Approval Recommendation
Approve with required fix: This PR is excellent, but the CI cache bug must be fixed before merging.
Required Before Merge:
- Fix
.github/workflows/RadiantKit.yml:216cache condition
Recommended (Non-blocking):
- Verify formatting changes align with team style preferences
- Run full test suite to confirm no regressions from mass reformatting
- Consider adjusting SwiftLint thresholds for consistency
Great work on this refactoring! The test file organization is particularly well done and serves as a good example for future splits. The ObservableDownloader separation also improves readability significantly.
Generated by Claude Code
Summary
This PR refactors large files into focused, maintainable units following established project patterns:
AppStorageDateTests Split
AppStorageDateTests+NonOptional.swiftAppStorageDateTests+Optional.swift@SuiteattributesObservableDownloader Split
ObservableDownloader+Internal.swiftDevContainer Updates
Test Plan
swift test)Files Changed
Created:
Tests/RadiantKitTests/AppStorageDateTests+NonOptional.swiftTests/RadiantKitTests/AppStorageDateTests+Optional.swiftSources/RadiantProgress/ObservableDownloader+Internal.swift.devcontainer/swift-6.2/devcontainer.json.devcontainer/swift-6.3/devcontainer.jsonModified:
Tests/RadiantKitTests/AppStorageDateTests.swiftSources/RadiantProgress/ObservableDownloader.swift.devcontainer/devcontainer.json.devcontainer/swift-6.0/devcontainer.json.devcontainer/swift-6.1/devcontainer.json🤖 Generated with Claude Code
Perform an AI-assisted review on
Summary by CodeRabbit
New Features
Improvements
Dependencies
Tests
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.