fix(core): name the language in per-language config key errors - #42
Merged
Merged
Conversation
Unknown or non-object per-language limit keys now report languages.<name>.limits instead of a bare limits path.
This was referenced Sep 30, 2026
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.
Closes #41
nested_keysincrates/core/src/config.rsnow takes the path of its parent object. The per-language call passeslanguages.<name>, so an unknown per-language limit key is reported aslanguages.<name>.limits.<key>and a non-object per-languagelimitsaslanguages.<name>.limits in <file> must be an object. Top-level calls pass an empty parent, so their messages are unchanged.languages.<name>.limits.<key>{"languages":{"go":{"limits":{"widgetdepth":1}}}}; two languages with the typo inrustonly; dotted language namego.xunknown_language_limit_key_names_full_path,unknown_language_limit_key_names_the_language_with_the_typo; QA 01, 02, 12limitsnames its path{"languages":{"go":{"limits":1}}}non_object_language_limits_names_full_path; QA 04limits.<key>errors are unchangedlimits.widgetdepth, non-objectlimits,tests.pattern,hook.blocks,languages.go.limit, top-levellimit, valid overrides, empty per-language limitsunknown_top_level_limit_key_has_no_language_path,unknown_nested_key_names_full_path; QA 03, 05 to 11, 13crates/core/src/config.rscargo test --workspace --locked --all-targets,cargo clippy ... -D warnings,cargo fmt --check,cargo run -- check crates,cargo llvm-cov --fail-under-lines 94(94.71%),pickcheck check --base origin/main --fail-on new,worsened,unmatched(0 violations), all rerun on ab4c20fQA: a CLI pass ran release builds from main (4de9c09) and this branch over a scratch Git repo in 13
.pickcheck.jsonscenarios, plus--changedand--base HEAD --format jsonwith the two-language typo. Only the four per-language path cases differ from main. The evidence stays local and outside the repo.Review: independent xhigh reviews by Astra and Fable at d302b62. Astra found nothing. Fable found that
docs/releases/UNRELEASED.mdlacked a Changes line for #41, and that a negative assertion on "languages" could fail spuriously if the temp directory path contained that word. ab4c20f fixes both, and the Fable recheck confirmed it. A suggested shared helper for the prefix join was declined because it adds a new function for two call sites. ab4c20f changes only a test and the release draft, so the CLI QA was not rerun.Follow-ups found during this work: #43 (non-object
languages.<name>error omits the config file) and #44 (README coverage floor differs from CI).