harrisoncramer / harrisoncramer/ultra
TOML array given for a scalar flag is silently coerced to a string
- Dominant language
- Go
- Stars
- 2
- Forks
- 1
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
When flattening .ultra.toml, every scalar-section value is stringified with fmt.Sprint. A TOML array supplied where a scalar flag is expected (for example apps-dir set to a list) becomes the literal string "[x y]" and is fed to the flag with no error, so the flag silently takes a garbage value instead of the config being rejected.
A type mismatch on a typed flag (a string where an int is expected) does surface a clear error, so only the array-for-scalar case is silent. flatten should reject a non-scalar value for a scalar flag.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the flatten function that processes scalar-section values in the Go package, then inspect the existing typed-flag mismatch handling. Add a regression test for an array supplied to a scalar flag, and consider the issue done when flatten rejects the non-scalar value with an error instead of stringifying it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100