Reduce duplication, fix compile errors, harden tests#9
Merged
Conversation
- Extract sha256_hex() utility to lib.rs, replacing 34 inline calls - Extract App::spawn_sync() and App::reload_state() in dashboard - Consolidate 4 identical confirm popup renders into render_confirm_popup() - Remove redundant App::syncing bool (equivalent to sync_child.is_some()) - Fix known_profile_names() re-reading Config from disk on every render - Add DEFAULT_PROFILE constant, replace scattered "dev" literals - Add missing add_profile_dotfile/remove_profile_dotfile functions - Add installing indicator to dashboard status bar - Fix matches!() without assert!() in secret scanner tests - Add tests for sha256_hex and canonical_project_file_path traversal - Tighten weak test assertions
Contributor
Author
|
/songify |
|
🎵 DiffBeats just dropped a track for this PR! "Reduce duplication, fix compile errors, harden tests" Lyrics |
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.
Summary
sha256_hex()utility replacing 34 duplicate inline calls across 9 filesApp::spawn_sync()(5 sites) andApp::reload_state()(9 sites) in dashboardrender_confirm_popup()App::syncingbool (was alwayssync_child.is_some())known_profile_names()callingConfig::load()from disk on every render passDEFAULT_PROFILEconstant replacing scattered"dev"string literalsadd_profile_dotfile/remove_profile_dotfilefunctions (compile fix)installingparameter to status bar render (compile fix)matches!()withoutassert!()in secret scanner tests (type checks were no-ops)sha256_hex,canonical_project_file_pathpath traversal rejectionNet: -77 lines across 18 files. 214 tests pass, zero clippy warnings.
Test plan
cargo clippy --all-targets -- -D warningspassescargo test -- --include-ignored— 214 tests passcargo buildsucceeds (previously had 3 compile errors)