Repository navigation
Normalize YAML timestamp values for gojq - #77
Merged
JFryy merged 1 commit intoNov 2, 2026
Merged
Conversation
JFryy
approved these changes
Nov 2, 2026
JFryy
left a comment
Owner
There was a problem hiding this comment.
Thanks for submitting this! Looks good
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.
Description
Closes #76. YAML timestamp values currently remain
time.Time, which gojq cannot encode and can panic on, even though timestamp keys already have a stable string representation. Normalize values with the same existingtimestampStringhelper so top-level, nested, sequence and multi-document values are safe for gojq and agree with keys.Changes
Testing
On macOS with Go 1.25.12:
go test -count=1 ./...,go vet ./..., and build passed.make testpassed, including the shell integration harness (347 passed, 171 skipped by that harness).go test -race -count=1 ./codec/...passed.printf 'a: 2024-01-01\n' | qq -iyaml tojsoncompletes with the date string instead of panicking.Additional Notes
Full
go test -race -count=1 ./...fails in the pre-existing CLI tests' concurrent stdout/Version handling. Runninggo test -race -count=1 ./cliin a separate, unmodified worktree at base0ca9d3c3a9a1206259c39b99e927df81a29c22e2reproduces that race. It is not reported as passing or changed here. Linux/Windows were not run locally. Timestamp lexical spellings are normalized using the existing formatter, not preserved verbatim.