Fix path parsing not considering scientific notation#58
Conversation
WalkthroughThe changes introduced in this update primarily focus on enhancing file management and improving the robustness of SVG handling in the codebase. A new entry in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Git
participant SVGParser
User->>Git: Commits changes
Git->>Git: Ignores `github_issue_[0-9]*.svg`
User->>SVGParser: Sends SVG transformation string
SVGParser->>SVGParser: Parses string with improved delimiters
SVGParser->>SVGParser: Attempts to convert substrings to float
SVGParser-->>User: Returns parsed result or error
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- .gitignore (1 hunks)
- svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/ImageVectorNode.kt (2 hunks)
- svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/svg/transform/SvgTransform.kt (1 hunks)
Files skipped from review due to trivial changes (1)
- .gitignore
Additional comments not posted (3)
svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/svg/transform/SvgTransform.kt (1)
57-62: Robust parsing and error handling improvements.The addition of the extra delimiter and the use of
toFloatOrNullwithrequireNotNullenhances the robustness of the parsing logic. This change ensures better handling of various input formats and provides informative error messages.svg-to-compose/src/commonMain/kotlin/dev/tonholo/s2c/domain/ImageVectorNode.kt (2)
491-493: Improved variable naming for clarity.The introduction of
isNotENotationand the renaming ofisNegativeSigntoisNegativeSignSeparatorenhance the readability and clarity of the code, making the logic more understandable.
Line range hint
510-516: Enhanced handling of scientific notation.The refined logic for appending characters ensures that scientific notation is correctly parsed, improving the accuracy of path normalization.
This pr addresses issue #56 where the path normalization was not considering scientific notation values.
Summary by CodeRabbit
New Features
Bug Fixes
Chores
.gitignoreto exclude specific SVG files related to GitHub issues, streamlining file management in the repository.