refactor: deduplicate optional variable checks - #797
Conversation
|
Hi @tomatotomata , thanks for the contribution. What are your plans to continue on this PR? After rebasing it, the failed CI will likely pass. |
|
I rebased the one-file refactor locally onto current upstream The focused checks on the rebased tree pass:
The implementation is unchanged apart from the rebased parent, so the failed CI should be worth rerunning against this history. Let me know what you think about the rebased result. |
dd7815c to
1241f66
Compare
1241f66 to
b8b7bee
Compare
gxmiranda
left a comment
There was a problem hiding this comment.
Clean, well-scoped refactoring that extracts the duplicated pipe-split-and-lookup pattern from two call sites in CheckVariables() into a shared groupSatisfied helper. Net -3 lines, single file, behavior-preserving. All CI checks pass. Aligns with issue #779 and Constitution Principle I (DRY).
This review was generated by /review-pr (AI-assisted).
Summary
Extract the duplicated pipe-splitting lookup used for optional target variable groups in
CheckVariablesinto a smallgroupSatisfiedhelper. The summary and verbose paths now share the same implementation, preserving the existing behavior while reducing maintenance surface.Closes #779
Validation
go test -count=1 ./internal/doctorgo vet ./internal/doctorgofmt -w internal/doctor/doctor.gogit diff --checkThe repository's full
go test -racecommand could not run locally because this Windows environment has no C compiler for cgo. The change is a pure refactor and the targeted package tests pass.I used AI assistance for this small refactor and reviewed the repository's AI tooling and contribution guidance.