feat: support JSON5 task files alongside YAML#233
Merged
josegonzalez merged 2 commits intomainfrom Apr 29, 2026
Merged
Conversation
Task files may now be authored in JSON5, with format selected by the file extension (`.yml` / `.yaml` for YAML, `.json` / `.json5` for JSON5). When `--tasks` is omitted, docket probes `tasks.yml`, `tasks.yaml`, then `tasks.json` in source order. JSON5 is a strict superset of JSON so existing JSON files parse unchanged; the JSON5 extras (`//` and `/* */` comments, trailing commas, unquoted keys) make hand-authored recipes more comfortable. `apply`, `plan`, `validate`, `init`, and `fmt` all accept either format. `init` infers the surface from the `--output` extension, and `fmt` round-trips JSON5 comments via an in-tree comment-aware AST so the canonical layout is identical between the YAML and JSON5 surfaces.
|
Drop the redundant whitespace after `>` in cat-to-heredoc redirects in the new task_file_json.bats so shfmt's `-i 2` rules pass, remove the unused `local lib` declaration left over from the BATS_LIB_PATH refactor in test_helper.bash, and widen the shellcheck disable directive to cover SC1091 alongside SC1090 on the dynamic source paths.
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.
Summary
Task files may now be authored in JSON5, with format selected by the file extension (
.yml/.yamlfor YAML,.json/.json5for JSON5). When--tasksis omitted, docket probestasks.yml,tasks.yaml, thentasks.jsonin source order. JSON5 is a strict superset of JSON so existing JSON files parse unchanged; the JSON5 extras (//and/* */comments, trailing commas, unquoted keys) make hand-authored recipes more comfortable.apply,plan,validate,init, andfmtall accept either format.initinfers the surface from the--outputextension.fmtround-trips JSON5 comments via an in-tree comment-aware AST so the canonical layout is identical between the YAML and JSON5 surfaces.Closes #218.