> On Oct. 10, 2013, 7:54 p.m., Ben Mahler wrote: > > support/mesos-style.py, line 153 > > <https://reviews.apache.org/r/14559/diff/3/?file=363418#file363418line153> > > > > Can this just be: > > > > for source_dir in source_dirs: > > run_lint(find_candidates(source_dir)) > > > > Or is it preferred to run cpplint.py just once?
cpplint.py aggregates final results if we run it once. > On Oct. 10, 2013, 7:54 p.m., Ben Mahler wrote: > > support/mesos-style.py, line 141 > > <https://reviews.apache.org/r/14559/diff/3/?file=363418#file363418line141> > > > > Can you add a comment as to why the flush is needed? It is not needed. I have killed it in the new patch. > On Oct. 10, 2013, 7:54 p.m., Ben Mahler wrote: > > support/mesos-style.py, line 138 > > <https://reviews.apache.org/r/14559/diff/3/?file=363418#file363418line138> > > > > is the readlines() necessary? This should be a file object and hence > > iterable, no? Good point. It also help printing errors while they are found (opposed to wait until all files has been processed). - Niklas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/14559/#review26891 ----------------------------------------------------------- On Oct. 10, 2013, 9:34 p.m., Niklas Nielsen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/14559/ > ----------------------------------------------------------- > > (Updated Oct. 10, 2013, 9:34 p.m.) > > > Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone. > > > Repository: mesos-git > > > Description > ------- > > To avoid style glitches, it would be handy to have a style checker to catch > the most common (and hard to find) errors such as whitespaces, tabs, line > widths and so forth. > While it is not likely to find a fully compatible style checker, Google's > cpplint can be configured to match a small subset of rules. > > This patch includes a wrapper, support/mesos-style.py, which runs cpplint on > mesos source (excluding 3rdparty libraries such as glog, protobuf, boost and > so on). > For now, only the whitespace/tab rule is active. When style errors gets > fixed, we can increase the verboseness of the applied rules. > > > Diffs > ----- > > support/cpplint.py PRE-CREATION > support/mesos-style.py PRE-CREATION > > Diff: https://reviews.apache.org/r/14559/diff/ > > > Testing > ------- > > # python support/mesos-style.py > Checking 322 files... > src/detector/detector.cpp:142: Tab found; better to use spaces > [whitespace/tab] [1] > src/detector/detector.cpp:143: Tab found; better to use spaces > [whitespace/tab] [1] > ... > 3rdparty/libprocess/src/test-master.cpp:47: Tab found; better to use spaces > [whitespace/tab] [1] > Total errors found: 85 > > > Thanks, > > Niklas Nielsen > >
