Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor FXIOS-7301 [Swiftlint] Remove 1 closure_body_length violation from MainMenuState.swift and decrease threshold #23991

Merged

Conversation

ionixjunior
Copy link
Contributor

📜 Tickets

Jira ticket
Github issue

💡 Description

This PR removes 1 closure_body_length violation from the MainMenuState.swift file. Also, this PR decrease the warning and error threshold to 68.

This PR is part of a series of PRs described here #16442 (comment) and here #16442 (comment).

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@ionixjunior ionixjunior requested a review from a team as a code owner January 2, 2025 22:01
accountData: state.accountData,
accountIcon: state.accountIcon
)
return handleViewDidLoadAction(state: state)
Copy link
Collaborator

@FilippoZazzeroni FilippoZazzeroni Jan 7, 2025

Choose a reason for hiding this comment

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

It looks good to me, only thing i see that basically handleViewDidLoadAction and handleUpdateAccountHeaderAction implement the same state as default state.
@adudenamedruby what do you think if we default those 2 action directly in the default case ? so we can delete this two action and the related handle methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

handleUpdateAccountHeaderAction looks different because it's passing in the action, so it's not the same as handleViewDidLoadAction unless I'm missing something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah true sorry Rou i didn't see the action, yes then they are different. Then i guess we could leave it as is, so in case view did load action changes in the future, we already have the handler

Copy link
Contributor

@adudenamedruby adudenamedruby left a comment

Choose a reason for hiding this comment

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

I'll review this soon. I need to talk to some colleagues about thoughts on this, as, given this is a Redux pattern thing, we should try and be consistent, overall, about how we structure some of this stuff. There's nothing wrong with the PR, just a team discussion.

@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Jan 8, 2025

Messages
📖 Project coverage: 33.34%
📖 Edited 2 files
📖 Created 0 files

Client.app: Coverage: 32.4

File Coverage
MainMenuState.swift 80.13%

Generated by 🚫 Danger Swift against 021ae93

Copy link
Contributor

@adudenamedruby adudenamedruby left a comment

Choose a reason for hiding this comment

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

Heya @ionixjunior. So we've talked, and decided that we're good to go with the approach in this PR. There's just some minor changes needed and then we can push it through. THanks for your patience, and your hard work!!!

@adudenamedruby
Copy link
Contributor

@FilippoZazzeroni I'm going on PTO, if you wouldn't mind taking this over the finish line when @ionixjunior pushes their fixes

@ionixjunior ionixjunior force-pushed the issue_16442_part_XXXVIX branch from d974233 to 021ae93 Compare January 9, 2025 21:30
Copy link
Collaborator

@FilippoZazzeroni FilippoZazzeroni left a comment

Choose a reason for hiding this comment

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

LGMT 🎉 🎉 great work!!

@FilippoZazzeroni
Copy link
Collaborator

@ionixjunior i'm trying to find a way to merge this PR, since i see @adudenamedruby still needs to approve since it asked for changes in first place

@ionixjunior
Copy link
Contributor Author

@FilippoZazzeroni no worries at all, and thank you for letting me know.

@adudenamedruby
Copy link
Contributor

;)

@adudenamedruby adudenamedruby merged commit 702d491 into mozilla-mobile:main Jan 13, 2025
15 checks passed
@ionixjunior ionixjunior deleted the issue_16442_part_XXXVIX branch January 13, 2025 14:15
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.

4 participants