Found during review of #45 (issue #43), and present on main at b7b327e. #45 does not change it.
Values of the wrong type pass key validation and only fail when the merged config is deserialized, so the error names neither the file nor the key. A user config of
{"languages":{"go":{"limits":{"depth":"4"}}}}
fails with
error: invalid configuration: invalid type: string "4", expected usize
and a repo .pickcheck.json of {"hook":{"max_blocks":-1}} fails with
error: invalid configuration: invalid value: integer `-1`, expected usize
With a user config and a repo config both loaded, the user cannot tell which file or key to fix. load_config in crates/core/src/config.rs calls serde_json::from_value once after merge_file has merged both files.
Acceptance
Found during review of #45 (issue #43), and present on main at b7b327e. #45 does not change it.
Values of the wrong type pass key validation and only fail when the merged config is deserialized, so the error names neither the file nor the key. A user config of
fails with
and a repo
.pickcheck.jsonof{"hook":{"max_blocks":-1}}fails withWith a user config and a repo config both loaded, the user cannot tell which file or key to fix.
load_configincrates/core/src/config.rscallsserde_json::from_valueonce aftermerge_filehas merged both files.Acceptance
hook.max_blocks.