Skip to content

Conversation

@adrienaury
Copy link
Member

No description provided.

@adrienaury adrienaury linked an issue Jun 4, 2025 that may be closed by this pull request
@adrienaury adrienaury requested a review from Copilot June 4, 2025 12:14
Copy link
Contributor

Copilot AI left a 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 Comp3 codec implementation with encode/decode logic and tests.
  • Extend Field model and commands to select COMP-3 via codec: COMP-3 and picture:.
  • Update String codec 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 zero is misleading since it holds the space fill byte. Consider renaming to padByte or spaceByte to clarify its purpose.
zero    byte

pkg/posimap/core/codec/string.go:96

  • You cannot range over an int. 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.Trim without checking for nil can panic. Consider defaulting to false when f.Trim is nil.
record = record.WithField(f.Name, codec.NewString(charset, f.Length, *f.Trim), f.CompileOptions()...)

@adrienaury adrienaury merged commit d0318ec into main Jun 4, 2025
1 check passed
@adrienaury adrienaury deleted the feat-compressed-codecs branch June 4, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: compressed codecs

2 participants