-
Notifications
You must be signed in to change notification settings - Fork 590
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
test(lints): add lint rw::await-in-loop #14013
Conversation
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
I'll try to eliminate false positive cases in the further PRs. Also I'll fix the true positive cases to improve the performance. |
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind sharing some results found by this lint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm. added some wording suggestions
lints/src/await_in_loop.rs
Outdated
/// This can't be concurrent | ||
/// | ||
/// ### Known problems | ||
/// Ignore it if your loop body must be executed sequentially or if it is not on the critical path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Ignore it if your loop body must be executed sequentially or if it is not on the critical path. | |
/// Can cause false positives. | |
/// | |
/// It is possible that the loop body must be executed sequentially. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"or if it is not on the critical path." I'm wondering whether the rewriting is beneficial for all situations. 🤔
// In most cases, a raw `loop` can't be concurrent. | ||
if !matches!(source, LoopSource::Loop) => | ||
{ | ||
if !is_from_async_await(ex.span) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this if
do? 👀
Signed-off-by: TennyZhuang <[email protected]>
|
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Co-authored-by: xxchan <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Signed-off-by: TennyZhuang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14013 +/- ##
==========================================
- Coverage 68.05% 67.97% -0.09%
==========================================
Files 1536 1536
Lines 265407 265407
==========================================
- Hits 180626 180411 -215
- Misses 84781 84996 +215
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This PR has been open for 60 days with no activity. Could you please update the status? Feel free to ping a reviewer if you are waiting for review. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Inspired by #13970
Found several bugs, also many false positive cases.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.