For loops like "for (...) {}", check-webkit-style thinks the opened brace isn't closed and produces a false alarm for the close brace in two lines below. void foo() { for (int i = 0; i < 100; i++) { } return; } // check-webkit-style thinks this close brace corresponds to the open brace after "for (...)" . test.cpp:5: One line control clauses should not use braces. [whitespace/braces] [4] Total errors found: 1 in 1 files See Bug 35557 for a real example.
Created attachment 49984 [details] Patch v1
Comment on attachment 49984 [details] Patch v1 I'm not sure I understand. Why would one ever want if (foo) {}? Can you point to the style guide as to where this is documented? Or maybe the tests just need to be changed to use for or while.
Created attachment 50080 [details] Patch v2
> Can you point to the style guide as to where this is documented? Or maybe the > tests just need to be changed to use for or while. Oops! Yes, we need to use for or while to make the tests reasonable. Thanks for catching this.
Comment on attachment 50080 [details] Patch v2 OK. "while (condition)" would still be better with a real example of a useful "condition", but this looks OK.
Attachment 50080 [details] was posted by a committer and has review+, assigning to Shinichiro Hamaji for commit.
Committed r55656: <http://trac.webkit.org/changeset/55656>