[pr-fix][memory] darner config: physical_pages_dir is printed and policy-checked; DARNER_HOME documented and tested #315
Loading…
Reference in a new issue
No description provided.
Delete branch "elgibbone/config-env-and-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What it changes
darner\cachepath.Config::configured_paths() lists every resolved path, physical_pages_dir included; darner config prints it when set and checks it with the others.
default_dir reads through the same env closure as the rest of Config::resolve, and an empty LOCALAPPDATA, XDG_CACHE_HOME or HOME counts as unset (the next one is used).
darner.example.toml documents DARNER_HOME.
New tests: darner_home_sets_default_cache_and_data_below_file_and_dir_overrides, empty_home_and_system_base_vars_fall_through, configured_paths_include_page_files_when_set (darner-core) and config_policy_checks_physical_pages_dir (darner app).
How it was tested
121ae5ccargo test -p darner-core --locked: 36 passed, 0 failedcargo clippy -p darner-core --all-targets --locked -- -D warnings, and with--all-features: cleancargo xwin clippy --target x86_64-pc-windows-msvc -p darner-core --all-targets --locked -- -D warnings, and with--all-features: cleancargo xwin clippy --target x86_64-pc-windows-msvc -p darner --all-targets --locked -- -D warnings: cleancargo xtask policy: 555 files okdarner\<name>to the next variable).Checklist
main.docs/asset-policy.md.Checked for overlap
Validate physical_pages_dir in darner config and test DARNER_HOME precedenceto [pr-fix][memory] darner config: physical_pages_dir is printed and policy-checked; DARNER_HOME documented and testedIndependent Windows build, gate, and code-read review of
121ae5c9100f(full head121ae5c9100fdc127fcd0c1e3fe83b9d15dfbbb1), based onmainf3840d73d3504c30218debfbc8795b9225447317. Not run in-game.Environment
x86_64-pc-windows-msvc), MSVC 19.44.35230.Measured results
cargo clippy --workspace --all-targets --locked -- -D warnings): PASS.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASS.cargo xtask policy: PASS (asset policy: 555 files ok).cargo test --locked -p darner-core: PASS (34 passed; 0 failed; 0 ignored).cargo test --locked -p darner --bin darner config_policy_checks_physical_pages_dir: PASS (1 passed; 0 failed; 0 ignored; 149 filtered out).cargo test --workspace --locked) was not run; focused config tests were run instead.Code-read audit
Config::resolvekeeps explicitDARNER_CACHE_DIR/DARNER_DATA_DIRahead of TOML and computed defaults, passes the same environment provider intodefault_dir, and still rejects data paths inside the cache (crates/darner-core/src/config.rs:98-129).default_dirhonors non-emptyDARNER_HOME, then the prior LOCALAPPDATA/XDG_CACHE_HOME/HOME search order while skipping empty values (config.rs:246-259); the tests exercise precedence and empty-value fallthrough (config.rs:465-544).configured_pathsincludes game, physical-page, test-title, cache, and data paths (config.rs:166-174).show_configdisplaysphysical_pages_dirwhen enabled and sends that complete set through the existing policy reporter (apps/darner/src/main.rs:946-968); the added test verifies an in-repository page directory is the single reported violation (main.rs:1120-1137).DARNER_HOMErelocates the default base while preserving the explicit cache/data override variables (darner.example.toml:3-25). The added test also verifies system-base fallback and a clear error when no non-empty base is available (config.rs:516-544).No blocking issue found.
Verdict: PASS.
AI-assisted: yes (GitHub Copilot, Auto mode).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.