Updated analysis_options from flutter/flutter#11692
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the analysis_options.yaml file to synchronize with the Flutter repository, adding a formatter configuration with a 100-character page width and enabling several new linter rules such as annotate_redeclares and strict_top_level_inference. Review feedback indicates that the # not yet tested comment on the enabled omit_obvious_local_variable_types rule is misleading and should be removed. Additionally, the reviewer noted that several documentation links were broken by the introduction of relative paths and should be restored to absolute URLs.
| # - omit_local_variable_types # conflicts with specify_nonobvious_local_variable_types | ||
| - omit_obvious_local_variable_types | ||
| # - omit_local_variable_types # superset of omit_obvious_local_variable_types | ||
| - omit_obvious_local_variable_types # not yet tested |
There was a problem hiding this comment.
The lint omit_obvious_local_variable_types is enabled, but it is marked with a # not yet tested comment. In this file, this specific comment is consistently used for lints that are disabled (commented out) while awaiting verification. Since this lint was already active in the previous version of the configuration and remains enabled here, the comment is misleading and should be removed.
- omit_obvious_local_variable_types| - prefer_contains | ||
| # - prefer_double_quotes # opposite of prefer_single_quotes | ||
| # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods | ||
| # - prefer_expression_function_bodies # conflicts with ./docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods |
There was a problem hiding this comment.
The relative path ./docs/contributing/Style-guide-for-Flutter-repo.md is broken in the context of the flutter/packages repository, as the referenced documentation resides in the flutter/flutter repository. Please restore the absolute URL to ensure the link remains functional for contributors.
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods| - prefer_initializing_formals | ||
| - prefer_inlined_adds | ||
| # - prefer_int_literals # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#use-double-literals-for-double-constants | ||
| # - prefer_int_literals # conflicts with ./docs/contributing/Style-guide-for-Flutter-repo.md#use-double-literals-for-double-constants |
There was a problem hiding this comment.
The relative path ./docs/contributing/Style-guide-for-Flutter-repo.md is broken in this repository. This link should be restored to its absolute URL to point to the correct documentation in the flutter/flutter repository.
# - prefer_int_literals # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#use-double-literals-for-double-constants| # - prefer_double_quotes # opposite of prefer_single_quotes | ||
| # - prefer_expression_function_bodies # conflicts with ./docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods | ||
| - prefer_final_fields | ||
| # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/blob/master/docs/contributing/Style-guide-for-Flutter-repo.md#consider-using--for-short-functions-and-methods - prefer_final_fields |
There was a problem hiding this comment.
Why was prefer_final_fields pulled into this line and thus removed?
There was a problem hiding this comment.
Typo, thanks for catching that!
| # - omit_local_variable_types # conflicts with specify_nonobvious_local_variable_types | ||
| - omit_obvious_local_variable_types | ||
| # - omit_local_variable_types # superset of omit_obvious_local_variable_types | ||
| - omit_obvious_local_variable_types # not yet tested |
| - type_annotate_public_apis | ||
| - type_init_formals | ||
| - type_literal_in_constant_pattern | ||
| # - unawaited_futures # too many false positives, especially with the way AnimationController works |
There was a problem hiding this comment.
This is on, it's just in the wrong place. It's two lines down.
|
I'm not sure what's going on here, but most of the tests never ran. If you are changing the line length, you're going to have to reformat the entire repo in this PR otherwise CI will (when it actually runs) fail. |
|
@stuartmorgan-g Is that just a The reason why I'm doing this is that the code imported in #11669 is formatted according to the latest flutter/flutter analysis_options.yaml |
|
Changelog/version override: autoformat doesn't affect clients. |
|
The analysis options look good. What is going on with LUCI tests today |
It seems like we're supposed to keep analysis_options.dart in sync with the one in flutter/flutter, but we haven't done it since 2023. This PR updates it. The most disruptive change appears to be the increased page width.
I'm inspired to update this after working on #11669, which imports flutter/flutter code that is formatted according to the latest rules. Better to update the rules than to format the new code back to the old rules.