-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 a check for asserts on string literals #3346
Add a check for asserts on string literals #3346
Conversation
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.
Great stuff! Can you add a Changelog entry for this and some tests?
@PCManticore, is there any specific numbering to follow for the warning code? I have used |
@anubh-v To answer your question, the codes are usually tied to the checker, you cannot mix and match codes from one checker to another. Other than that, they should be unique so any code that's not taken should be good to go. And if your code was not unique, tests would have failed any way. |
Thank you for the PR! 🎉 |
Steps
doc/whatsnew/<current release.rst>
.Description
This PR adds a warning for assert statements that have string literals as their first argument.
Such assert statements will never fail.
Type of Changes
Related Issue
Fixes #3284