Skip to content

Conversation

@adrienaury
Copy link
Member

No description provided.

@adrienaury adrienaury linked an issue May 9, 2025 that may be closed by this pull request
@adrienaury adrienaury requested a review from Copilot May 9, 2025 10:01
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

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)

@adrienaury adrienaury merged commit 02e63fe into main May 9, 2025
1 check passed
@adrienaury adrienaury linked an issue May 9, 2025 that may be closed by this pull request
@adrienaury adrienaury deleted the 18-feat-configure-default-encoding-via-flag branch May 9, 2025 12:00
@adrienaury adrienaury linked an issue May 9, 2025 that may be closed by this pull request
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: configure default encoding via flag fix: flag config should not override yaml config fix: json string encoding

2 participants