fix(core): name the config file in language entry errors - #45
Merged
Merged
Conversation
Unknown language names and non-object languages.<name> entries are now checked per config file, so the error says which file to fix.
2 tasks done
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 #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_keysincrates/core/src/config.rs, andvalidate_languagesis gone. The non-objectlanguages.<name>message gains the samein <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}}}}reportslanguages.cobolinstead of the nested key.languages.<name>names the config file{"go":1},{"go":null}, non-object entry in the user configlanguages.go in <file> must be an object, exit 2non_object_language_entry_names_config_path; QA 01, 02, 07cobolin repo config;cobolin user config with a valid repo config;Go(case); empty name; unknown name with malformed entry or bad limitsunknown config key `languages.<name>` in <file>, exit 2, and the user-config case names the user fileunknown_language_names_config_path; QA 03 to 06, 08, 09non_object_language_entry_names_config_pathlanguages, non-objectlanguages, per-language limit typo, valid user plus repo configscargo 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 e8d0f01QA: 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--changedand--base HEAD --format jsonwith 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.mdgains 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).