feat: configure default encoding via flag#20
Merged
adrienaury merged 8 commits intomainfrom May 9, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a feature flag for configuring default encoding via a command‐line flag and migrates configuration management from the infra package to the appli package. Key changes include updating string trimming behavior, refactoring to use json.Marshal for data escaping, and refactoring configuration code along with corresponding tests and commands.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/posimap/core/codec/string.go | Update of the trimming constant from BlankRunes to VisibleBlankRunes |
| internal/infra/jsonline/writer.go | Switch to JSON escaping for data, with notes for future json/v2 usage |
| internal/infra/config/model.go | Removal of the infra config file |
| internal/appli/config/model.go | New configuration implementation with pointer fields for options |
| internal/appli/config/model_test.go | Tests updated to validate new config implementation |
| internal/appli/config/load_test.go | Updated import path to use the appli config package |
| internal/appli/command/unfold.go and internal/appli/command/fold.go | Added charset flag and updated config.Compile calls |
| go.mod | Dependency adjustments and removal of duplicate entries |
| .editorconfig | Addition of settings for fixed-width files |
Comments suppressed due to low confidence (3)
internal/infra/config/model.go:1
- The removal of this file indicates a migration of configuration management to the appli package. Please ensure that all references to this config model have been correctly updated.
package config
pkg/posimap/core/codec/string.go:45
- Ensure that the constant 'VisibleBlankRunes' includes all intended whitespace characters compared to 'BlankRunes'. If this change affects the trimming behavior, consider updating the related documentation for clarity.
return strings.TrimRight(string(runes), VisibleBlankRunes), err
internal/infra/jsonline/writer.go:161
- Using json.Marshal returns a JSON-encoded string (including surrounding quotes). Verify that this output format meets downstream expectations; if not, consider unquoting the result before writing.
escapedBytes, err := json.Marshal(data)
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.