<div dir="ltr"><div dir="ltr">All<div><br></div><div>I've recently been doing some work in the clang-tidy module,  <a href="https://reviews.llvm.org/D55523">https://reviews.llvm.org/D55523</a></div><div><br></div><div>I had noticed that a lot of code review comments in that area came about because of inconsistent style in the .rst documentation </div><div><br></div><div>I wrote a small python script to check the documentation for simple errors like </div><div>  - double blank lines</div><div>  - double spaces</div><div>  - empty last lines</div><div>  - trailing spaces</div><div>  - inconsistent markup and headers above</div><div><br></div><div>It was only later that I noticed these problems were actually universal across all of LLVM, both in llvm/docs and llvm/tools/clang/docs and not just in llvm/tools/clang/tools/extra/docs</div><div><br></div><div><div>Its definitely not a full sphinx parser so I'm sure it would go wrong from time to time, but globally in llvm it found 1000s of minor errors in rst files all across the llvm tree</div></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><br></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">$ find . -name '*.rst' -exec ./tools/clang/tools/extra/clang-tidy/validate_check.py --no-maximize --rst {} \; | grep warning | wc -l</p></div></div><div><div><div class="gmail-remarkup-code-block" style="margin:12px 0px;padding:0px;border:0px;white-space:pre;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px"><pre class="gmail-remarkup-code" style="margin-top:0px;margin-bottom:0px;padding:12px;border:0px;background:rgba(71,87,120,0.08);overflow:auto;border-radius:3px;white-space:pre-wrap;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:12px;line-height:15px;font-family:Menlo,Consolas,Monaco,monospace">14172</pre></div></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">Gave 14,000+ warnings across the entire LLVM tree</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">6231 - line is in excess of 80 characters</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">4774 - line contains double spaces</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">1528 - line multiple blank lines</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">1078 - line trailing whitespace</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">484 - title and markup non matching lengths</p></div></div><div><div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(0,0,0);font-family:"Segoe UI","Segoe UI Emoji","Segoe UI Symbol",Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px">81 - empty lines at the end of the file (almost 16% of all .rst files)</p></div></div></blockquote><div dir="ltr"><div><br></div><div>I think those doing code reviews over in clang-tidy would like developers of new checkers to check their rst files as part of the build process, and for those sorts of warning to be "on them" at build time and not on the reviewer</div><div><br></div><div>As I've looked at this more holistically I see value in something simpler for all of llvm,</div><div><br></div><div>1) is this something people care about?</div><div>2) are code review comments regarding the state of the rst files common in other areas?</div><div>3) where would such a tool go (llvm/lnt hasn't had a commit since 2009)?</div><div>4) how would we (if at all) bring such warnings into the build system, if desired?</div><div><br></div><div>Is there someone I should speak to regarding the wider llvm tooling? (I couldn't find anything in CODE_OWNERS.txt that would point me to who owns that.)</div><div><br></div><div>I realize changing a few .rst files isn't pushing the envelop of LLVM/clang, but perhaps for those of us without the skills yet to dive in and write a new backend, its something we can contribute to.</div><div><br></div><div>Comments and any Feedback are welcome</div><div><br></div><div>MyDeveloperDay</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>