You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Armand Grillet <ag...@mesosphere.io> on 2018/08/24 07:08:41 UTC

Review Request 68485: Fixed pylint violations in Python 2 codebase.

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

Review request for mesos and Benjamin Bannier.


Bugs: MESOS-9112
    https://issues.apache.org/jira/browse/MESOS-9112


Repository: mesos


Description
-------

This decreases the number of errors reported by `support/mesos-style.py`
on a clean checkout. There will be 0 errors displayed once the new
CLI and the Mesos python package will be excluded from linting due
to the use of Python 3 instead of 2 in those components.


Diffs
-----

  support/apply-reviews.py 4e292a91f9eb3c6d4598ba258d6aae9dcfa86fc7 
  support/generate-endpoint-help.py 37c4b58462ca42a42276ed1129190fc3359c01cf 
  support/verify-reviews.py c86db35c3231af8f1493519759a02cbaf7ef0209 


Diff: https://reviews.apache.org/r/68485/diff/1/


Testing
-------

Before:
```
Checking 46 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module cli.plugins.base
E:119, 0: Bad option value 'R0204' (bad-option-value)
************* Module settings
E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module mesos.http
E: 25, 0: Unable to import 'urlparse' (import-error)
E: 87,30: Undefined variable 'xrange' (undefined-variable)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module apply-reviews
R: 99, 0: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
C:124, 9: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
R:302, 4: Unnecessary "else" after "return" (no-else-return)
************* Module generate-endpoint-help
R:215, 4: Unnecessary "else" after "return" (no-else-return)
************* Module verify-reviews
C:261, 7: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
Total errors found: 9
```
After:
```
Checking 46 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module cli.plugins.base
E:119, 0: Bad option value 'R0204' (bad-option-value)
************* Module settings
E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module mesos.http
E: 25, 0: Unable to import 'urlparse' (import-error)
E: 87,30: Undefined variable 'xrange' (undefined-variable)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
Total errors found: 4
```


Thanks,

Armand Grillet


Re: Review Request 68485: Fixed pylint violations in Python 2 codebase.

Posted by Armand Grillet <ag...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68485/
-----------------------------------------------------------

(Updated Aug. 27, 2018, 10:12 a.m.)


Review request for mesos and Benjamin Bannier.


Changes
-------

Fixed issue.


Bugs: MESOS-9112
    https://issues.apache.org/jira/browse/MESOS-9112


Repository: mesos


Description
-------

This decreases the number of errors reported by `support/mesos-style.py`
on a clean checkout. There will be 0 errors displayed once the new
CLI and the Mesos python package will be excluded from linting due
to the use of Python 3 instead of 2 in those components.


Diffs (updated)
-----

  support/apply-reviews.py 4e292a91f9eb3c6d4598ba258d6aae9dcfa86fc7 
  support/generate-endpoint-help.py 37c4b58462ca42a42276ed1129190fc3359c01cf 
  support/verify-reviews.py c86db35c3231af8f1493519759a02cbaf7ef0209 


Diff: https://reviews.apache.org/r/68485/diff/2/

Changes: https://reviews.apache.org/r/68485/diff/1-2/


Testing
-------

Before:
```
Checking 46 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module cli.plugins.base
E:119, 0: Bad option value 'R0204' (bad-option-value)
************* Module settings
E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module mesos.http
E: 25, 0: Unable to import 'urlparse' (import-error)
E: 87,30: Undefined variable 'xrange' (undefined-variable)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module apply-reviews
R: 99, 0: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
C:124, 9: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
R:302, 4: Unnecessary "else" after "return" (no-else-return)
************* Module generate-endpoint-help
R:215, 4: Unnecessary "else" after "return" (no-else-return)
************* Module verify-reviews
C:261, 7: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
Total errors found: 9
```
After:
```
Checking 46 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module cli.plugins.base
E:119, 0: Bad option value 'R0204' (bad-option-value)
************* Module settings
E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module mesos.http
E: 25, 0: Unable to import 'urlparse' (import-error)
E: 87,30: Undefined variable 'xrange' (undefined-variable)
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
Total errors found: 4
```


Thanks,

Armand Grillet


Re: Review Request 68485: Fixed pylint violations in Python 2 codebase.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68485/#review207948
-----------------------------------------------------------


Fix it, then Ship it!





support/apply-reviews.py
Lines 104 (patched)
<https://reviews.apache.org/r/68485/#comment291606>

    I'd prefer if we'd return `None` here instead.


- Benjamin Bannier


