generated from adrienaury/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: comp-3 codec #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Closed
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for packed decimal (COMP-3) encoding throughout POSIMAP.
- Introduce
Comp3codec implementation with encode/decode logic and tests. - Extend
Fieldmodel and commands to select COMP-3 viacodec: COMP-3andpicture:. - Update
Stringcodec padding logic, add command test data, update docs and changelog.
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/posimap/core/codec/string.go | Extract space‐fill byte into zero, use in padding loop |
| pkg/posimap/core/codec/comp3.go | New Comp3 type, errors, encode/decode logic |
| pkg/posimap/core/codec/comp3_test.go | Tests for COMP-3 encode/decode |
| internal/appli/config/model.go | Add Picture & Codec to Field, COMP-3 branch |
| internal/appli/config/picture.go | Parse COBOL-style picture into PictureFormat |
| internal/appli/config/picture_test.go | Tests for picture compilation |
| internal/appli/command/unfold_test.go | Register new unfold test case for COMP-3 |
| internal/appli/command/fold_test.go | Register new fold test case for COMP-3 |
| internal/appli/command/testdata/.../13-comp3 | Add fold/unfold test fixtures for COMP-3 |
| README.md | Document COMP-3 support |
| CHANGELOG.md | Note v0.3.0 COMP-3 feature |
Comments suppressed due to low confidence (3)
pkg/posimap/core/codec/string.go:39
- [nitpick] The field name
zerois misleading since it holds the space fill byte. Consider renaming topadByteorspaceByteto clarify its purpose.
zero byte
pkg/posimap/core/codec/string.go:96
- You cannot
rangeover anint. Replace with a classic for-loop, e.g.,for idx := 0; idx < s.length-len(bytes); idx++ {.
for idx := range s.length - len(bytes) {
internal/appli/config/model.go:121
- Dereferencing
f.Trimwithout checking fornilcan panic. Consider defaulting tofalsewhenf.Trimis nil.
record = record.WithField(f.Name, codec.NewString(charset, f.Length, *f.Trim), f.CompileOptions()...)
Co-authored-by: Copilot <[email protected]>
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.
No description provided.