You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Alex Clemmer <cl...@gmail.com> on 2015/11/16 10:25:41 UTC
Review Request 40340: [WIP] Windows: Added Windows support to
`support/post-reviews.py`.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40340/
-----------------------------------------------------------
Review request for mesos, Artem Harutyunyan, Michael Hopcroft, Joris Van Remoortere, Joseph Wu, and Marco Massenzio.
Repository: mesos
Description
-------
Windows: Added Windows support to `support/post-reviews.py`.
Early draft of the update to the Windows-compatible `post-reviews.py`. I'd like to get early feedback from people in case this is entirely the wrong direction.
At the outset, I will say that the "right way" to do this would be to refactor `cppylint.py` and `post-reviews.py` entirely so that they are more modular (for example, make `post-reviews.py` function-oriented, instead of a pile of statements and expressions, and `cpplint.py` should be a module proper). I didn't do this the "right way" because it is blocking for our Windows friends. If it's really important to do this the "right way", we may need to break it into a couple reviews.
Note that the most questionable part of this is the point at which we redirect `stderr` in `cpplint.py` to a string capture it for use in `post-reviews.py`. This is certainly the quickest way to do it, but it is not the best -- the best way would be to refactor `cpplint.py` to be a module, at least, and to handle error logging in a more pluggable way. We aimed for the shortest diff because there are no tests for any of these scripts, and to be honest, I was afraid of changing them without tests.
Diffs
-----
.gitignore-template 90b6697d19a5e0a68805b23b587b362731a1df25
support/cpplint.py 6890e27f92603b025e25e4db01decf351c33c9a1
support/mesos-style.py 66b45692c3c04f68358b63d52e4d87934f241bd7
support/post-reviews.py 170be83aa6dca6e8175292169d78e8f7915f7e6e
Diff: https://reviews.apache.org/r/40340/diff/
Testing
-------
Thanks,
Alex Clemmer
Re: Review Request 40340: [WIP] Windows: Added Windows support to
`support/post-reviews.py`.
Posted by Mesos ReviewBot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40340/#review106630
-----------------------------------------------------------
Patch looks great!
Reviews applied: [40131, 40195, 40340]
All tests passed.
- Mesos ReviewBot
On Nov. 16, 2015, 9:25 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40340/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 9:25 a.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Michael Hopcroft, Joris Van Remoortere, Joseph Wu, and Marco Massenzio.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Added Windows support to `support/post-reviews.py`.
>
> Early draft of the update to the Windows-compatible `post-reviews.py`. I'd like to get early feedback from people in case this is entirely the wrong direction.
>
> At the outset, I will say that the "right way" to do this would be to refactor `cppylint.py` and `post-reviews.py` entirely so that they are more modular (for example, make `post-reviews.py` function-oriented, instead of a pile of statements and expressions, and `cpplint.py` should be a module proper). I didn't do this the "right way" because it is blocking for our Windows friends. If it's really important to do this the "right way", we may need to break it into a couple reviews.
>
> Note that the most questionable part of this is the point at which we redirect `stderr` in `cpplint.py` to a string capture it for use in `post-reviews.py`. This is certainly the quickest way to do it, but it is not the best -- the best way would be to refactor `cpplint.py` to be a module, at least, and to handle error logging in a more pluggable way. We aimed for the shortest diff because there are no tests for any of these scripts, and to be honest, I was afraid of changing them without tests.
>
>
> Diffs
> -----
>
> .gitignore-template 90b6697d19a5e0a68805b23b587b362731a1df25
> support/cpplint.py 6890e27f92603b025e25e4db01decf351c33c9a1
> support/mesos-style.py 66b45692c3c04f68358b63d52e4d87934f241bd7
> support/post-reviews.py 170be83aa6dca6e8175292169d78e8f7915f7e6e
>
> Diff: https://reviews.apache.org/r/40340/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alex Clemmer
>
>
Re: Review Request 40340: [WIP] Windows: Added Windows support to
`support/post-reviews.py`.
Posted by Marco Massenzio <ma...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40340/#review107112
-----------------------------------------------------------
Good stuff!
Sorry for the delay in reviewing this: only got halfway through - will finish it off on the train.
support/cpplint.py (line 4734)
<https://reviews.apache.org/r/40340/#comment166050>
function names should be `lower_case` according to [PEP8](https://www.python.org/dev/peps/pep-0008/#function-names)
support/cpplint.py (lines 4741 - 4745)
<https://reviews.apache.org/r/40340/#comment166051>
can we use a format that Python automated doc tools will understand?
`@param` / `@type` / `@return`
or the `:param` equivalent.
support/cpplint.py (line 4763)
<https://reviews.apache.org/r/40340/#comment166052>
not your code, admittedly, but it would be awesome to drag our Python scripts into the 21st century and use `argparse` instead :)
support/cpplint.py (line 4766)
<https://reviews.apache.org/r/40340/#comment166053>
this does not make any sense at all, IMO
(do we really have a wrapper script that checks `$?` and echoes the number of errors?)
support/mesos-style.py (line 11)
<https://reviews.apache.org/r/40340/#comment166056>
I am not familiar with `cStringIO` - the name would seem to indicate (a) it's not a standard library and (b) that it requires some amount of C compilation.
This is usually a pain "on some OS" (eg, OSX) - can you please confirm whether it's in the standard libraries and, if not, what are the steps involved in getting it installed on various OSes?
This may break building/committing everywhere, right?
support/mesos-style.py (line 63)
<https://reviews.apache.org/r/40340/#comment166054>
I have a suspicion it's just *one* OS that does not support this, but lets' not be picky here :)
support/mesos-style.py (lines 71 - 76)
<https://reviews.apache.org/r/40340/#comment166055>
same comment as before
support/mesos-style.py (line 97)
<https://reviews.apache.org/r/40340/#comment166057>
unnecessary parentheses
- Marco Massenzio
On Nov. 16, 2015, 9:25 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40340/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 9:25 a.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Michael Hopcroft, Joris Van Remoortere, Joseph Wu, and Marco Massenzio.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Added Windows support to `support/post-reviews.py`.
>
> Early draft of the update to the Windows-compatible `post-reviews.py`. I'd like to get early feedback from people in case this is entirely the wrong direction.
>
> At the outset, I will say that the "right way" to do this would be to refactor `cppylint.py` and `post-reviews.py` entirely so that they are more modular (for example, make `post-reviews.py` function-oriented, instead of a pile of statements and expressions, and `cpplint.py` should be a module proper). I didn't do this the "right way" because it is blocking for our Windows friends. If it's really important to do this the "right way", we may need to break it into a couple reviews.
>
> Note that the most questionable part of this is the point at which we redirect `stderr` in `cpplint.py` to a string capture it for use in `post-reviews.py`. This is certainly the quickest way to do it, but it is not the best -- the best way would be to refactor `cpplint.py` to be a module, at least, and to handle error logging in a more pluggable way. We aimed for the shortest diff because there are no tests for any of these scripts, and to be honest, I was afraid of changing them without tests.
>
>
> Diffs
> -----
>
> .gitignore-template 90b6697d19a5e0a68805b23b587b362731a1df25
> support/cpplint.py 6890e27f92603b025e25e4db01decf351c33c9a1
> support/mesos-style.py 66b45692c3c04f68358b63d52e4d87934f241bd7
> support/post-reviews.py 170be83aa6dca6e8175292169d78e8f7915f7e6e
>
> Diff: https://reviews.apache.org/r/40340/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alex Clemmer
>
>
Re: Review Request 40340: [WIP] Windows: Added Windows support to
`support/post-reviews.py`.
Posted by Marco Massenzio <ma...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40340/#review107116
-----------------------------------------------------------
support/mesos-style.py (line 104)
<https://reviews.apache.org/r/40340/#comment166064>
unnecessary parentheses
support/mesos-style.py (lines 105 - 106)
<https://reviews.apache.org/r/40340/#comment166065>
Mesos-style indenting doesn't apply (I think) here:
```
errors_found, captured_stderr = lint_and_capture_stderr(
rules_filter, source_paths)
```
support/mesos-style.py (line 112)
<https://reviews.apache.org/r/40340/#comment166066>
not your code, but could you please remove the unnecessary `is not None`
support/mesos-style.py (line 113)
<https://reviews.apache.org/r/40340/#comment166067>
what was wrong with: `print(line)`
(and please be a good man, if it's not already there, can you please add -at the very top of this file-):
```
from __future__ import print_function
```
so this works with both 2.7 and 3.x?
support/mesos-style.py (line 134)
<https://reviews.apache.org/r/40340/#comment166069>
+10
thanks!
support/post-reviews.py (line 71)
<https://reviews.apache.org/r/40340/#comment166070>
missing "user"
also note that epydoc support markdown; I would enumerate the various options as a bulleted list.
```
can respond with:
- foo
- bar
- ...
```
support/post-reviews.py (lines 71 - 73)
<https://reviews.apache.org/r/40340/#comment166071>
is the user input case-insensitive? if not, worth mentioning
support/post-reviews.py (lines 81 - 91)
<https://reviews.apache.org/r/40340/#comment166072>
+1
this is awesome - I wish all our methods were documented in this depth!
support/post-reviews.py (line 106)
<https://reviews.apache.org/r/40340/#comment166073>
```
while not choice in ['y', 'n', ctrl_d]:
```
- Marco Massenzio
On Nov. 16, 2015, 9:25 a.m., Alex Clemmer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40340/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 9:25 a.m.)
>
>
> Review request for mesos, Artem Harutyunyan, Michael Hopcroft, Joris Van Remoortere, Joseph Wu, and Marco Massenzio.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Windows: Added Windows support to `support/post-reviews.py`.
>
> Early draft of the update to the Windows-compatible `post-reviews.py`. I'd like to get early feedback from people in case this is entirely the wrong direction.
>
> At the outset, I will say that the "right way" to do this would be to refactor `cppylint.py` and `post-reviews.py` entirely so that they are more modular (for example, make `post-reviews.py` function-oriented, instead of a pile of statements and expressions, and `cpplint.py` should be a module proper). I didn't do this the "right way" because it is blocking for our Windows friends. If it's really important to do this the "right way", we may need to break it into a couple reviews.
>
> Note that the most questionable part of this is the point at which we redirect `stderr` in `cpplint.py` to a string capture it for use in `post-reviews.py`. This is certainly the quickest way to do it, but it is not the best -- the best way would be to refactor `cpplint.py` to be a module, at least, and to handle error logging in a more pluggable way. We aimed for the shortest diff because there are no tests for any of these scripts, and to be honest, I was afraid of changing them without tests.
>
>
> Diffs
> -----
>
> .gitignore-template 90b6697d19a5e0a68805b23b587b362731a1df25
> support/cpplint.py 6890e27f92603b025e25e4db01decf351c33c9a1
> support/mesos-style.py 66b45692c3c04f68358b63d52e4d87934f241bd7
> support/post-reviews.py 170be83aa6dca6e8175292169d78e8f7915f7e6e
>
> Diff: https://reviews.apache.org/r/40340/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Alex Clemmer
>
>