-
Notifications
You must be signed in to change notification settings - Fork 39
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
chore: Review and Update Analysis Rules #99
Comments
Looks like we need to be evaluating the rules that were added from Aug 30th 2023 and forward. This lines up with the v5.1.0 release. |
These are my views about the new rules introduced in Dart 3.4:
Regarding #90, I do think we should include no_wildcard_variable_uses as soon as possible. It is not only marked as
It was also suggested to add |
Here's my opinion on some rules that we can add:
I also agree with the reasons provided by @alestiago to add missing_code_block_language_in_doc_comment, no_wildcard_variable_uses and no_self_assignments. To try and help fill the table about the reasons why are not using some rules, I can add the following:
|
@jsgalarraga regarding the two suggested rules you would like to get included, have you found any issues about them not performing as expected? I think they are useful, but they don't seem to be tagged as "recommened", "style:fluter" or "style:core", do you know why?
I've added some of the given reasons to the table, thank you so much!
Regarding do_not_use_environment I've tried gathering more information before we have a solid reason. So, the rule doesn't catch However, I'm currently unsure about the scenarios where
There is also a blog "Configuring apps with compilation environment declarations" about such environment variables, but it mainly explains If we look at the original proposal of the lint rule, dart-lang/sdk#58165 a Dart team member (rakudrama) commented:
To which I tend to incline towards due to the tree-shaking benefit. In occasions, Knowing the above, regarding "We intentionally use environment variables to retrieve keys and other sensitive data." do you do so with P.S. I'm still evaluating the avoid_classes_with_only_static_members reason. After reading through dart-lang/core#823 I'm a bit skeptical on adding unnecessary_library_name, it seems that according to goderbauer comment:
It is unclear to me the where the current progress is on solving such issue. We could go forward with it and simply recommend users to rename their files or, if previously pointing to a path that no longer exists, updating such path. At the end of the day, the rule does align with Effective Dart. On the other hand, it might be worth waiting a bit too see where dart-lang/core#823 ends up. |
I've found this issue regarding the avoid_catches_without_on_clauses which had some false positives and apparently is now getting fixed in dart 3.5.0. I assume this is the reason why is not tagged as "recommended", but I agree with the reasons to add it mentioned here. Maybe we can track this and wait until the rule is more robust. Regarding no_literal_bool_comparisons, haven't found any issues and no idea why is not "recommended" since Effective Dart has that use case outlined 🤔 . About do_not_use_environment, I didn't know that the rule allowed the
Therefore I agree with the comment of the dart team member you shared. Regarding unnecessary_library_name, 100% agree with you, with that issue tracking if it's going to be added to "recommended", I would follow closely and update very good analysis when that issue is solved. |
|
Regarding do_not_use_environment, I find it confusing. One reason to prefer The reason to choose one over the other is whether you are passing the environment variable as a For example, if I run this command to run my app:
I think that both of these serve a purpose and have use cases. |
Thanks @jsgalarraga and @lishaduck I've updated the table and have a matching Pull Request #102 that updates the README table. I've added both of you as co-authors of the reasons you've found so that you are counted as contributors. |
Closing since v6.0.0 has been released. As per usual we're always open to reviewing some rules, if so, don't hesitate on telling us by opening an issue. |
Is your feature request related to a problem? Please describe.
We have a couple of tickets around adding new analysis rules in. We need to actually inventory the current rule set, when it was last reviewed, and what is new since then to determine what we want to actually add in.
Describe the solution you'd like
Describe alternatives you've considered
None
Additional context
Other tickets asking for new rules
Linter rules Documentation - https://dart.dev/tools/linter-rules
Also seems like the "added in" documentation may be moved into each lint documentation page itself rather then an overview page.
The text was updated successfully, but these errors were encountered: