-
Notifications
You must be signed in to change notification settings - Fork 159
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
Lint on unawaited futures #731
Comments
Related to discarded_futures: dart-lang/linter#3739 |
Expanding on that: Zixuan and I looked at the output of this lint rule yesterday, and found that it probably won't make sense for us to turn it on.
|
This brings the file test/api/core_test.dart up to being clean against the `unawaited_futures` lint rule, toward zulip#731. It does so with a smaller diff, and simpler resulting code, than by adding `await` on each of the futures. For comparison: zulip#934 (comment)
This brings the file test/api/core_test.dart up to being clean against the `unawaited_futures` lint rule, toward zulip#731. It does so with a smaller diff, and simpler resulting code, than by adding `await` on each of the futures. For comparison: zulip#934 (comment)
This brings the file test/api/core_test.dart up to being clean against the `unawaited_futures` lint rule, toward zulip#731. It does so with a smaller diff, and simpler resulting code, than by adding `await` on each of the futures. For comparison: zulip#934 (comment)
This brings the file test/api/core_test.dart up to being clean against the `unawaited_futures` lint rule, toward zulip#731. It does so with a smaller diff, and simpler resulting code, than by adding `await` on each of the futures. For comparison: zulip#934 (comment)
Partially fixes: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
Fixes-partly: zulip#731 Signed-off-by: Zixuan James Li <[email protected]>
There's a pair of lint rules in the Dart analyzer that detect when we have a Future and neglect to await it:
https://dart.dev/tools/linter-rules/unawaited_futures
https://dart.dev/tools/linter-rules/discarded_futures
(Despite the name,
unawaited_futures
doesn't cover one major class of unawaited futures: those where the enclosing function isn't evenasync
. Those are covered bydiscarded_futures
.)It'd be good to enable those. The bugs they catch can be pretty subtle otherwise.
The text was updated successfully, but these errors were encountered: