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

Refactoring if chains into switch statements #144905

Merged
merged 5 commits into from Mar 11, 2024

Conversation

nate-thegrate
Copy link
Member

@nate-thegrate nate-thegrate commented Mar 10, 2024

Based on issue #144903, this PR aims to bring the codebase more in line with the Flutter repo style guide:

Avoid using if chains or ?: or == with enum values


This change unfortunately increases the total line length, but it also improves readability.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: cupertino flutter/packages/flutter/cupertino repository d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: gestures flutter/packages/flutter/gestures repository. labels Mar 10, 2024
@nate-thegrate nate-thegrate marked this pull request as ready for review March 10, 2024 23:17
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 11, 2024
@auto-submit auto-submit bot merged commit 26e379e into flutter:master Mar 11, 2024
133 checks passed
@nate-thegrate nate-thegrate deleted the switch-statements branch March 11, 2024 23:15
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 12, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Mar 12, 2024
…6304)

Manual roll requested by tarrinneal@google.com

flutter/flutter@3bb2e59...1ca8873

2024-03-12 godofredoc@google.com Update integration tests regexes. (flutter/flutter#144847)
2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fail tests on exceptions raised after test completed (#144706)" (flutter/flutter#144970)
2024-03-11 polinach@google.com Make TabController communicating creation in constructor. (flutter/flutter#144912)
2024-03-11 goderbauer@google.com Fail tests on exceptions raised after test completed (flutter/flutter#144706)
2024-03-11 nate.w5687@gmail.com Refactoring `if` chains into `switch` statements (flutter/flutter#144905)
2024-03-11 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Expose build mode in environment of asset transformer processes (#144752)" (flutter/flutter#144957)
2024-03-11 andrewrkolos@gmail.com Expose build mode in environment of asset transformer processes (flutter/flutter#144752)
2024-03-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9196947bc687 to 6745955bb49e (2 revisions) (flutter/flutter#144946)
2024-03-11 vtrgalo@gmail.com Skip test temporarily until headingLevel is added in engine (issue 41� (flutter/flutter#135077)
2024-03-11 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3b0b59bb224d to 9196947bc687 (1 revision) (flutter/flutter#144934)
2024-03-11 engine-flutter-autoroll@skia.org Roll Packages from 0badb43 to d489d84 (3 revisions) (flutter/flutter#144931)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Mar 13, 2024
This pull request is part of the effort to solve issue #144903.

In the past, my efforts to reduce line length involved refactoring away from switch statements, but unlike [yesterday's PR](#144905), this one is full of switch statements that make things more concise!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino flutter/packages/flutter/cupertino repository f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants