refactor: replace clippy::too_many_arguments allows with config structs#308
Merged
vieiralucas merged 1 commit intomainfrom Apr 12, 2026
Merged
Conversation
Each of the six sites where a function was carrying
``#[allow(clippy::too_many_arguments)]`` is replaced with a named input
struct. The structs group related parameters and give each call site
labelled fields, which makes it much harder to mix up argument order
and removes the need to suppress the lint.
- ``CloudFormationService::new`` now takes a ``CloudFormationDeps``
bundle of the eight sibling-service state handles instead of ten
positional arguments.
- ``cognito::triggers::build_{create,verify}_auth_challenge_event``
now take an ``AuthChallengeContext`` for pool/user identity.
- ``iam::xml_responses::assume_role_response`` (and the WebIdentity /
SAML variants) now take an ``AssumedRoleInfo`` bundle.
- ``s3::logging::{format_access_log_entry,maybe_write_access_log}``
now take an ``AccessLogRequest`` for the per-request fields.
- ``s3::service::notifications::deliver_notifications`` now takes an
``ObjectEvent`` bundle for event metadata.
- ``sns::service::build_sns_lambda_event`` now takes an
``SnsLambdaEventInput`` bundle.
- ``dynamodb::service::build_table_description_json`` now takes a
``TableDescriptionInput`` bundle of the eleven fields it needs.
No behavior change; unit tests still pass (1102 green).
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.
Summary
All six
#[allow(clippy::too_many_arguments)]sites in the codebase are replaced with named input structs that group the related parameters:CloudFormationService::new→CloudFormationDeps(8 sibling-state handles + delivery)cognito::triggers::build_{create,verify}_auth_challenge_event→AuthChallengeContextiam::xml_responses::assume_role_*→AssumedRoleInfos3::logging::{format_access_log_entry,maybe_write_access_log}→AccessLogRequests3::service::notifications::deliver_notifications→ObjectEventsns::service::build_sns_lambda_event→SnsLambdaEventInputdynamodb::service::build_table_description_json→TableDescriptionInputEvery call site now uses labeled fields instead of a long positional list, which makes argument-order mistakes much harder to introduce.
Test plan
cargo build --workspacecargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --exclude fakecloud-e2e --exclude fakecloud-conformance— 1102 passed, 0 failed#[allow(clippy::too_many_arguments)]attributes incrates/Summary by cubic
Replaced all remaining clippy “too many arguments” sites with small input structs. This shortens function signatures, makes call sites safer with named fields, and keeps behavior unchanged.
Refactors
CloudFormationService::newnow takesCloudFormationDeps.build_create_auth_challenge_eventandbuild_verify_auth_challenge_eventtakeAuthChallengeContext.assume_role_*responses takeAssumedRoleInfo.format_access_log_entryandmaybe_write_access_logtakeAccessLogRequest.deliver_notificationstakesObjectEvent.build_sns_lambda_eventtakesSnsLambdaEventInput.build_table_description_jsontakesTableDescriptionInput.Migration
CloudFormationService::new(state, CloudFormationDeps { ... }).Written for commit a10e4cc. Summary will update on new commits.