Skip to content

style(clippy): group shared args into PrVoteCtx in submit_pr_review.rs - #1719

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer/too-many-arguments-submit-pr-review-17b24ba832eac752
Draft

style(clippy): group shared args into PrVoteCtx in submit_pr_review.rs#1719
github-actions[bot] wants to merge 1 commit into
mainfrom
clippy-fixer/too-many-arguments-submit-pr-review-17b24ba832eac752

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

What clippy found

Two functions in src/safe_outputs/submit_pr_review.rs exceeded the clippy::too_many_arguments limit (8/7):

error: this function has too many arguments (8/7)
   --> src/safe_outputs/submit_pr_review.rs:173:1
async fn check_self_approval(client, base_url, encoded_repo, pull_request_id, user_id, event, vote_value, token)

error: this function has too many arguments (8/7)
   --> src/safe_outputs/submit_pr_review.rs:233:1
async fn submit_vote(client, base_url, encoded_repo, encoded_user_id, pull_request_id, event, vote_value, token)

How it was fixed

Lint: clippy::too_many_arguments
Fix: 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.rs

Verification

  • 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.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Clippy Fixer · 69.5 AIC · ⌖ 12.4 AIC · ⊞ 8.5K ·

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

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants