Skip to content

fix(core): name the language in per-language config key errors - #42

Merged
ElbertePlinio merged 2 commits into
mainfrom
fix/41-language-limit-key-path
Sep 30, 2026
Merged

ElbertePlinio merged 2 commits into
mainfrom
fix/41-language-limit-key-path

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Closes #41

nested_keys in crates/core/src/config.rs now takes the path of its parent object. The per-language call passes languages.<name>, so an unknown per-language limit key is reported as languages.<name>.limits.<key> and a non-object per-language limits as languages.<name>.limits in <file> must be an object. Top-level calls pass an empty parent, so their messages are unchanged.

Requirement Verified by Scenario Result Evidence
The error names languages.<name>.limits.<key> automated test + CLI QA {"languages":{"go":{"limits":{"widgetdepth":1}}}}; two languages with the typo in rust only; dotted language name go.x pass, exit 2 with the full path unknown_language_limit_key_names_full_path, unknown_language_limit_key_names_the_language_with_the_typo; QA 01, 02, 12
Non-object per-language limits names its path automated test + CLI QA {"languages":{"go":{"limits":1}}} pass non_object_language_limits_names_full_path; QA 04
Top-level limits.<key> errors are unchanged automated test + CLI QA limits.widgetdepth, non-object limits, tests.pattern, hook.blocks, languages.go.limit, top-level limit, valid overrides, empty per-language limits byte-identical to main, including exit codes unknown_top_level_limit_key_has_no_language_path, unknown_nested_key_names_full_path; QA 03, 05 to 11, 13
A test covers the per-language case automated test the four new unit tests above pass crates/core/src/config.rs
Tests, lint, format, coverage, PickCheck automated cargo 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 ab4c20f pass CI on this PR

QA: a CLI pass ran release builds from main (4de9c09) and this branch over a scratch Git repo in 13 .pickcheck.json scenarios, plus --changed and --base HEAD --format json with 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.md lacked 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).

Unknown or non-object per-language limit keys now report
languages.<name>.limits instead of a bare limits path.
@ElbertePlinio
ElbertePlinio merged commit b7b327e into main Sep 30, 2026
8 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/41-language-limit-key-path branch September 30, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown per-language limit key is reported without its languages.<name> path

1 participant