On Aug. 24, 2018, 9:08 a.m., Armand Grillet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68485/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2018, 9:08 a.m.)
> 
> 
> Review request for mesos and Benjamin Bannier.
> 
> 
> Bugs: MESOS-9112
>     https://issues.apache.org/jira/browse/MESOS-9112
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This decreases the number of errors reported by `support/mesos-style.py`
> on a clean checkout. There will be 0 errors displayed once the new
> CLI and the Mesos python package will be excluded from linting due
> to the use of Python 3 instead of 2 in those components.
> 
> 
> Diffs
> -----
> 
>   support/apply-reviews.py 4e292a91f9eb3c6d4598ba258d6aae9dcfa86fc7 
>   support/generate-endpoint-help.py 37c4b58462ca42a42276ed1129190fc3359c01cf 
>   support/verify-reviews.py c86db35c3231af8f1493519759a02cbaf7ef0209 
> 
> 
> Diff: https://reviews.apache.org/r/68485/diff/1/
> 
> 
> Testing
> -------
> 
> Before:
> ```
> Checking 46 Python files
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module cli.plugins.base
> E:119, 0: Bad option value 'R0204' (bad-option-value)
> ************* Module settings
> E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module mesos.http
> E: 25, 0: Unable to import 'urlparse' (import-error)
> E: 87,30: Undefined variable 'xrange' (undefined-variable)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module apply-reviews
> R: 99, 0: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
> C:124, 9: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
> R:302, 4: Unnecessary "else" after "return" (no-else-return)
> ************* Module generate-endpoint-help
> R:215, 4: Unnecessary "else" after "return" (no-else-return)
> ************* Module verify-reviews
> C:261, 7: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
> Total errors found: 9
> ```
> After:
> ```
> Checking 46 Python files
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module cli.plugins.base
> E:119, 0: Bad option value 'R0204' (bad-option-value)
> ************* Module settings
> E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module mesos.http
> E: 25, 0: Unable to import 'urlparse' (import-error)
> E: 87,30: Undefined variable 'xrange' (undefined-variable)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> Total errors found: 4
> ```
> 
> 
> Thanks,
> 
> Armand Grillet
> 
>


Re: Review Request 68485: Fixed pylint violations in Python 2 codebase.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/68485/#review207860
-----------------------------------------------------------



Patch looks great!

Reviews applied: [68485]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On Aug. 24, 2018, 7:08 a.m., Armand Grillet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/68485/
> -----------------------------------------------------------
> 
> (Updated Aug. 24, 2018, 7:08 a.m.)
> 
> 
> Review request for mesos and Benjamin Bannier.
> 
> 
> Bugs: MESOS-9112
>     https://issues.apache.org/jira/browse/MESOS-9112
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This decreases the number of errors reported by `support/mesos-style.py`
> on a clean checkout. There will be 0 errors displayed once the new
> CLI and the Mesos python package will be excluded from linting due
> to the use of Python 3 instead of 2 in those components.
> 
> 
> Diffs
> -----
> 
>   support/apply-reviews.py 4e292a91f9eb3c6d4598ba258d6aae9dcfa86fc7 
>   support/generate-endpoint-help.py 37c4b58462ca42a42276ed1129190fc3359c01cf 
>   support/verify-reviews.py c86db35c3231af8f1493519759a02cbaf7ef0209 
> 
> 
> Diff: https://reviews.apache.org/r/68485/diff/1/
> 
> 
> Testing
> -------
> 
> Before:
> ```
> Checking 46 Python files
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module cli.plugins.base
> E:119, 0: Bad option value 'R0204' (bad-option-value)
> ************* Module settings
> E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module mesos.http
> E: 25, 0: Unable to import 'urlparse' (import-error)
> E: 87,30: Undefined variable 'xrange' (undefined-variable)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module apply-reviews
> R: 99, 0: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
> C:124, 9: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
> R:302, 4: Unnecessary "else" after "return" (no-else-return)
> ************* Module generate-endpoint-help
> R:215, 4: Unnecessary "else" after "return" (no-else-return)
> ************* Module verify-reviews
> C:261, 7: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
> Total errors found: 9
> ```
> After:
> ```
> Checking 46 Python files
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module cli.plugins.base
> E:119, 0: Bad option value 'R0204' (bad-option-value)
> ************* Module settings
> E: 32, 4: No name 'VERSION' in module 'version' (no-name-in-module)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> ************* Module mesos.http
> E: 25, 0: Unable to import 'urlparse' (import-error)
> E: 87,30: Undefined variable 'xrange' (undefined-variable)
> Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
> Total errors found: 4
> ```
> 
> 
> Thanks,
> 
> Armand Grillet
> 
>