Make windowing_test follow repo analyzer rules#184752
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the windowing integration tests by introducing const modifiers, improving type safety in JSON handling, and updating local variable declarations. The review feedback recommends using num for safer JSON numeric casting to double, consistently using Map<String, Object?> for decoded JSON, and adhering to the omit_local_variable_types style guideline by removing explicit types for local variables that were added or changed in this PR.
| ); | ||
| // We assume that this will cause a resize, which the current tests do. | ||
| final initialSize = controller.contentSize; | ||
| final Size initialSize = controller.contentSize; |
There was a problem hiding this comment.
Local variable types should be omitted when they can be inferred, following the repository's analysis rules (specifically the omit_local_variable_types lint) and Effective Dart guidelines.
| final Size initialSize = controller.contentSize; | |
| final initialSize = controller.contentSize; |
References
- Effective Dart: Style - DO omit types for local variables. (link)
There was a problem hiding this comment.
Doing this triggers the specify_nonobvious_local_variable_types lint.
| jsonEncode({'type': 'set_title', 'title': 'Hello World'}), | ||
| ); | ||
| final response = await _requestDataWithRetry( | ||
| final String response = await _requestDataWithRetry( |
There was a problem hiding this comment.
Omit the explicit String type for this local variable to adhere to the omit_local_variable_types lint rule being applied in this PR.
| final String response = await _requestDataWithRetry( | |
| final response = await _requestDataWithRetry( |
References
- Effective Dart: Style - DO omit types for local variables. (link)
There was a problem hiding this comment.
Doing this triggers the specify_nonobvious_local_variable_types lint.
| ); | ||
| var data = jsonDecode(response); | ||
| await _requestDataWithRetry(driver, jsonEncode({'type': 'set_fullscreen'})); | ||
| String response = await _requestDataWithRetry(driver, jsonEncode({'type': 'get_fullscreen'})); |
There was a problem hiding this comment.
Use var instead of an explicit type for local variables that are reassigned, in accordance with the omit_local_variable_types lint.
| String response = await _requestDataWithRetry(driver, jsonEncode({'type': 'get_fullscreen'})); | |
| var response = await _requestDataWithRetry(driver, jsonEncode({'type': 'get_fullscreen'})); |
References
- Effective Dart: Style - DO omit types for local variables. (link)
There was a problem hiding this comment.
Doing this triggers the specify_nonobvious_local_variable_types lint.
loic-sharma
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up!
flutter/flutter@05e0ae0...81c87ea 2026-04-09 [email protected] Remove last material dependency from cupertino tests (flutter/flutter#184781) 2026-04-09 [email protected] Roll Skia from 7c46cb639dba to 4d0f5389e131 (7 revisions) (flutter/flutter#184812) 2026-04-09 [email protected] Make `windowing_test` follow repo analyzer rules (flutter/flutter#184752) 2026-04-09 [email protected] Improve documentation of `frictionFactor` function (flutter/flutter#184509) 2026-04-09 [email protected] Roll Skia from d2b0bd12576a to 7c46cb639dba (1 revision) (flutter/flutter#184796) 2026-04-09 [email protected] Roll Fuchsia GN SDK from JLBh4Z9PKsjIJcqDU... to SEfYx3xgueX3aFAY3... (flutter/flutter#184797) 2026-04-09 [email protected] Fixed freeze flow (flutter/flutter#184793) 2026-04-09 [email protected] Roll pub packages (flutter/flutter#184795) 2026-04-09 [email protected] Roll Skia from e9ed4fc9f154 to d2b0bd12576a (36 revisions) (flutter/flutter#184791) 2026-04-08 [email protected] [Android] Allow sensitive content to gracefully fail when unregistering host before registering (flutter/flutter#184789) 2026-04-08 [email protected] Refactor: remove material from autocomplete_test, scrollable_restoration_test, semantics_tester_generate_test_semantics_expression_for_current_semantics_tree_test (flutter/flutter#184615) 2026-04-08 [email protected] Warn about the use of TestSemantics (flutter/flutter#184369) 2026-04-08 [email protected] Change freeze flow to pull_request_target (flutter/flutter#184785) 2026-04-08 [email protected] Update to the beta dart version for 3.44 branch cut. (flutter/flutter#184770) 2026-04-08 [email protected] [Dot shorthands] Migrate examples/api/test (flutter/flutter#183966) 2026-04-08 [email protected] [fuchsia] Give AOT runners the ability to copy FFI callback thunks. (flutter/flutter#184696) 2026-04-08 [email protected] Add await or ignore lint to invokeMethod callsites (flutter/flutter#182870) 2026-04-08 [email protected] Correctly handle failure to read /proc/self/exe link (flutter/flutter#184700) 2026-04-08 [email protected] Roll Skia from e264d870a380 to e9ed4fc9f154 (11 revisions) (flutter/flutter#184713) 2026-04-08 [email protected] Roll Packages from 5299279 to 0e0a032 (5 revisions) (flutter/flutter#184720) 2026-04-08 [email protected] Roll pub packages (flutter/flutter#184772) 2026-04-08 [email protected] Roll Fuchsia Linux SDK from 1rcChbOv4nSTVkUxs... to pDXMXRIjEHTw7B0sk... (flutter/flutter#184722) 2026-04-08 [email protected] Remove navigator_utils cross-imports from cupertino tests (flutter/flutter#184282) 2026-04-08 [email protected] Even more awaits v2 (flutter/flutter#184552) 2026-04-08 [email protected] Allow personal skills to be gitignored (flutter/flutter#184727) 2026-04-08 [email protected] [ci] mac_arm64 build_test re-enable shard 1 presubmit (flutter/flutter#184751) 2026-04-08 [email protected] Fix repo check on code freeze (flutter/flutter#184771) 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 [email protected],[email protected] 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
The `windowing_test` had an empty `analysis_options.yaml` file checked in that disabled the top-level analysis_options.yaml file and with it the repo-wide rule set. As far as I can tell, there isn't a good reason why the repo rules shouldn't apply here. This PR deletes the custom `analysis_options.yaml` file and makes the code adhere to the top-level rule set. Any violations were fixed by Gemini.
The
windowing_testhad an emptyanalysis_options.yamlfile checked in that disabled the top-level analysis_options.yaml file and with it the repo-wide rule set. As far as I can tell, there isn't a good reason why the repo rules shouldn't apply here. This PR deletes the customanalysis_options.yamlfile and makes the code adhere to the top-level rule set. Any violations were fixed by Gemini.