<p dir="ltr">You can grep for " {$". With this regex I see no false positives and 272 case with 40 or more leading spaces</p>
<br><div class="gmail_quote"><div dir="ltr">On Sun, 28 Aug 2016, 17:59 Zachary Turner via lldb-dev, <<a href="mailto:lldb-dev@lists.llvm.org">lldb-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here it is<br><br><br>grep -n '^ \+' . -r -o | awk '{t=length($0);sub(" *$","");printf("%s%d\n", $0, t-length($0));}' | sort -t: -n -k 3 -r | awk 'BEGIN { FS = ":" } ; { if ($3 >= 50) print $0 }' <br><div class="gmail_quote"><div dir="ltr">On Sun, Aug 28, 2016 at 9:54 AM Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I tried that, but most of the results (and there are a ton to wade through) are function parameters that wrapped and align with the opening paren on the next line.<br><br>Earlier in the thread (i think it was this thread anyway) i posted a bash incantation that will grep the source tree and return all lines with >= N leading spaces sorted descending by number of leading spaces. The highest was about 160 :)<br><br>If you search lldb-dev for awk or sed you'll probably find it<br><div class="gmail_quote"><div dir="ltr">On Sun, Aug 28, 2016 at 9:10 AM Chris Lattner <<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Can you just grep for “^ “ or something? That seems like a straight-forward way to find lines that have a ton of leading indentation.</div><div style="word-wrap:break-word"><div><br></div><div>-Chris</div></div><div style="word-wrap:break-word"><div><br><div><blockquote type="cite"><div>On Aug 27, 2016, at 9:28 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br class="m_4062419399965320819m_-3491617429093256682m_-8751956870302239507Apple-interchange-newline"><div><div dir="ltr">It will probably be hard to find all the cases. Unfortunately clang-tidy doesn't have a "detect deep indentation" check, but that would be pretty useful, so maybe I'll try to add that at some point (although I doubt I can get to it before the big reformat).<div><br></div><div>Finding all of the egregious cases before the big reformat will present a challenge, so I'm not sure if it's better to spend effort trying, or just deal with it as we spot code that looks bad because of indentation level.</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Aug 27, 2016 at 9:24 AM Chris Lattner <<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Aug 26, 2016, at 6:12 PM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="m_4062419399965320819m_-3491617429093256682m_-8751956870302239507m_-6899933430770945279Apple-interchange-newline"><div><div dir="ltr">Back to the formatting issue, there's a lot of code that's going to look bad after the reformat, because we have some DEEPLY indented code. LLVM has adopted the early return model for this reason. A huge amount of our deeply nested code could be solved by using early returns. </div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>FWIW, early returns are part of the LLVM Coding standard:</div><div><a href="http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code" target="_blank">http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code</a></div><div><br></div><div>So it makes sense for LLDB to adopt this approach at some point.</div><div><br></div><div>I don’t have an opinion about whether it happens before or after the "big reformat", but I guess I agree with your point that doing it would be good to do it for the most egregious cases before the reformat.</div></div></div><div style="word-wrap:break-word"><div><div><br></div><div>-Chris</div></div></div></blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div></blockquote></div>
_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br>
</blockquote></div>