[llvm-bugs] [Bug 40840] New: clang-format violates WebKit: braces empty block

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 24 00:17:52 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40840

            Bug ID: 40840
           Summary: clang-format violates WebKit: braces empty block
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rodionmalino at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Formatting using webkit style violates style guide
https://webkit.org/code-style-guidelines/#braces-empty-block

config:
Language: Cpp
BasedOnStyle: WebKit

1) Case with empty block
having 
for (int i = 0; i < 0; ++i, doBar()) { }
after formatting I've got
for (int i = 0; i < 0; ++i, doBar()) {
} 

2) Case with empty function body. Strictly speaking I wasn't able to find exact
requirement for this but I've got warning from linter (check-webkit-style)

having
void Foo() { }
after formating I've got
void Foo() {}

warning is
Missing space inside { }.  [whitespace/braces] [5]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190224/683017d4/attachment.html>


More information about the llvm-bugs mailing list