style(clippy): group shared args into PrVoteCtx in submit_pr_review.rs - #1719
Draft
github-actions[bot] wants to merge 1 commit into
Draft
Conversation
Both check_self_approval and submit_vote had 8 parameters, exceeding clippy::too_many_arguments limit of 7. Introduce a private PrVoteCtx struct to bundle the five shared fields (client, base_url, encoded_repo, pull_request_id, token), reducing each function to four parameters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
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.
What clippy found
Two functions in
src/safe_outputs/submit_pr_review.rsexceeded theclippy::too_many_argumentslimit (8/7):How it was fixed
Lint:
clippy::too_many_argumentsFix: Introduced a private
PrVoteCtx<'a>struct bundling the five shared parameters (client,base_url,encoded_repo,pull_request_id,token). Each function now takes the struct plus its two unique parameters, reducing argument count from 8 to 4.Files touched:
src/safe_outputs/submit_pr_review.rsVerification
cargo build --all-targets✅cargo test✅ (all tests pass)cargo clippy --all-targets --all-features --workspace -- -D warnings✅ (exit 0, no warnings)Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
spsprodeus21.vssps.visualstudio.comSee Network Configuration for more information.