[llvm-bugs] [Bug 34274] New: Exceeding column limit in comments

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Aug 22 01:24:57 PDT 2017


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

            Bug ID: 34274
           Summary: Exceeding column limit in comments
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: artemiev.mikhail at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

Example:

<before.cpp>

int main() {
   //Lore m  ipsum d olor si t amet,  cons ectetu r  adipisci ng elit. Nu, nc 
eu orci  ut j us to or
   //na re egest as si t  ame t  a nisl.  In .  hac habita sse  platea  dictu
mst . Nunc  at vel, it,  a  era t fe,
   //rm en tum porta .  Aenean  po rttito r congu.  e au gu e,  id m ol lis
eros ve stib u lum ut.  Du i s sit a met .
   return 0;
}

Formatting:

clang-format -style="{BasedOnStyle: LLVM, ColumnLimit: 85, IndentWidth: 3}"
before.cpp > after.cpp

<after.cpp>

     1  int main() {
     2     // Lore m  ipsum d olor si t amet,  cons ectetu r  adipisci ng elit.
Nu, nc  eu
     3     // orci  ut j us to or  na re egest as si t  ame t  a nisl.  In . 
hac habita sse
     4     // platea  dictu mst . Nunc  at vel, it,  a  era t fe,  rm en tum
porta .  Aenean
     5     // po rttito r congu.  e au gu e,  id m ol lis eros ve stib u lum
ut.  Du i s sit a
     6     // met .
     7     return 0;
     8  }

Line 5 exceeds the column limit.

awk '{print length;}' after.cpp
12
82
84
84
86
11
12
1

-- 
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/20170822/5fae2a89/attachment.html>


More information about the llvm-bugs mailing list