Skip to content

fix(core): name the config file in language entry errors - #45

Merged
ElbertePlinio merged 1 commit into
mainfrom
fix/43-language-error-config-path
Sep 30, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
fix/43-language-error-config-path

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Closes #43

The unknown-language check ran on the merged config, after the user and repo files were combined, so its error could not say which file held the typo. It now runs per file inside validate_language_keys in crates/core/src/config.rs, and validate_languages is gone. The non-object languages.<name> message gains the same in <file> part. The language name is checked before the entry's shape, so {"languages":{"cobol":1}} reports the unknown language instead of a shape error, and {"languages":{"cobol":{"limits":{"bogus":1}}}} reports languages.cobol instead of the nested key.

Requirement Verified by Scenario Result Evidence
Non-object languages.<name> names the config file automated test + CLI QA {"go":1}, {"go":null}, non-object entry in the user config pass, languages.go in <file> must be an object, exit 2 non_object_language_entry_names_config_path; QA 01, 02, 07
Unknown language names the config file automated test + CLI QA cobol in repo config; cobol in user config with a valid repo config; Go (case); empty name; unknown name with malformed entry or bad limits pass, unknown config key `languages.<name>` in <file>, exit 2, and the user-config case names the user file unknown_language_names_config_path; QA 03 to 06, 08, 09
A test covers the non-object language entry automated test exact message with the temp config path pass non_object_language_entry_names_config_path
Other config errors and valid configs unchanged automated test + CLI QA all seven languages, empty languages, non-object languages, per-language limit typo, valid user plus repo configs byte-identical to main, including exit codes existing config tests; QA 10 to 14
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.79%), pickcheck check --base origin/main --fail-on new,worsened,unmatched (0 violations), on e8d0f01 pass CI on this PR

QA: a CLI pass ran release builds from main (b7b327e) and this branch over a scratch Git repo in 14 scenarios, with a user config supplied through XDG_CONFIG_HOME, plus --changed and --base HEAD --format json with an unknown language. The nine language-entry cases differ from main only by naming the file and, for unknown names, reporting the name first. The evidence stays local and outside the repo.

docs/releases/UNRELEASED.md gains a Changes line for #43.

Review: independent xhigh reviews by Astra and Fable at e8d0f01 found no blocking issues, and Astra found nothing. Fable noted that the release line covers both the file path and the new check order. It stays one line because the order change comes from the same move. Fable also noted that value type errors still name no file, which is outside this issue.

Follow-up found during review: #46 (config value type errors do not name the file or key).

Unknown language names and non-object languages.<name> entries are now
checked per config file, so the error says which file to fix.
@ElbertePlinio
ElbertePlinio merged commit b1894bf into main Sep 30, 2026
8 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/43-language-error-config-path branch September 30, 2026 18:24
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.

Non-object languages.<name> config error omits the config file path

1 participant