-
Notifications
You must be signed in to change notification settings - Fork 38
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
cpplint: Fails to warn about many brackets #40
Comments
That sounds reasonable. |
Alright, I'll make a pull request with the change later today. |
Another way would be changing the whitelist to be the specific string "= {" rather than the much broader " |
Fixes issue ros#40 where there were no warnings for the following common statements: ``` if (i == 0) { for (int i = 0; i < 10; i++) { while (i == 0) { ```
I think that method still runs into problems when an initializer is used in a for loop. I don't think that's common and it's an improvement over the current state, but I think my solution in #41 doesn't have that drawback. Let me know what you think, I can switch it if you'd prefer. |
Fixes #40. Warns if `{` not on its own line
The current brace check overlooks many instances of the braces being on the same line. This is due to the fact that in line 99 it suppresses any warnings where there is an
=
sign on the line. However, this occurs in many common cases:I think the best fix is to check if the
{
is preceded by a)
in which case it is likely one of the above. I don't think that would occur with a brace initializer.@mikepurvis Thoughts?
The text was updated successfully, but these errors were encountered: