Skip to content

refactor: replace clippy::too_many_arguments allows with config structs#308

Merged
vieiralucas merged 1 commit intomainfrom
worktree-cleanup+allow-too-many-args
Apr 12, 2026
Merged

refactor: replace clippy::too_many_arguments allows with config structs#308
vieiralucas merged 1 commit intomainfrom
worktree-cleanup+allow-too-many-args

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 12, 2026

Summary

All six #[allow(clippy::too_many_arguments)] sites in the codebase are replaced with named input structs that group the related parameters:

  • CloudFormationService::newCloudFormationDeps (8 sibling-state handles + delivery)
  • cognito::triggers::build_{create,verify}_auth_challenge_eventAuthChallengeContext
  • iam::xml_responses::assume_role_*AssumedRoleInfo
  • s3::logging::{format_access_log_entry,maybe_write_access_log}AccessLogRequest
  • s3::service::notifications::deliver_notificationsObjectEvent
  • sns::service::build_sns_lambda_eventSnsLambdaEventInput
  • dynamodb::service::build_table_description_jsonTableDescriptionInput

Every 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 --workspace
  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --exclude fakecloud-e2e --exclude fakecloud-conformance — 1102 passed, 0 failed
  • grep: zero remaining #[allow(clippy::too_many_arguments)] attributes in crates/
  • CI green

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

    • CloudFormation: CloudFormationService::new now takes CloudFormationDeps.
    • Cognito triggers: build_create_auth_challenge_event and build_verify_auth_challenge_event take AuthChallengeContext.
    • IAM STS XML: assume_role_* responses take AssumedRoleInfo.
    • S3 logging: format_access_log_entry and maybe_write_access_log take AccessLogRequest.
    • S3 notifications: deliver_notifications takes ObjectEvent.
    • SNS: build_sns_lambda_event takes SnsLambdaEventInput.
    • DynamoDB: build_table_description_json takes TableDescriptionInput.
  • Migration

    • Update external call sites to construct the new input structs and pass them by reference.
    • Example: CloudFormationService::new(state, CloudFormationDeps { ... }).

Written for commit a10e4cc. Summary will update on new commits.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 14 files

@vieiralucas vieiralucas merged commit cfd4e0b into main Apr 12, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-cleanup+allow-too-many-args branch April 12, 2026 22:36
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.

1 participant