refactor(cli): extract per-repo check helper from cmd_check (S3776) #74
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Claude/backup-script:fix/issue-22-S3776-cmd-check-complexity"
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?
Closes #22
cmd_checkhad cognitive complexity 24 (SonarQube ceiling: 15).Refactor
Extracted
_check_one_repo(restic, repo, dest, args, log) -> boolcovering thetry/except around
restic.checkplus theresult.okbranching and logemission. The nested
cmd_checkloop body now reduces to a single line:if not _check_one_repo(...): failed += 1. No behavior change — same loggedevents (
check.ok,check.failed,check.exception), same exit code, samecounters.
Behavior
Identical.
Verification
pytest -q tests/unit/— passesmypy --strict src/gardien/core src/gardien/config src/gardien/engine src/gardien/steps— passesView 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.