Repository navigation
Conversation
`command`, `dependsOn` entries and their `from`, `input` and `output` entries, and the root `cache` setting were still `#[serde(untagged)]`, so any mistake in them failed with `data did not match any variant of untagged enum ...`. They now pick the variant with `UntaggedEnumVisitor`, as #815 did for task definitions and the task `cache` setting. `input` and `output` entries have two object forms, so both are parsed as one struct, and a mistyped key is reported along with `pattern`, `base`, and `auto`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fspy benchmarklinuxmacoswindows |
- Suggest `{ auto: true }` in the expected forms of an input or output
entry.
- Say that `from` takes package.json dependency field names, with
`dependencies` and `devDependencies` as examples.
- Move the object form of the root `cache` setting into
`DetailedGlobalCacheConfig`, like `UserCacheConfig::Config`, so its
fields aren't repeated in the `Deserialize` impl. `ts(inline)` keeps
`run-config.ts` unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parsing both object forms into one struct of `Option` fields treated an
explicit `null` as an absent field, so `{ pattern, base, auto: null }` and
`{ auto: false, pattern: null }` were accepted. Before, both forms
rejected them. A present field is now parsed with its own type, so `null`
is an error again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Motivation
#815 made task definitions and the task
cachesetting report the real parse error instead ofdata did not match any variant of untagged enum .... The other config values that accept more than one form were still#[serde(untagged)], so any mistake in them still got the generic error, which names an internal Rust type and not the problem:command: 123... untagged enum Commandinvalid type: integer `123`, expected a command string or an array of command stringsdependsOn: [{ task: "build", form: "dependencies" }]... untagged enum UserDependsOnEntryunknown field `form`, expected `task` or `from`dependsOn: [{ task: "build", from: "devDeps" }]... untagged enum UserDependsOnEntryunknown variant `devDeps`, expected one of `dependencies`, `devDependencies`, `peerDependencies`cache: { input: [{ pattern: "src/**", bas: "workspace" }] }... untagged enum UserInputEntryunknown field `bas`, expected one of `pattern`, `base`, `auto`cache: { input: [{ pattern: "src/**" }] }... untagged enum UserInputEntrymissing field `base`cache: { output: [{ auto: true, pattern: "src/**" }] }... untagged enum UserOutputEntry`auto` can't be combined with `pattern` or `base`cache: { script: true }... untagged enum UserGlobalCacheConfigunknown field `script`, expected one of `scripts`, `tasks`, `remote`Command,UserDependsOnEntry,UserDependsOnFrom, andUserGlobalCacheConfigpick the variant from the value's type withUntaggedEnumVisitor, like #815.UserInputEntryandUserOutputEntryhave two object forms,{ pattern, base }and{ auto }, so both forms are parsed as one struct and then checked. That way a mistyped key is listed with every accepted key. Valid configs parse as before, andrun-config.tsis unchanged.🤖 Generated with Claude Code