feat: configure record length in yaml config#22
Merged
adrienaury merged 1 commit intomainfrom May 9, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a configurable record length in the YAML configuration and updates associated APIs and tests to work with the new buffer reset signature. Key changes include:
- Updating the Buffer.Reset method to accept a record length parameter.
- Propagating predicate API changes to return errors.
- Adding a new YAML field "Length" in configuration and adjusting error messages in commands.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/posimap/import_test.go | Updated test to pass an explicit length (0) when resetting the buffer. |
| pkg/posimap/core/schema/schema_test.go | Modified buffer reset calls to use a configured record length (125). |
| pkg/posimap/core/record/object.go | Enhanced export method by propagating errors from predicate evaluations. |
| pkg/posimap/core/predicate/predicate.go | Changed predicate functions to return (bool, error) for more robust error handling. |
| pkg/posimap/core/buffer/buffer.go | Refactored Reset and Required methods to use growTo with a configurable size parameter. |
| pkg/posimap/api/predicate.go | Updated the predicate type to include error handling in its signature. |
| internal/appli/config/model.go | Added a new Length field to allow record length configuration via YAML. |
| internal/appli/command/unfold.go | Modified command logic to use the new configurable record length when resetting the buffer. |
| internal/appli/command/fold.go | Adjusted buffer reset and error handling to use the configurable record length. |
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.
No description provided.