fix(session,configio): point at dotted-path in compound-error messages#24
Merged
Merged
Conversation
mythy set against a compound DATA with a scalar RHS used to error
with
set RELE_K1: compound TIPO=RELE needs map[string]any, got string
Two papercuts in that line:
1. It leaks the Go-internal `map[string]any` type, which is
unactionable from the CLI — there is no way to pass a literal
Go map as an argv string.
2. It doesn't mention the actually-supported dotted-path syntax
(`mythy set RELE_K1.Logica=ECCITATO`), so a reader who takes
the message literally goes hunting for an inline-map feature
that doesn't exist (this is what led to the original duplicate
issue #22 being filed).
Rewrite to surface the supported syntax with a concrete example
and a pointer at `mythy set --help`. Symmetric refresh on the
configio.YAMLToCodec compound fallthrough so the YAML-import path
emits a useful diagnostic when a compound DATA is given a scalar
value in the YAML.
Test in pkg/session pins the new wording so a future refactor that
quietly drops the hint surfaces in CI.
Follow-up to #22.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Follow-up to the discussion on #22.
The compound-write error used to read:
Two papercuts:
map[string]anytype, which is unactionable from a CLI — there's no way to pass a literal Go map as an argv string. A reader trying to take the message literally hunts for an inline-map syntax that doesn't exist.mythy set --helpto find it. That's exactly what led to set CLI: inline compound syntax not accepted, only via import YAML #22 being filed in the first place.New wording:
Same idea on
pkg/configio/valuefmt.go'sYAMLToCodeccompound fallthrough so the YAML-import path stops emitting the generic "unsupported tipo" and instead surfaces the actual constraint ("nested map of sub-field values").TestSetCompoundWithScalarValuePointsToDottedPathpins the new shape so a future refactor that drops the hint surfaces in CI.🤖 Generated with Claude Code