Repository navigation
Docs: fix uncopyable config examples, phantom defaults keys, pc_hostname advice (#44) - #67
Merged
Merged
Conversation
…_hostname advice (#44) 1. Unquoted *-leading globs parse as YAML aliases and fail to load. Quoted every glob list in README.md, README.fr.md, configuration-profile (en/fr, 2 blocks each) and performance-metrics-guide, and added a warning callout in the glob-exclusion section of both configuration-profile guides. Also fixed in the same spirit: filters: [, ...] sequences (null first item), quoted filter search-expression examples, and # comments that swallowed a flow sequence's closing bracket. 2. The Complete Multi-Machine Setup example put columns:/column_widths: under defaults: — Defaults has no such keys and silently ignored them. Replaced with a real top-level columns: mapping (en+fr) with a comment explaining why keys under defaults: would do nothing. 3. template.py still advised pc_hostname: All as catch-all; the schema has no such key (auto-selection is match.*). Rewrote the CONFIGS header to describe match.hostname: ["*"] + place-last rule. Schema examples in the template body already used match and are unchanged. 4. extra="forbid" on Defaults (schema.py) so unknown keys — the root cause of (2) — now raise a clear ValidationError instead of being silently ignored; regression test in tests/core/config/test_schema.py. Verification: every yaml code block in the 5 edited docs parses (0 failures, previously 8); full suite 1336 passed, 245 skipped, coverage 87.9%; the one failure (test_main_without_npm) pre-exists on main and is unrelated.
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 #44
1. Unquoted
*-leading globs are YAML aliases — examples didn't parseQuoted every glob item in
README.md,README.fr.md,docs/configuration-profile.{en,fr}.mdanddocs/performance-metrics-guide.md, and added a warning callout in the Glob Exclusion section of both configuration-profile guides ([*backup*]→found undefined alias 'backup*').While verifying, I found and fixed the remaining unparseable blocks in the same guides:
filters: [, prod, specific]-style sequences in the French guide (empty first item = YAML null, breaksfilterstyping) — 4 occurrencesfilters: ["Production Program" OR "Test Suite" -deprecated](quoted+plain mix doesn't parse) — now single-quoted strings, en+fr#comments that swallowed a flow sequence's closing bracket:extensions: [.lnk, .pdf # comment]— comment moved outside, en+frVerification: scripted
yaml.safe_loadover every ```yaml block in the 5 edited files: 0 failures (8 before).2. Phantom keys under
defaults:The "Complete Multi-Machine Setup" example (en+fr) showed
columns:+column_widths:insidedefaults:—Defaults(core/config/schema.py) has no such keys and silently ignored them, so users copying it got no columns and no error. Replaced with a real top-levelcolumns:mapping (File/Version/Classification/Date, widths preserved from the old example) plus a comment explaining why keys underdefaults:would do nothing.Root cause hardened as the issue suggested:⚠️ Note: this is the one behavior change in the PR — configs that previously carried junk under
extra="forbid"onDefaults— unknown keys now raise a clear pydanticValidationErrorinstead of being silently dropped. Regression testTestDefaults.test_unknown_key_raisesadded.defaults:will now fail fast with an explicit message.3. Dead
pc_hostnameadvice in every generated configcore/config/template.pyCONFIGS header claimedpc_hostname: Allacts as a catch-all ("place it LAST") — the schema has nopc_hostname; auto-selection ismatch.hostname/ip/path. Rewrote the header to teachmatch.hostname: ["*"]+ the place-last rule (matching the docs). The example blocks in the template body already usedmatch:and are unchanged.Test suite
1336 passed / 245 skipped / coverage 87.94%. The single failure (
test_main_without_npm) reproduces on unmodifiedmainand is unrelated to this PR.