-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add lint named implicit_saturating_sub #5427
Conversation
It would be good to write more tests for other types. There should be at least one example for every type where the lint should trigger and where it should not trigger. Also there should be tests for more than one expression in a block. Also a test where the Generally speaking, be creative with testing, write tests for as many edge cases you can think of and the run this lint on. Modify the linting code until only the things, that you think should get linted, are linted. |
I'm not sure if the lint should be applied on signed integers. And I'm not quite sure how to check the type(signed or unsigned integer) of the variable in the |
☔ The latest upstream changes (presumably #5438) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
NIT in test: Can you rename i_XX
to u_XX
for unsigned integers? This confused me for a bit.
Should I also be checking for |
Yes, this would be good. |
I think I've handled the symmetric if condition 😄 |
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.
Tests and impl look really good now!
Sorry for taking so long for the review. I don't have an excuse, just wasn't really motivated to review PRs recently. |
No problems 😃 |
I apologize for the unbelievably time consuming PR 😅. |
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.
Just some NITs left.
Can you squash some of the commits please? Everything else LGTM. |
@bors r=flip1995 |
📌 Commit 1c11035 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes: #5399
I've made a basic skeleton of the lint, would love more feedback on how to make it better.
changelog: Add lint [
implicit_saturating_sub
]