You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Niklas Nielsen <ni...@qni.dk> on 2013/10/09 17:59:27 UTC

Review Request 14559: C++ style checker

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

Review request for mesos, Benjamin Hindman and Ben Mahler.


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


Re: Review Request 14559: C++ style checker

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26879
-----------------------------------------------------------

Ship it!


nice!


support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52306>

    pull this down above the for loop.



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52307>

    Driver?


- Vinod Kone


On Oct. 10, 2013, 5:48 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, 5:48 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26983
-----------------------------------------------------------



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52550>

    Consider a 'yield path' here instead to make this a generator :)



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52549>

    How about just inlining the verify_source_roots code here?
    
    verify_source_roots returns a boolean and prints the error internally, and then main is responsible for exiting when False is returned. Since there are no other callers of verify_source_roots, perhaps we should inline it here and replace return False with exit(1)?


- Ben Mahler


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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Ben Mahler <be...@gmail.com>.

> On Oct. 14, 2013, 9:52 p.m., Ben Mahler wrote:
> > Thanks Niklas! I will commit this for you shortly.

This is now committed, please link MESOS-720 into this review and mark it resolved. If you would like to track the fixing of style issues in that ticket, we can do so as well!


- Ben


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26985
-----------------------------------------------------------


On Oct. 14, 2013, 9:43 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14559/
> -----------------------------------------------------------
> 
> (Updated Oct. 14, 2013, 9:43 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.

> On Oct. 14, 2013, 9:52 p.m., Ben Mahler wrote:
> > Thanks Niklas! I will commit this for you shortly.
> 
> Ben Mahler wrote:
>     This is now committed, please link MESOS-720 into this review and mark it resolved. If you would like to track the fixing of style issues in that ticket, we can do so as well!

Great! Thanks for the great comments Ben!


- Niklas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26985
-----------------------------------------------------------


On Oct. 14, 2013, 9:43 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14559/
> -----------------------------------------------------------
> 
> (Updated Oct. 14, 2013, 9:43 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26985
-----------------------------------------------------------

Ship it!


Thanks Niklas! I will commit this for you shortly.

- Ben Mahler


On Oct. 14, 2013, 9:43 p.m., Niklas Nielsen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14559/
> -----------------------------------------------------------
> 
> (Updated Oct. 14, 2013, 9:43 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

(Updated Oct. 14, 2013, 9:43 p.m.)


Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Changes
-------

Turn find_candidates method into generator and inline verify_source_roots


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 (updated)
-----

  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


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
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.


Changes
-------

Style and stderr stream fix


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 (updated)
-----

  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


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.

> 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26891
-----------------------------------------------------------


Much needed, thanks!


support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52321>

    For consistency with our other python code, can you kill the additional lines header and footer lines on your comments in this file?
    
    E.g.
    
    #
    # Currently, only tabs are checked.
    #
    
    becomes:
    
    # Currently, only tabs are checked.



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52323>

    s/"/'/ in this file



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52320>

    s/[ /[/



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52325>

    is the readlines() necessary? This should be a file object and hence iterable, no?



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52324>

    Can you add a comment as to why the flush is needed?



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52326>

    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?


- Ben Mahler


On Oct. 10, 2013, 7:45 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, 7:45 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

(Updated Oct. 10, 2013, 7:45 p.m.)


Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Changes
-------

Moved regex closer to use and cleaned comment.


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 (updated)
-----

  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


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

(Updated Oct. 10, 2013, 5:48 p.m.)


Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Changes
-------

Added missing period in comment.


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 (updated)
-----

  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


Re: Review Request 14559: C++ style checker

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26876
-----------------------------------------------------------

Ship it!


We could integrate it into Makefile.am in another review. Cool!


support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52282>

    Missing a period at the end of the sentence.


- Benjamin Hindman


On Oct. 10, 2013, 5:38 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, 5:38 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Niklas Nielsen <ni...@qni.dk>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

(Updated Oct. 10, 2013, 5:38 p.m.)


Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Changes
-------

camel case to snake case.


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 (updated)
-----

  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


Re: Review Request 14559: C++ style checker

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/#review26871
-----------------------------------------------------------



support/mesos-style.py
<https://reviews.apache.org/r/14559/#comment52268>

    We should stick to Python style (http://www.python.org/dev/peps/pep-0008) which prefers snake case (underscores) to camel case. (I didn't realize this and our scheduler/executor interfaces totally break this!).


- Benjamin Hindman


On Oct. 10, 2013, 4:52 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, 4:52 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
> 
>


Re: Review Request 14559: C++ style checker

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/14559/
-----------------------------------------------------------

(Updated Oct. 10, 2013, 4:52 p.m.)


Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.


Changes
-------

Added Vinod Kone as a reviewer.


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