[GH-ISSUE #2228] [FR] add prefer_final_fields, prefer_final_in_for_each, prefer_final_locals, prefer_final_parameters to analysis_options.yaml #914

Closed
opened 2026-03-23 20:43:01 +00:00 by mirror · 7 comments
Owner

Originally created by @LucasXu0 on GitHub (Apr 10, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2228

Originally assigned to: @yatendra2001 on GitHub.

https://github.com/AppFlowy-IO/AppFlowy/pull/2219/files#diff-821d01a41fc10f7b1d262ae67e55c3c7592a44b0692999b99207dfaaac1dce66R291

  • adding the above rules to analysis_options.yaml.
  • formatting the exsittng code in the same PR.
Originally created by @LucasXu0 on GitHub (Apr 10, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2228 Originally assigned to: @yatendra2001 on GitHub. https://github.com/AppFlowy-IO/AppFlowy/pull/2219/files#diff-821d01a41fc10f7b1d262ae67e55c3c7592a44b0692999b99207dfaaac1dce66R291 * adding the above rules to analysis_options.yaml. * formatting the exsittng code in the same PR.
Author
Owner

@yatendra2001 commented on GitHub (Jun 4, 2023):

Hey @LucasXu0 @annieappflowy , I would like to work on this issue, can you assign it to me?

<!-- gh-comment-id:1575473578 --> @yatendra2001 commented on GitHub (Jun 4, 2023): Hey @LucasXu0 @annieappflowy , I would like to work on this issue, can you assign it to me?
Author
Owner

@LucasXu0 commented on GitHub (Jun 5, 2023):

Sure, @yatendra2001.

<!-- gh-comment-id:1575944988 --> @LucasXu0 commented on GitHub (Jun 5, 2023): Sure, @yatendra2001.
Author
Owner

@yatendra2001 commented on GitHub (Jun 5, 2023):

@LucasXu0 I need to create a new PR right?

<!-- gh-comment-id:1576067483 --> @yatendra2001 commented on GitHub (Jun 5, 2023): @LucasXu0 I need to create a new PR right?
Author
Owner

@yatendra2001 commented on GitHub (Jun 5, 2023):

@LucasXu0 Opened a PR for this issue at #2708

<!-- gh-comment-id:1576136449 --> @yatendra2001 commented on GitHub (Jun 5, 2023): @LucasXu0 Opened a PR for this issue at #2708
Author
Owner

@yatendra2001 commented on GitHub (Jun 5, 2023):

Okay, I need to fix the formatting of the code in this PR as well right?

so it passes the flutter analyzer?

<!-- gh-comment-id:1576145405 --> @yatendra2001 commented on GitHub (Jun 5, 2023): Okay, I need to fix the formatting of the code in this PR as well right? so it passes the flutter analyzer?
Author
Owner

@yatendra2001 commented on GitHub (Jun 5, 2023):

Do you know an automated way to achieve that?
There are more than 5k+ lines and manually adding the final to each parameter doesn't seem feasible.

<!-- gh-comment-id:1576150347 --> @yatendra2001 commented on GitHub (Jun 5, 2023): Do you know an automated way to achieve that? There are more than 5k+ lines and manually adding the final to each parameter doesn't seem feasible.
Author
Owner

@LucasXu0 commented on GitHub (Jun 5, 2023):

Yep. You should format the code as well. You can use dart fix --apply for most cases.

<!-- gh-comment-id:1576552298 --> @LucasXu0 commented on GitHub (Jun 5, 2023): Yep. You should format the code as well. You can use `dart fix --apply` for most cases.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#914
No description provided.