Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reorganizes the BinaryParseKit source files into a more structured directory layout by splitting monolithic extension files into more focused, single-purpose files. The refactoring improves code organization and maintainability by grouping related functionality together.
Key Changes
- Split
BuiltInExtensions.swiftinto separate integer, Data, and Matchable extension files - Split
CustomExtensions.swiftinto separate floating-point extension file - Moved
PrinterErrorenum fromPrinter.swiftprotocol file into its own dedicated file - Created new protocol files (
ParsableProtocols.swift,MatchableProtocols.swift,Printable.swift) for better separation of concerns - Organized utility functions into dedicated
Utils/directory files
Reviewed changes
Copilot reviewed 8 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/BinaryParseKit/Utils/PrinterUtils.swift | New utility file containing printer helper functions for macro system |
| Sources/BinaryParseKit/Utils/ParsingUtils.swift | New utility file with parsing helper functions (matching, type assertions) - header comment needs correction |
| Sources/BinaryParseKit/Protocols/Printer.swift | Removed PrinterError enum (moved to separate file) |
| Sources/BinaryParseKit/Protocols/Printable.swift | New protocol file defining Printable protocol and default implementation |
| Sources/BinaryParseKit/Protocols/ParsableProtocols.swift | New file consolidating all parsing-related protocols - header comment needs correction |
| Sources/BinaryParseKit/Protocols/MatchableProtocols.swift | New protocol file for Matchable protocol and extensions |
| Sources/BinaryParseKit/Printer/PrinterError.swift | New dedicated error file extracted from Printer.swift |
| Sources/BinaryParseKit/Extensions/PrintableExtensions.swift | New file with Printable conformances for integers and floating-point types |
| Sources/BinaryParseKit/Extensions/Matchable+.swift | New extension file for Matchable with RawRepresentable conformance |
| Sources/BinaryParseKit/Extensions/IntegerExtensions.swift | Split from BuiltInExtensions.swift, contains integer parsing extensions - header comment needs correction |
| Sources/BinaryParseKit/Extensions/FloatingPointExtensions.swift | Split from CustomExtensions.swift, contains floating-point parsing extensions - header comment needs correction |
| Sources/BinaryParseKit/Extensions/Data+SizedParsable.swift | Split from BuiltInExtensions.swift, properly imports Foundation |
| Sources/BinaryParseKit/CustomExtensions.swift | Deleted - contents moved to FloatingPointExtensions.swift |
| Sources/BinaryParseKit/BuiltInExtensions.swift | Deleted - contents split into IntegerExtensions.swift, Data+SizedParsable.swift, and Matchable+.swift |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Sources/BinaryParseKit/Extensions/FloatingPointExtensions.swift
Outdated
Show resolved
Hide resolved
0daf123 to
4091728
Compare
4091728 to
b6ccc33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR organizes source files in a more clear manner.