-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Modernize framework lints #179089
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
Modernize framework lints #179089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the linting rules in analysis_options.yaml, notably enabling omit_obvious_local_variable_types and disabling always_specify_types. The bulk of the changes across the codebase are the result of applying dart fix --apply with these new rules, which primarily involves removing explicit type annotations for local variables where the type can be inferred. The changes are consistent and correctly apply the new linting rules, improving code conciseness while maintaining readability. I have reviewed the changes and found no issues.
| @@ -1,6 +1,11 @@ | |||
| # This file is also used by dev/bots/analyze_snippet_code.dart to analyze code snippets (`{@tool snippet}` sections). | |||
|
|
|||
| include: ../../analysis_options.yaml #TODO(Piinks): Replace with flutter_lints after pub roll. | |||
| # include: ../../analysis_options.yaml #TODO(Piinks): Replace with flutter_lints - separate change. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@loic-sharma FYI I put this here for now to exclude examples/api from analysis here for now.
|
Also todo, need to run dart fix in engine/src/flutter after all. Filed #179092 for follow up. |
|
Working through issues in engine/ now. |
|
CI had a failure that stopped further tests from running. We need to investigate to determine the root cause. SHA at time of execution: e60b21f. Possible causes:
A blank commit, or merging to head, will be required to resume running CI for this PR. Error Details: Stack trace: |
|
Confirmed with @chingjun we can merge this over the Google testing failure (this big'un scrambled it a bit). |
flutter/flutter@3f553f6...7b98d50 2025-11-26 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix for win32 embedder failing to send all alt key downs to the flutter app (#179097)" (flutter/flutter#179136) 2025-11-26 matt.kosarek@canonical.com Fix for win32 embedder failing to send all alt key downs to the flutter app (flutter/flutter#179097) 2025-11-26 katelovett@google.com Modernize framework lints (flutter/flutter#179089) 2025-11-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add framework-side hitTestBehavior support to Semantics (#178817)" (flutter/flutter#179100) 2025-11-25 zhongliu88889@gmail.com Add framework-side hitTestBehavior support to Semantics (flutter/flutter#178817) 2025-11-25 engine-flutter-autoroll@skia.org Roll Packages from e019cf9 to cc3dca6 (1 revision) (flutter/flutter#179081) 2025-11-25 matt.kosarek@canonical.com Add tooltip windows to the windowing API alongside the window positioning logic (flutter/flutter#177404) 2025-11-25 matt.kosarek@canonical.com FlutterWindowsView::SendWindowMetrics now reliably sends the display_id (flutter/flutter#179053) 2025-11-25 31859944+LongCatIsLooong@users.noreply.github.com Remove semantics geometry shortcircuit (flutter/flutter#178680) 2025-11-25 bruno.leroux@gmail.com Add an assert message when OverlayEntry.remove is called twice (flutter/flutter#178163) 2025-11-25 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from pOO9Jl9HTLsEmks6y... to nzuAxCJGeJbkZCTkr... (flutter/flutter#179066) 2025-11-25 okorohelijah@google.com Dynamically set MinimumOSVersion in App.framework (flutter/flutter#178253) 2025-11-25 engine-flutter-autoroll@skia.org Roll Skia from d83c30b090f4 to 925c311f4b37 (2 revisions) (flutter/flutter#179060) 2025-11-25 fluttergithubbot@gmail.com Marks Linux build_android_host_app_with_module_aar to be unflaky (flutter/flutter#174864) 2025-11-25 fluttergithubbot@gmail.com Marks Linux_mokey complex_layout__start_up to be unflaky (flutter/flutter#174865) 2025-11-25 vegorov@google.com Manual Dart SDK roll to 3.11.0-169.0.dev (flutter/flutter#179054) 2025-11-25 katelovett@google.com Bump Dart to 3.9 (flutter/flutter#179041) 2025-11-25 engine-flutter-autoroll@skia.org Roll Skia from e298c2f93ebf to d83c30b090f4 (2 revisions) (flutter/flutter#179058) 2025-11-24 30870216+gaaclarke@users.noreply.github.com updated licenses_cpp readme (flutter/flutter#178874) 2025-11-24 engine-flutter-autoroll@skia.org Roll Skia from 43d2020be565 to e298c2f93ebf (5 revisions) (flutter/flutter#179046) 2025-11-24 116356835+AbdeMohlbi@users.noreply.github.com Refactor `_isLabel` method in `stepper.dart` to use `any` for better readablity (flutter/flutter#178909) 2025-11-24 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 5 to 6 in the all-github-actions group (flutter/flutter#179049) 2025-11-24 38378650+hgraceb@users.noreply.github.com Disposes test restoration manager when accessed by bindings (flutter/flutter#176519) 2025-11-24 bkonyi@google.com [ Widget Preview ] Always generate scaffold under `$TMP` (flutter/flutter#179039) 2025-11-24 engine-flutter-autoroll@skia.org Roll Packages from e67b6be to e019cf9 (9 revisions) (flutter/flutter#179035) 2025-11-24 1063596+reidbaker@users.noreply.github.com Update CHANGELOG.md for Flutter 3.38.3 (flutter/flutter#178935) 2025-11-24 116356835+AbdeMohlbi@users.noreply.github.com Remove unnecessary `String.valueOf` in `SettingsChannel.java` (flutter/flutter#178590) 2025-11-24 katelovett@google.com Roll pub manually, pick up flutter_lints in examples/api (flutter/flutter#179030) 2025-11-24 engine-flutter-autoroll@skia.org Roll Dart SDK from 24cc9a740bd3 to afca43095efa (1 revision) (flutter/flutter#179019) 2025-11-24 zezohassam@gmail.com Pass EXCLUDED_ARCHS from Xcode project to xcodebuild for macOS builds (flutter/flutter#176948) 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 bmparr@google.com,stuartmorgan@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
WIP Commits separated as follows: - Update lints in analysis_options files - Run `dart fix --apply` - Clean up leftover analysis issues - Run `dart format .` in the right places. Local analysis and testing passes. Checking CI now. Part of flutter#178827 - Adoption of flutter_lints in examples/api coming in a separate change (cc @loic-sharma) ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
WIP Commits separated as follows: - Update lints in analysis_options files - Run `dart fix --apply` - Clean up leftover analysis issues - Run `dart format .` in the right places. Local analysis and testing passes. Checking CI now. Part of flutter#178827 - Adoption of flutter_lints in examples/api coming in a separate change (cc @loic-sharma) ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Updates lint in flutter/flutter
Commits separated as follows:
dart fix --applydart format .in the right places.Part of #178827
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.