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

[HOLD] Update code to use early return wherever appropriate #5997

Closed
wants to merge 2 commits into from

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Oct 22, 2021

Details

Added to the style guide when to identify that early returns should be preferred. It's something that we ask for a lot and is rarely explained.

Fixed Issues

$ #5995

Tests / QA Steps

All of these changes should be syntax and shouldn't have any bearing on the app behavior.
Therefore, we just need to run regular regressions.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this Oct 22, 2021
add a ton of scary early returns

roll back a few that seems wrong

undo a couple else if that seem wrong
@marcaaron marcaaron marked this pull request as ready for review October 22, 2021 01:43
@marcaaron marcaaron requested a review from a team as a code owner October 22, 2021 01:43
@MelvinBot MelvinBot requested review from timszot and removed request for a team October 22, 2021 01:43
@marcaaron
Copy link
Contributor Author

Actually gonna throw a hold on this one and put it back into draft. I feel confident about the other style fixes I'm making but this one is slightly riskier since it modifies control logic in a lot of places.

@marcaaron marcaaron marked this pull request as draft October 25, 2021 17:02
@marcaaron marcaaron changed the title Update code to use early return wherever appropriate [HOLD] Update code to use early return wherever appropriate Oct 25, 2021
@marcaaron
Copy link
Contributor Author

Decided to tackle this in #6174 instead. Wrote a custom linter for finding these usages.

@marcaaron marcaaron closed this Nov 3, 2021
@marcaaron marcaaron deleted the marcaaron-earlyReturn branch November 3, 2021 00:41
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