mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armand Grillet <agril...@mesosphere.io>
Subject Review Request 68608: Fixed all Python linting issues.
Date Mon, 03 Sep 2018 15:33:09 GMT

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

Review request for mesos, Benjamin Bannier, Eric Chung, and Kevin Klues.


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


Repository: mesos


Description
-------

Fixed all Python linting issues.


Diffs
-----

  src/python/cli_new/bin/main.py b6f9faba741d7229a02cc5052e3b96c193df8991 
  src/python/cli_new/bin/settings.py f501fefa2eb29ed5d7b55828dd18cb396e313583 
  src/python/cli_new/lib/cli/config.py 92ff3eb96826651505e0c3e786f6292cef600bc7 
  src/python/cli_new/lib/cli/docopt.py 4dedd7734bf5880c780be6ffe71430ac1d57aad3 
  src/python/cli_new/lib/cli/plugins/__init__.py e743772afce3aad753be3cd2a923a4331bafc31c

  src/python/cli_new/lib/cli/plugins/agent/main.py 4ebf8cd63a52262615dbcaf1dd79ae2951778c84

  src/python/cli_new/lib/cli/plugins/base.py e01a7b2bc4d4cbabe706c8926913f43d2b4cf69c 
  src/python/cli_new/lib/cli/plugins/task/main.py f9d6826560bcae724c8e47794a73b69b40b955ab

  src/python/cli_new/lib/cli/tests/__init__.py b7c825fc17aa6fc732b5933260dd17291126665a 
  src/python/cli_new/lib/cli/tests/agent.py 6e5e56554b2a556410daeffaa6fbf219adee17a2 
  src/python/cli_new/lib/cli/tests/base.py f58d616b59232786d3d9fb44d8dd91c5c3017568 
  src/python/cli_new/lib/cli/tests/task.py 3a57094b1ad340dcd630c0e59783686432d8a6a5 
  src/python/cli_new/lib/cli/util.py b7404318afd399b2cd54b33d6883b2e7c8734f85 
  src/python/lib/mesos/http.py 8a5a3680b99aec5bebcb0f116e65ae820a72328f 
  src/python/lib/tests/test_http.py c1b21dfcac0292c0646f16f1547ce949bea711a7 
  support/apply-reviews.py 4e292a91f9eb3c6d4598ba258d6aae9dcfa86fc7 
  support/generate-endpoint-help.py 37c4b58462ca42a42276ed1129190fc3359c01cf 
  support/python3/apply-reviews.py 6e1d6d784ea1508c63ac7d5bb0f168a031e0db7c 
  support/python3/common.py ed62c675fa20fb638b9e3aa63c9a55cae39fe9d7 
  support/python3/generate-endpoint-help.py 6214d2efa41ca131ff47a52fbcef90fa245e1ed5 
  support/python3/mesos-style.py 845ec73670961057d2d2d6ecceec99b0f087f2fa 
  support/python3/push-commits.py 7d883505a535e9e3745dbc6dba795bcb6be9d938 
  support/python3/test-upgrade.py a1745bd146d369da83f2a47c69d7f4d2c142dfa8 
  support/verify-reviews.py c86db35c3231af8f1493519759a02cbaf7ef0209 


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


Testing
-------

Before, `./support/mesos-style.py`:
```
Checking 12 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
************* Module verify-reviews
C:261, 7: Do not use `len(SEQUENCE)` to determine if a sequence is empty (len-as-condition)
************* Module generate-endpoint-help
R:215, 4: Unnecessary "else" after "return" (no-else-return)
************* 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)
Total errors found: 5
```
After:
```
Checking 12 Python files
Using config file /Users/Armand/Code/apache-mesos/support/pylint.config
Total errors found: 0
```

