Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds Windows support to the project by addressing platform-specific differences in file path handling and socket APIs. The changes ensure cross-platform compatibility while maintaining existing functionality on Unix-like systems.
Key changes:
- Updated path handling to use FilePath API instead of string-based path operations for cross-platform compatibility
- Added Windows socket implementation with WinSDK imports and platform-specific type aliases
- Fixed GitHub Actions workflow to explicitly reference repository for release operations
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/TuzuruLibTests/IntegrityManagerTests.swift | Updated file path comparisons to use FilePath for cross-platform compatibility |
| Tests/TuzuruLibTests/GitCommitterTests.swift | Removed test case that relied on Unix-specific file behavior |
| Tests/TuzuruLibTests/GenerateManifestTests.swift | Updated path assertions to use FilePath API instead of string comparisons |
| Tests/TuzuruLibTests/BlogConfigurationLoaderTests.swift | Modified configuration path tests to use FilePath equality checks |
| Sources/TuzuruLib/Utils/GitWrapper.swift | Enhanced error handling with proper exit code checking and custom error type |
| Sources/TuzuruLib/SourceLoader/SourceLoader.swift | Replaced string-based path splitting with FilePath components |
| Sources/TuzuruLib/Generator/PathGenerator.swift | Refactored path operations to use FilePath components for better cross-platform support |
| Sources/TuzuruLib/Generator/BlogGenerator.swift | Updated directory parsing to use FilePath components |
| Sources/TuzuruLib/Amender/FileAmender.swift | Modernized FileHandle usage with proper error handling |
| Sources/ToyHttpServer/SocketAPI.swift | Added comprehensive Windows socket support with WinSDK integration |
| .github/workflows/release-please.yml | Fixed GitHub CLI commands to explicitly reference repository |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| let fileHandle = try FileHandle(forWritingTo: URL(fileURLWithPath: fullFilePath.string)) | ||
| defer { try? fileHandle.close() } | ||
| try fileHandle.seekToEnd() | ||
| try fileHandle.write(contentsOf: "\n".data(using: .utf8)!) |
There was a problem hiding this comment.
The do block doesn't have a catch clause, which means any errors thrown by the FileHandle operations will propagate up. This could result in unclear error messages for the caller. Consider adding a catch block to provide more context about file writing failures.
| try fileHandle.write(contentsOf: "\n".data(using: .utf8)!) | |
| try fileHandle.write(contentsOf: "\n".data(using: .utf8)!) | |
| } catch { | |
| throw TuzuruError.fileWriteFailed(fullFilePath.string, error) |
5e011af to
8e2d599
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| do { | ||
| let fileHandle = try FileHandle(forWritingTo: URL(fileURLWithPath: fullFilePath.string)) | ||
| defer { try? fileHandle.close() } | ||
| try fileHandle.seekToEnd() | ||
| try fileHandle.write(contentsOf: "\n".data(using: .utf8)!) | ||
| } |
There was a problem hiding this comment.
The do block is missing a corresponding catch block. Either add proper error handling or remove the do block since all operations are already throwing and will propagate up.
8e2d599 to
c120cc0
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
0c3e51d to
b4b8dda
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
145907d to
e176448
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3bb24c6 to
8ac344d
Compare
Tested this branch on Windows 11 with ARM.
/which is\in Windows insteadsplit(separator: "/")