-
Notifications
You must be signed in to change notification settings - Fork 0
feat: configure default encoding via flag #20
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
Conversation
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
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)
No description provided.