Before, `python3 ./support/python3/mesos-style.py`:
```
Checking 47 Python files
************* Module cli.tests.agent
lib/cli/tests/agent.py:21:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module cli.plugins.task.main
lib/cli/plugins/task/main.py:21:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module cli.util
lib/cli/util.py:31:0: C0414: Import alias does not rename original package (useless-import-alias)
lib/cli/util.py:282:0: R0205: Class 'Table' inherits from object, can be safely removed from
bases in python3 (useless-object-inheritance)
************* Module cli.plugins.base
lib/cli/plugins/base.py:119:0: E0012: Bad option value 'R0204' (bad-option-value)
lib/cli/plugins/base.py:69:0: R0205: Class 'PluginBase' inherits from object, can be safely
removed from bases in python3 (useless-object-inheritance)
lib/cli/plugins/base.py:115:11: C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
************* Module cli.tests.base
lib/cli/tests/base.py:31:0: C0414: Import alias does not rename original package (useless-import-alias)
lib/cli/tests/base.py:69:8: R1705: Unnecessary "else" after "return" (no-else-return)
lib/cli/tests/base.py:81:0: R0205: Class 'Executable' inherits from object, can be safely
removed from bases in python3 (useless-object-inheritance)
************* Module settings
bin/settings.py:32:4: E0611: No name 'VERSION' in module 'version' (no-name-in-module)
************* Module cli.plugins.agent.main
lib/cli/plugins/agent/main.py:21:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module cli.config
lib/cli/config.py:31:0: R0205: Class 'Config' inherits from object, can be safely removed
from bases in python3 (useless-object-inheritance)
************* Module cli.tests.task
lib/cli/tests/task.py:21:0: C0414: Import alias does not rename original package (useless-import-alias)
************* Module main
bin/main.py:70:7: C0121: Comparison to None should be 'expr is not None' (singleton-comparison)
************* Module tests.test_http
tests/test_http.py:265:8: R1705: Unnecessary "else" after "return" (no-else-return)
tests/test_http.py:271:8: R1705: Unnecessary "else" after "return" (no-else-return)
************* Module mesos.http
mesos/http.py:79:0: R0205: Class 'Resource' inherits from object, can be safely removed from
bases in python3 (useless-object-inheritance)
************* Module test-upgrade
support/python3/test-upgrade.py:32:0: R0205: Class 'Process' inherits from object, can be
safely removed from bases in python3 (useless-object-inheritance)
support/python3/test-upgrade.py:65:15: C0121: Comparison to None should be 'expr is not None'
(singleton-comparison)
************* Module apply-reviews
support/python3/apply-reviews.py:83:4: R1705: Unnecessary "elif" after "return" (no-else-return)
support/python3/apply-reviews.py:133:8: R1705: Unnecessary "else" after "return" (no-else-return)
support/python3/apply-reviews.py:304:4: R1705: Unnecessary "elif" after "return" (no-else-return)
************* Module common
support/python3/common.py:38:0: R0205: Class 'ReviewBoardHandler' inherits from object, can
be safely removed from bases in python3 (useless-object-inheritance)
************* Module generate-endpoint-help
support/python3/generate-endpoint-help.py:84:0: R0205: Class 'Subprocess' inherits from object,
can be safely removed from bases in python3 (useless-object-inheritance)
************* Module mesos-style
support/python3/mesos-style.py:528:0: C0301: Line too long (84/80) (line-too-long)
support/python3/mesos-style.py:551:0: C0301: Line too long (90/80) (line-too-long)
support/python3/mesos-style.py:557:0: C0301: Line too long (86/80) (line-too-long)
support/python3/mesos-style.py:566:0: C0301: Line too long (104/80) (line-too-long)
support/python3/mesos-style.py:155:0: W1401: Anomalous backslash in string: '\S'. String constant
might be missing an r prefix. (anomalous-backslash-in-string)
support/python3/mesos-style.py:29:0: R0205: Class 'LinterBase' inherits from object, can be
safely removed from bases in python3 (useless-object-inheritance)
support/python3/mesos-style.py:218:12: E1111: Assigning to function call which doesn't return
(assignment-from-no-return)
support/python3/mesos-style.py:522:4: W0621: Redefining name 'build_virtualenv' from outer
scope (line 512) (redefined-outer-name)
************* Module push-commits
support/python3/push-commits.py:47:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
support/python3/push-commits.py:54:0: C0330: Wrong continued indentation (add 1 space).
                             'rev-list',
                             ^| (bad-continuation)
support/python3/push-commits.py:55:0: C0330: Wrong continued indentation (add 1 space).
                             '--reverse',
                             ^| (bad-continuation)
support/python3/push-commits.py:56:0: C0330: Wrong continued indentation (add 1 space).
                             revision_range]).strip().split('\n')
                             ^| (bad-continuation)
support/python3/push-commits.py:59:0: C0330: Wrong continued indentation (add 1 space).
                                   '--no-pager',
                                   ^| (bad-continuation)
support/python3/push-commits.py:60:0: C0330: Wrong continued indentation (add 1 space).
                                   'show',
                                   ^| (bad-continuation)
support/python3/push-commits.py:61:0: C0330: Wrong continued indentation (add 1 space).
                                   '--no-color',
                                   ^| (bad-continuation)
support/python3/push-commits.py:62:0: C0330: Wrong continued indentation (add 1 space).
                                   '--no-patch',
                                   ^| (bad-continuation)
support/python3/push-commits.py:63:0: C0330: Wrong continued indentation (add 1 space).
                                   rev]).strip()
                                   ^| (bad-continuation)
support/python3/push-commits.py:92:0: C0330: Wrong continued indentation (add 1 space).
                          'close',
                          ^| (bad-continuation)
support/python3/push-commits.py:93:0: C0330: Wrong continued indentation (add 1 space).
                          '--description',
                          ^| (bad-continuation)
support/python3/push-commits.py:94:0: C0330: Wrong continued indentation (add 1 space).
                          commit_log,
                          ^| (bad-continuation)
support/python3/push-commits.py:95:0: C0330: Wrong continued indentation (add 1 space).
                          review_id])
                          ^| (bad-continuation)
support/python3/push-commits.py:127:0: C0330: Wrong continued indentation (add 1 space).
                                           'rev-parse',
                                           ^| (bad-continuation)
support/python3/push-commits.py:128:0: C0330: Wrong continued indentation (add 1 space).
                                           '--abbrev-ref',
                                           ^| (bad-continuation)
support/python3/push-commits.py:129:0: C0330: Wrong continued indentation (add 1 space).
                                           'master@{upstream}']).strip()
                                           ^| (bad-continuation)
support/python3/push-commits.py:145:0: C0330: Wrong continued indentation (add 1 space).
                           'config',
                           ^| (bad-continuation)
support/python3/push-commits.py:146:0: C0330: Wrong continued indentation (add 1 space).
                           '--get',
                           ^| (bad-continuation)
support/python3/push-commits.py:147:0: C0330: Wrong continued indentation (add 1 space).
                           'branch.master.remote']).strip()
                           ^| (bad-continuation)
support/python3/push-commits.py:153:0: C0330: Wrong continued indentation (add 1 space).
                      'push',
                      ^| (bad-continuation)
support/python3/push-commits.py:154:0: C0330: Wrong continued indentation (add 1 space).
                      '--dry-run',
                      ^| (bad-continuation)
support/python3/push-commits.py:155:0: C0330: Wrong continued indentation (add 1 space).
                      remote,
                      ^| (bad-continuation)
support/python3/push-commits.py:156:0: C0330: Wrong continued indentation (add 1 space).
                      'master:master'])
                      ^| (bad-continuation)
support/python3/push-commits.py:159:0: C0330: Wrong continued indentation (add 1 space).
                      'push',
                      ^| (bad-continuation)
support/python3/push-commits.py:160:0: C0330: Wrong continued indentation (add 1 space).
                      remote,
                      ^| (bad-continuation)
support/python3/push-commits.py:161:0: C0330: Wrong continued indentation (add 1 space).
                      'master:master'])
                      ^| (bad-continuation)
```
After:
```
Checking 47 Python files
Total errors found: 0
```


Thanks,

Armand Grillet


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message