Browse Source

Fix pep8 E127 violations

Updated pep8 version requirement to 1.3.3
Fixed E127 errors
All ignores are to be removed in the next sequence of patches

Change-Id: Ia9e922b8873686a0f905f2548cc43d534ee1c912
Reviewed-on: https://review.openstack.org/13642
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Zhongyue Luo <zhongyue.nah@intel.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
tags/1.1.0
Zhongyue Luo 6 years ago
parent
commit
5d55607e5b
6 changed files with 33 additions and 21 deletions
  1. 4
    0
      .mailmap
  2. 1
    1
      AUTHORS
  3. 24
    16
      tests/test_scheduler.py
  4. 2
    2
      tox.ini
  5. 1
    1
      zuul/launcher/jenkins.py
  6. 1
    1
      zuul/model.py

+ 4
- 0
.mailmap View File

@@ -0,0 +1,4 @@
1
+# Format is:
2
+# <preferred e-mail> <other e-mail 1>
3
+# <preferred e-mail> <other e-mail 2>
4
+Zhongyue Luo <zhongyue.nah@intel.com> <lzyeval@gmail.com>

+ 1
- 1
AUTHORS View File

@@ -1,3 +1,3 @@
1 1
 James E. Blair <jeblair@hp.com>
2 2
 Clark Boylan <clark.boylan@gmail.com>
3
-Zhongyue Luo <lzyeval@gmail.com>
3
+Zhongyue Luo <zhongyue.nah@intel.com>

+ 24
- 16
tests/test_scheduler.py View File

@@ -362,14 +362,17 @@ class FakeGerrit(object):
362 362
 
363 363
 class FakeJenkinsEvent(object):
364 364
     def __init__(self, name, number, parameters, phase, status=None):
365
-        data = {'build':
366
-                     {'full_url': 'https://server/job/%s/%s/' % (name, number),
367
-                      'number': number,
368
-                      'parameters': parameters,
369
-                      'phase': phase,
370
-                      'url': 'job/%s/%s/' % (name, number)},
371
-                     'name': name,
372
-                     'url': 'job/%s/' % name}
365
+        data = {
366
+            'build': {
367
+                'full_url': 'https://server/job/%s/%s/' % (name, number),
368
+                'number': number,
369
+                'parameters': parameters,
370
+                'phase': phase,
371
+                'url': 'job/%s/%s/' % (name, number),
372
+            },
373
+            'name': name,
374
+            'url': 'job/%s/' % name,
375
+        }
373 376
         if status:
374 377
             data['build']['status'] = status
375 378
         self.body = json.dumps(data)
@@ -815,7 +818,7 @@ class testScheduler(unittest.TestCase):
815 818
     def test_independent_queues(self):
816 819
         "Test that changes end up in the right queues"
817 820
         self.fake_jenkins.hold_jobs_in_build = True
818
-        A = self.fake_gerrit.addFakeChange('org/project',  'master', 'A')
821
+        A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
819 822
         B = self.fake_gerrit.addFakeChange('org/project1', 'master', 'B')
820 823
         C = self.fake_gerrit.addFakeChange('org/project2', 'master', 'C')
821 824
         A.addApproval('CRVW', 2)
@@ -1122,13 +1125,18 @@ class testScheduler(unittest.TestCase):
1122 1125
 
1123 1126
     def test_post(self):
1124 1127
         "Test that post jobs run"
1125
-        e = {"type": "ref-updated",
1126
-             "submitter": {"name": "User Name"},
1127
-             "refUpdate": {"oldRev":
1128
-                               "90f173846e3af9154517b88543ffbd1691f31366",
1129
-                           "newRev":
1130
-                               "d479a0bfcb34da57a31adb2a595c0cf687812543",
1131
-                           "refName": "master", "project": "org/project"}}
1128
+        e = {
1129
+            "type": "ref-updated",
1130
+            "submitter": {
1131
+                "name": "User Name",
1132
+            },
1133
+            "refUpdate": {
1134
+                "oldRev": "90f173846e3af9154517b88543ffbd1691f31366",
1135
+                "newRev": "d479a0bfcb34da57a31adb2a595c0cf687812543",
1136
+                "refName": "master",
1137
+                "project": "org/project",
1138
+            }
1139
+        }
1132 1140
         self.fake_gerrit.addEvent(e)
1133 1141
         self.waitUntilSettled()
1134 1142
 

+ 2
- 2
tox.ini View File

@@ -10,8 +10,8 @@ commands = nosetests {posargs}
10 10
 downloadcache = ~/cache/pip
11 11
 
12 12
 [testenv:pep8]
13
-deps = pep8==1.2
14
-commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,build .
13
+deps = pep8==1.3.3
14
+commands = pep8 --ignore=E122,E125,E126,E128 --repeat --show-source --exclude=.venv,.tox,dist,doc,build .
15 15
 
16 16
 [testenv:cover]
17 17
 setenv = NOSE_WITH_COVERAGE=1

+ 1
- 1
zuul/launcher/jenkins.py View File

@@ -155,7 +155,7 @@ class ExtendedJenkins(jenkins.Jenkins):
155 155
         # Jenkins returns a 302 from this URL, unless Referer is not set,
156 156
         # then you get a 404.
157 157
         request = urllib2.Request(self.server + CANCEL_QUEUE % locals(),
158
-                                      headers={'Referer': self.server})
158
+                                  headers={'Referer': self.server})
159 159
         self.jenkins_open(request)
160 160
 
161 161
     def get_build_info(self, name, number):

+ 1
- 1
zuul/model.py View File

@@ -565,7 +565,7 @@ class TriggerEvent(object):
565 565
 
566 566
 class EventFilter(object):
567 567
     def __init__(self, types=[], branches=[], refs=[], approvals={},
568
-                                                comment_filters=[]):
568
+                 comment_filters=[]):
569 569
         self._types = types
570 570
         self._branches = branches
571 571
         self._refs = refs

Loading…
Cancel
Save