Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Exceeding column limit in comments #33246

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR34274
Status NEW
Importance P normal
Reported by Mikhail Artemyev (artemiev.mikhail@gmail.com)
Reported on 2017-08-22 01:24:57 -0700
Last modified on 2019-07-15 08:32:43 -0700
Version trunk
Hardware PC Linux
CC artemiev.mikhail@gmail.com, djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org, yvesg@google.com
Fixed by commit(s)
Attachments clangColLimBug.txt (1034 bytes, text/plain)
Blocks
Blocked by
See also
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
Quuxplusone commented 7 years ago

Attached clangColLimBug.txt (1034 bytes, text/plain): Same example as in the description but without broken lines

Quuxplusone commented 5 years ago
Another example:

<before.cc>

void WebRtcIlbcfix_HpInput(
    int16_t* signal, /* (i/o) signal vector */
    int16_t* ba,     /* (i)   B- and A-coefficients (2:nd order)
                              {b[0] b[1] b[2] -a[1] -a[2]}
                              a[0] is assumed to be 1.0 */
    bool dummy);

Formatting:

% clang-format --style='{ColumnLimit: 80}' before.cc > after.cc

<after.cc>

void WebRtcIlbcfix_HpInput(int16_t *ba, /* (i)   B- and A-coefficients (2:nd
                                           order) {b[0] b[1] b[2] -a[1] -a[2]}
                                                 a[0] is assumed to be 1.0 */
                           bool dummy);

Lines 3 and 4 exceed the column limit.

% awk '{print length;}' after.cc
69
80
86
81
39