Summary: | Feature request: cpplint should check for braces - rule 3 | ||
---|---|---|---|
Product: | WebKit | Reporter: | Luciano Wolf <luciano.wolf> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW --- | ||
Severity: | Minor | CC: | kenneth, levin, manyoso |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | All |
Description
Luciano Wolf
2009-07-21 07:30:52 PDT
Actually I believe that we still have no code checking for "missing" braces. And this is basically not Qt specific, but a case of a single statement spanning multiply lines. Actually I just did the test: 3096 self.assert_multi_line_lint( 3097 'if (true)\n' 3098 ' myFunction(reallyLongParam1, reallyLongParam2,\n' 3099 ' reallyLongParam3);\n' 3100 '\n', 3101 '') and it didn't catch the error, this should be using { }. Yes the code was added for telling you when to not have them, but there was no coded added for telling you when to have them. Lu(In reply to comment #1) > Actually I believe that we still have no code checking for "missing" braces. > And this is basically not Qt specific, but a case of a single statement > spanning multiply lines. > > Actually I just did the test: > > 3096 self.assert_multi_line_lint( > 3097 'if (true)\n' > 3098 ' myFunction(reallyLongParam1, reallyLongParam2,\n' > 3099 ' reallyLongParam3);\n' > 3100 '\n', > 3101 '') > > and it didn't catch the error, this should be using { }. It is a good thing we have a little tool called a *compiler* to tell us that :) wink wink nudge nudge Notice, it is a SINGLE statement, spanning MULTIPLY lines :-) (In reply to comment #4) > Notice, it is a SINGLE statement, spanning MULTIPLY lines :-) Oopsie, i read it wrong. I see what you mean now. |