[GH-ISSUE #2225] [FR] Add the rules to analysis_options.yaml based on AppFlowy Flutter Style Guide #911

Closed
opened 2026-03-23 20:42:58 +00:00 by mirror · 10 comments
Owner

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

Originally assigned to: @literalEval on GitHub.

Description

We should add rules to analysis_options.ymal, located in frontend/analysis_options.yaml, based on AppFlowy Flutter Style Guide

Impact

This will help format the code and reduce the time required for code reviewing.

Additional Context

Reference

Please DO NOT close this issue. We will keep this issue open to continue discussing which rules should be added.

Originally created by @LucasXu0 on GitHub (Apr 10, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2225 Originally assigned to: @literalEval on GitHub. ### Description We should add rules to `analysis_options.ymal`, located in `frontend/analysis_options.yaml`, based on [AppFlowy Flutter Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [x] #2226 - [x] #2228 ### Impact This will help format the code and reduce the time required for code reviewing. ### Additional Context #### Reference * https://dart-lang.github.io/linter/lints/index.html * https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides **Please DO NOT close this issue**. We will keep this issue open to continue discussing which rules should be added.
Author
Owner

@literalEval commented on GitHub (Apr 20, 2023):

I would like to work on this issue @annieappflowy @LucasXu0
Please assign this to me :)

<!-- gh-comment-id:1516010395 --> @literalEval commented on GitHub (Apr 20, 2023): I would like to work on this issue @annieappflowy @LucasXu0 Please assign this to me :)
Author
Owner

@annieappflowy commented on GitHub (Apr 21, 2023):

Assigned! Thanks for offering the help.

<!-- gh-comment-id:1517370799 --> @annieappflowy commented on GitHub (Apr 21, 2023): Assigned! Thanks for offering the help.
Author
Owner

@literalEval commented on GitHub (Apr 22, 2023):

@LucasXu0 I plan to add each option in a separate PR. Is that fine?

<!-- gh-comment-id:1518520014 --> @literalEval commented on GitHub (Apr 22, 2023): @LucasXu0 I plan to add each option in a separate PR. Is that fine?
Author
Owner

@a-wallen commented on GitHub (Jul 5, 2023):

@LucasXu0 let's add one to document all public classes, methods, etc.

<!-- gh-comment-id:1620969634 --> @a-wallen commented on GitHub (Jul 5, 2023): @LucasXu0 let's add one to document all public classes, methods, etc.
Author
Owner

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

@LucasXu0 let's add one to document all public classes, methods, etc.

This one? https://dart.dev/tools/linter-rules/public_member_api_docs

<!-- gh-comment-id:1620970652 --> @LucasXu0 commented on GitHub (Jul 5, 2023): > @LucasXu0 let's add one to document all public classes, methods, etc. This one? https://dart.dev/tools/linter-rules/public_member_api_docs
Author
Owner

@a-wallen commented on GitHub (Jul 5, 2023):

Yes, that's the one. I wonder if there's a way that it will only apply to the PR diff rather than the whole repo.

<!-- gh-comment-id:1620972607 --> @a-wallen commented on GitHub (Jul 5, 2023): Yes, that's the one. I wonder if there's a way that it will only apply to the PR diff rather than the whole repo.
Author
Owner

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

It seems that there's no way to apply only to the diff.

<!-- gh-comment-id:1620978944 --> @LucasXu0 commented on GitHub (Jul 5, 2023): It seems that there's no way to apply only to the diff.
Author
Owner

@a-wallen commented on GitHub (Jul 5, 2023):

734 members to document, so maybe it's best that we leave this off for now. cc @annieappflowy adding this lint will significantly help the documentation of the codebase.

<!-- gh-comment-id:1621002201 --> @a-wallen commented on GitHub (Jul 5, 2023): 734 members to document, so maybe it's best that we leave this off for now. cc @annieappflowy adding this lint will significantly help the documentation of the codebase.
Author
Owner

@literalEval commented on GitHub (Jul 9, 2023):

@LucasXu0

  1. If we use the Dart Linter directly, it is possible to check single/list of file(s). Maybe clone the linter repo during CI and run the tool ? Caching the repo will reduce the runtime in future.
  2. We can add ignore directive on top of each file in the repo, and just check if the file with a diff has the ignore directive or not. If it has, the PR check fails. If it doesn't have, the linter will do it's job anyway.

Though these alternatives will have the problem that even if the contributor changes a single line in the file, they will need to write documentation for the whole file.

<!-- gh-comment-id:1627663043 --> @literalEval commented on GitHub (Jul 9, 2023): @LucasXu0 1. If we use the Dart Linter directly, it is possible to check single/list of file(s). Maybe clone the linter repo during CI and run the tool ? Caching the repo will reduce the runtime in future. 2. We can add ignore directive on top of each file in the repo, and just check if the file with a diff has the ignore directive or not. If it has, the PR check fails. If it doesn't have, the linter will do it's job anyway. Though these alternatives will have the problem that even if the contributor changes a single line in the file, they will need to write documentation for the whole file.
Author
Owner

@LucasXu0 commented on GitHub (Jul 10, 2023):

I prefer to request that both us and the contributors write documentation during code reviews for now. Perhaps we can focus on documenting all the public functions or classes in the future. In my opinion, it is not a priority for this quarter.

<!-- gh-comment-id:1627967703 --> @LucasXu0 commented on GitHub (Jul 10, 2023): I prefer to request that both us and the contributors write documentation during code reviews for now. Perhaps we can focus on documenting all the public functions or classes in the future. In my opinion, it is not a priority for this quarter.
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#911
No description provided.