refactor: config_create(), main(), send_files() — reduce duplication and complexity (#149, #150, #151) #155

Closed
TapTap wants to merge 1 commits from fix/refactor-cli-config into main
Owner

Fixes #149, #150, #151

#150: Replace 11-parameter config_create() with simple config_create() that initializes to sensible defaults. Callers set fields directly instead of passing 11 positional arguments.

#149: Extract validate_config() from main() — reduces main() from 325 to 281 lines. All 8 sequential flag conflict checks moved into a single validate_config() function.

#151: Extract run_dry_run(), connect_to_server(), send_manifest(), and print_progress() shared helpers to eliminate code duplication between send_files() and send_files_multithreaded().

All 22 unit tests pass.

Fixes #149, #150, #151 #150: Replace 11-parameter config_create() with simple config_create() that initializes to sensible defaults. Callers set fields directly instead of passing 11 positional arguments. #149: Extract validate_config() from main() — reduces main() from 325 to 281 lines. All 8 sequential flag conflict checks moved into a single validate_config() function. #151: Extract run_dry_run(), connect_to_server(), send_manifest(), and print_progress() shared helpers to eliminate code duplication between send_files() and send_files_multithreaded(). All 22 unit tests pass.
TapTap added 1 commit 2026-07-29 18:34:16 +02:00
refactor: config_create(), main(), send_files() - reduce duplication and complexity
CI / lint (pull_request) Failing after 11s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped
0021ca3fcd
- #150: Replace 11-parameter config_create() with config_create() that
  initializes to sensible defaults; callers set fields directly
- #149: Extract validate_config() from main(); reduce main() from 325 to
  281 lines by extracting validation logic into separate function
- #151: Extract run_dry_run(), connect_to_server(), send_manifest(), and
  print_progress() shared helpers from send_files()/send_files_multithreaded()
  to eliminate code duplication
TapTap closed this pull request 2026-07-29 18:40:38 +02:00
Some checks are pending
CI / lint (pull_request) Failing after 11s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TapTap/FastSync#155