Closed Bug 1074826 Opened 12 years ago Closed 12 years ago

Clean up some pyflakes & PEP8 warnings in buildbotcustom

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

Details

Attachments

(1 file)

Excluding the "line too long" warnings, currently in buildbotcustom: status/db/status.py:10:1: F401 'HEADER' imported but unused status/db/status.py:43:13: F841 local variable 'b' is assigned to but never used status/db/status.py:337:43: E122 continuation line missing indentation or outdented steps/unittest.py:49:29: E711 comparison to None should be 'if cond is not None:' steps/unittest.py:53:29: E711 comparison to None should be 'if cond is None:' steps/unittest.py:63:27: E711 comparison to None should be 'if cond is not None:' steps/unittest.py:71:15: E712 comparison to False should be 'if cond is not False:' or 'if cond:' steps/unittest.py:623:1: E302 expected 2 blank lines, found 1 changes/hgpoller.py:247:17: E265 block comment should start with '# ' changes/hgpoller.py:248:13: E265 block comment should start with '# ' changes/hgpoller.py:249:13: E265 block comment should start with '# ' changes/hgpoller.py:250:13: E265 block comment should start with '# ' changes/hgpoller.py:313:61: E703 statement ends with a semicolon steps/misc.py:27:1: F401 'DefaultException' imported but unused steps/misc.py:31:1: F401 'Deferred' imported but unused steps/misc.py:31:1: F401 'TimeoutError' imported but unused steps/misc.py:36:1: F401 'LoggedRemoteCommand' imported but unused steps/misc.py:39:1: F401 'STDERR' imported but unused steps/misc.py:39:1: F401 'STDOUT' imported but unused steps/misc.py:41:1: F401 'LoggingBuildStep' imported but unused steps/misc.py:41:1: F401 'RetryingShellCommand' imported but unused steps/misc.py:41:1: F401 'addRetryEvaluateCommand' imported but unused test/test_misc_nextslaves.py:112:5: E303 too many blank lines (2) test/test_misc_nextslaves.py:178:9: E265 block comment should start with '# ' test/test_misc_nextslaves.py:192:9: F841 local variable 't' is assigned to but never used changes/mobileftppoller.py:4:1: F401 'unquote' imported but unused changes/mobileftppoller.py:5:1: F401 'failure' imported but unused changes/mobileftppoller.py:110:9: F821 undefined name 'Scheduler' changes/mobileftppoller.py:116:9: F821 undefined name 'Scheduler' status/queued_command.py:24:26: E711 comparison to None should be 'if cond is not None:' status/queued_command.py:43:28: E711 comparison to None should be 'if cond is not None:' status/db/model.py:32:22: E122 continuation line missing indentation or outdented status/db/model.py:33:22: E122 continuation line missing indentation or outdented status/db/model.py:40:26: E122 continuation line missing indentation or outdented status/db/model.py:42:26: E122 continuation line missing indentation or outdented status/db/model.py:49:28: E122 continuation line missing indentation or outdented status/db/model.py:51:28: E122 continuation line missing indentation or outdented status/db/model.py:53:28: E122 continuation line missing indentation or outdented status/db/model.py:54:28: E122 continuation line missing indentation or outdented status/db/model.py:143:117: E711 comparison to None should be 'if cond is None:' status/db/model.py:267:53: E251 unexpected spaces around keyword / parameter equals status/db/model.py:269:53: E711 comparison to None should be 'if cond is None:' test/test_misc_scheduler_propfuncs.py:9:1: F401 'Change' imported but unused l10n.py:43:1: F401 'Dependent' imported but unused l10n.py:43:1: F401 'Nightly' imported but unused l10n.py:46:1: F401 'SUCCESS' imported but unused l10n.py:46:1: F401 'WARNINGS' imported but unused l10n.py:96:27: E711 comparison to None should be 'if cond is not None:' misc_scheduler.py:147:5: E265 block comment should start with '# ' misc_scheduler.py:270:9: E265 block comment should start with '# ' misc_scheduler.py:329:9: E265 block comment should start with '# ' status/errors.py:3:1: F401 'EXCEPTION' imported but unused status/errors.py:5:1: E302 expected 2 blank lines, found 1 status/generators.py:53:65: E703 statement ends with a semicolon status/generators.py:59:58: E703 statement ends with a semicolon status/pulse.py:7:1: F401 'traceback' imported but unused status/pulse.py:9:1: F401 'deferToThread' imported but unused status/pulse.py:10:1: F401 'DeferredLock' imported but unused status/pulse.py:138:16: E128 continuation line under-indented for visual indent status/pulse.py:185:5: E265 block comment should start with '# ' status/pulse.py:221:18: E128 continuation line under-indented for visual indent status/pulse.py:232:18: E128 continuation line under-indented for visual indent status/pulse.py:237:5: E265 block comment should start with '# ' status/pulse.py:242:18: E128 continuation line under-indented for visual indent status/pulse.py:249:18: E128 continuation line under-indented for visual indent status/pulse.py:257:18: E128 continuation line under-indented for visual indent status/pulse.py:260:5: E265 block comment should start with '# ' steps/mobile.py:3:1: F401 'EXCEPTION' imported but unused steps/mobile.py:3:1: F401 'FAILURE' imported but unused steps/mobile.py:3:1: F401 'SKIPPED' imported but unused steps/mock.py:28:1: F401 'buildbotcustom' imported but unused steps/talos.py:2:1: F401 'os' imported but unused steps/talos.py:3:1: F401 'time' imported but unused steps/talos.py:4:1: F401 'copy' imported but unused steps/talos.py:6:1: F401 'EXCEPTION' imported but unused steps/talos.py:6:1: F401 'SKIPPED' imported but unused steps/talos.py:6:1: F401 'worst_status' imported but unused test/test_hgpoller.py:11:1: F401 'BasePoller' imported but unused test/test_test_order.py:5:1: F401 'log' imported but unused test/test_test_order.py:6:1: F401 'defer' imported but unused test/test_test_order.py:300:13: F841 local variable 'ss1' is assigned to but never used test/test_test_order.py:302:13: F841 local variable 'bsid' is assigned to but never used process/release.py:16:1: F401 'buildbotcustom' imported but unused process/release.py:73:20: E225 missing whitespace around operator process/release.py:74:9: E128 continuation line under-indented for visual indent process/release.py:75:20: E225 missing whitespace around operator process/release.py:76:9: E128 continuation line under-indented for visual indent process/release.py:322:5: E265 block comment should start with '# ' process/release.py:620:36: E225 missing whitespace around operator process/release.py:621:17: E128 continuation line under-indented for visual indent process/release.py:755:25: E128 continuation line under-indented for visual indent process/release.py:804:28: E126 continuation line over-indented for hanging indent process/release.py:844:29: E128 continuation line under-indented for visual indent process/release.py:889:17: E122 continuation line missing indentation or outdented process/release.py:890:17: E122 continuation line missing indentation or outdented process/release.py:1143:32: E225 missing whitespace around operator process/release.py:1144:13: E128 continuation line under-indented for visual indent process/release.py:1357:24: E128 continuation line under-indented for visual indent process/release.py:1358:24: E128 continuation line under-indented for visual indent process/release.py:1628:5: E265 block comment should start with '# ' process/release.py:1638:87: E502 the backslash is redundant between brackets process/release.py:1639:13: E131 continuation line unaligned for hanging indent process/release.py:1781:9: E125 continuation line with same indent as next logical line process/release.py:1836:17: E122 continuation line missing indentation or outdented process/release.py:1917:26: E128 continuation line under-indented for visual indent process/release.py:1921:54: F821 undefined name 'enUS_signed_apk_url' process/release.py:1930:18: E128 continuation line under-indented for visual indent process/release.py:1943:18: E128 continuation line under-indented for visual indent process/release.py:1956:22: E128 continuation line under-indented for visual indent process/release.py:1984:1: W391 blank line at end of file try_parser.py:323:35: W601 .has_key() is deprecated, use 'in' status/mail.py:24:5: F841 local variable 'revision' is assigned to but never used status/mail.py:78:35: E711 comparison to None should be 'if cond is not None:' status/mail.py:199:36: F812 list comprehension redefines 'r' from line 184 steps/release.py:4:1: F401 'FAILURE' imported but unused steps/release.py:4:1: F401 'worst_status' imported but unused steps/release.py:7:1: F401 'TinderboxShellCommand' imported but unused steps/updates.py:4:1: F401 'buildbot' imported but unused steps/updates.py:7:1: F401 'FAILURE' imported but unused steps/updates.py:7:1: F401 'SKIPPED' imported but unused test/test_status.py:2:1: F401 'changes' imported but unused test/test_status.py:23:1: E302 expected 2 blank lines, found 1 test/test_try_parser.py:8:1: E265 block comment should start with '# ' test/test_try_parser.py:259:5: F811 redefinition of unused 'test_AllPlatformsBoth' from line 227 test/test_try_parser.py:524:23: E127 continuation line over-indented for visual indent test/test_try_parser.py:525:23: E127 continuation line over-indented for visual indent env.py:71:1: E265 block comment should start with '# ' env.py:134:1: E265 block comment should start with '# ' misc.py:78:28: E128 continuation line under-indented for visual indent misc.py:102:28: E128 continuation line under-indented for visual indent misc.py:232:33: E128 continuation line under-indented for visual indent misc.py:1063:17: E127 continuation line over-indented for visual indent misc.py:1160:1: E302 expected 2 blank lines, found 1 misc.py:1283:21: E128 continuation line under-indented for visual indent misc.py:1317:21: E128 continuation line under-indented for visual indent misc.py:1519:48: E122 continuation line missing indentation or outdented misc.py:1553:41: E261 at least two spaces before inline comment misc.py:1554:37: E261 at least two spaces before inline comment misc.py:1555:41: E261 at least two spaces before inline comment misc.py:1858:25: E127 continuation line over-indented for visual indent misc.py:1859:25: E127 continuation line over-indented for visual indent misc.py:2418:41: E127 continuation line over-indented for visual indent misc.py:2441:33: E127 continuation line over-indented for visual indent misc.py:2638:64: E128 continuation line under-indented for visual indent misc.py:2644:42: E128 continuation line under-indented for visual indent misc.py:2645:42: E128 continuation line under-indented for visual indent misc.py:2646:42: E128 continuation line under-indented for visual indent misc.py:2647:42: E128 continuation line under-indented for visual indent misc.py:2648:42: E128 continuation line under-indented for visual indent misc.py:2655:46: E211 whitespace before '(' misc.py:2715:75: E128 continuation line under-indented for visual indent misc.py:2763:33: E126 continuation line over-indented for hanging indent misc.py:2791:63: W601 .has_key() is deprecated, use 'in' misc.py:2796:33: E126 continuation line over-indented for hanging indent misc.py:2836:45: E126 continuation line over-indented for hanging indent misc.py:3057:9: E128 continuation line under-indented for visual indent misc.py:3276:21: E122 continuation line missing indentation or outdented scheduler.py:45:9: E265 block comment should start with '# ' bin/try_mailer.py:224:16: E711 comparison to None should be 'if cond is not None:' process/factory.py:385:16: E225 missing whitespace around operator process/factory.py:525:26: E122 continuation line missing indentation or outdented process/factory.py:576:26: E122 continuation line missing indentation or outdented process/factory.py:600:22: E122 continuation line missing indentation or outdented process/factory.py:601:22: E122 continuation line missing indentation or outdented process/factory.py:602:22: E122 continuation line missing indentation or outdented process/factory.py:603:22: E122 continuation line missing indentation or outdented process/factory.py:634:42: E111 indentation is not a multiple of four process/factory.py:634:42: E113 unexpected indentation process/factory.py:1212:21: E128 continuation line under-indented for visual indent process/factory.py:1388:17: E122 continuation line missing indentation or outdented process/factory.py:1389:17: E122 continuation line missing indentation or outdented process/factory.py:1398:17: E122 continuation line missing indentation or outdented process/factory.py:1399:17: E122 continuation line missing indentation or outdented process/factory.py:1454:32: E201 whitespace after '[' process/factory.py:1454:82: E202 whitespace before ']' process/factory.py:1557:26: E122 continuation line missing indentation or outdented process/factory.py:1595:26: E122 continuation line missing indentation or outdented process/factory.py:1757:40: E703 statement ends with a semicolon process/factory.py:1847:45: E127 continuation line over-indented for visual indent process/factory.py:1992:22: E122 continuation line missing indentation or outdented process/factory.py:2038:22: E122 continuation line missing indentation or outdented process/factory.py:2140:126: E703 statement ends with a semicolon process/factory.py:2174:22: E122 continuation line missing indentation or outdented process/factory.py:2195:22: E122 continuation line missing indentation or outdented process/factory.py:2499:26: E122 continuation line missing indentation or outdented process/factory.py:2715:17: E122 continuation line missing indentation or outdented process/factory.py:2891:22: E122 continuation line missing indentation or outdented process/factory.py:2989:22: E122 continuation line missing indentation or outdented process/factory.py:3240:9: E124 closing bracket does not match visual indentation process/factory.py:3244:26: E231 missing whitespace after ',' process/factory.py:3245:58: E231 missing whitespace after ',' process/factory.py:3261:9: E124 closing bracket does not match visual indentation process/factory.py:3289:22: E122 continuation line missing indentation or outdented process/factory.py:3428:67: E502 the backslash is redundant between brackets process/factory.py:3546:94: E502 the backslash is redundant between brackets process/factory.py:3625:16: E713 test for membership should be 'not in' process/factory.py:3675:22: E122 continuation line missing indentation or outdented process/factory.py:3714:29: E251 unexpected spaces around keyword / parameter equals process/factory.py:3714:31: E251 unexpected spaces around keyword / parameter equals process/factory.py:3723:29: E251 unexpected spaces around keyword / parameter equals process/factory.py:3723:31: E251 unexpected spaces around keyword / parameter equals process/factory.py:3830:94: E502 the backslash is redundant between brackets process/factory.py:4704:26: E122 continuation line missing indentation or outdented process/factory.py:4824:25: E128 continuation line under-indented for visual indent process/factory.py:5008:30: E122 continuation line missing indentation or outdented process/factory.py:5009:30: E122 continuation line missing indentation or outdented process/factory.py:5084:9: E124 closing bracket does not match visual indentation process/factory.py:5271:30: E122 continuation line missing indentation or outdented process/factory.py:5272:30: E122 continuation line missing indentation or outdented process/factory.py:5296:30: E122 continuation line missing indentation or outdented process/factory.py:5297:30: E122 continuation line missing indentation or outdented process/factory.py:5318:30: E122 continuation line missing indentation or outdented process/factory.py:5319:30: E122 continuation line missing indentation or outdented process/factory.py:5333:21: E128 continuation line under-indented for visual indent process/factory.py:5441:13: E124 closing bracket does not match visual indentation process/factory.py:5459:25: E126 continuation line over-indented for hanging indent process/factory.py:5464:25: E124 closing bracket does not match visual indentation process/factory.py:5619:26: E122 continuation line missing indentation or outdented process/factory.py:5629:29: E127 continuation line over-indented for visual indent process/factory.py:5677:39: E122 continuation line missing indentation or outdented process/factory.py:5681:30: E122 continuation line missing indentation or outdented process/factory.py:5690:30: E122 continuation line missing indentation or outdented process/factory.py:5694:30: E122 continuation line missing indentation or outdented process/factory.py:5700:30: E122 continuation line missing indentation or outdented process/factory.py:5701:30: E122 continuation line missing indentation or outdented process/factory.py:5744:30: E122 continuation line missing indentation or outdented process/factory.py:5746:30: E122 continuation line missing indentation or outdented process/factory.py:5752:30: E122 continuation line missing indentation or outdented process/factory.py:5762:26: E122 continuation line missing indentation or outdented process/factory.py:5768:26: E122 continuation line missing indentation or outdented process/factory.py:5858:26: E122 continuation line missing indentation or outdented process/factory.py:6027:81: E122 continuation line missing indentation or outdented process/factory.py:6191:82: E502 the backslash is redundant between brackets process/factory.py:6192:25: E131 continuation line unaligned for hanging indent
OS: Windows 8.1 → All
Hardware: x86_64 → All
I've not touched most of the "unused import" warnings, since pulling on that string may end up being a bit more involved. This also doesn't fix everything else, but gets us 80% of the way there for now :-)
Attachment #8497496 - Flags: review?(pmoore)
Comment on attachment 8497496 [details] [diff] [review] Clean up some pyflakes & PEP8 warnings in buildbotcustom Review of attachment 8497496 [details] [diff] [review]: ----------------------------------------------------------------- Hey Ed, Thanks so much for finding the time to do all this! I've visually inspected the whole patch, and apart from there maybe being a couple of stray code excerpts that slipped in, it looks perfect! That must have been a lot of work. An alternative, if after this we continue to get a lot of warnings, is we might want to fine tune what warnings we configure, to be a little bit more generous with allowing variation. Callek and Dustin have been through a few iterations of tweaking code formatting restrictions in RelEngAPI - it might be worth pinging them about their thoughts/evaluations too. r- only because of the stray methods. Thanks! Pete ::: test/test_test_order.py @@ -296,5 @@ > who='me!', branch='b1', revision='r1', files=['http://path/to/build'], > comments='really important', properties={'buildid': '20110214000001'}, when=6) > self.dbc.addChangeToDatabase(c3) > ss = SourceStamp(branch='b1', changes=[c3], revision='r1') > - ss1 = ss.getAbsoluteSourceStamp('r1') This looks like a code change, rather than a formatting change here. ::: test/test_try_parser.py @@ -230,5 @@ > - tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES) > - builders = [b for b in BUILDER_PRETTY_NAMES.values( > - ) if 'nondefault' not in b] > - self.assertEqual(sorted(self.customBuilders), sorted(builders)) > - I think you've got an extra function here added in, rather than a formatting change.
Attachment #8497496 - Flags: review?(pmoore) → review-
Apologies - I see from the diff above these are *removed* code extracts, rather than added code extracts - but would be good if you could also confirm whether that was intentional! Thanks! Pete
Comment on attachment 8497496 [details] [diff] [review] Clean up some pyflakes & PEP8 warnings in buildbotcustom Review of attachment 8497496 [details] [diff] [review]: ----------------------------------------------------------------- ::: test/test_test_order.py @@ -296,5 @@ > who='me!', branch='b1', revision='r1', files=['http://path/to/build'], > comments='really important', properties={'buildid': '20110214000001'}, when=6) > self.dbc.addChangeToDatabase(c3) > ss = SourceStamp(branch='b1', changes=[c3], revision='r1') > - ss1 = ss.getAbsoluteSourceStamp('r1') This was for: test/test_test_order.py:300:13: F841 local variable 'ss1' is assigned to but never used It seemed like getAbsoluteSourceStamp() should be a no-op and as such the line removed (rather than just turning it into a function call with no assignment of the return value). Is this not the case? ::: test/test_try_parser.py @@ -230,5 @@ > - tm, VALID_BUILDER_NAMES, BUILDER_PRETTY_NAMES) > - builders = [b for b in BUILDER_PRETTY_NAMES.values( > - ) if 'nondefault' not in b] > - self.assertEqual(sorted(self.customBuilders), sorted(builders)) > - This was for: test/test_try_parser.py:259:5: F811 redefinition of unused 'test_AllPlatformsBoth' from line 227 Both test_AllPlatformsBoth() declarations looked to be identical, so were testing the same thing (or more, one of them overwrote the other). I chose to remove the earlier definition, since the latter was next to related tests, unlike the former.
(In reply to Pete Moore [:pete][:pmoore] from comment #2) > Thanks so much for finding the time to do all this! I've visually inspected > the whole patch, and apart from there maybe being a couple of stray code > excerpts that slipped in, it looks perfect! That must have been a lot of > work. Np :-) (Though I must admit I got a bit carried away after starting off by making two corrections to a file I was working on in another bug).
Comment on attachment 8497496 [details] [diff] [review] Clean up some pyflakes & PEP8 warnings in buildbotcustom Re-requesting review given the earlier comments :-)
Attachment #8497496 - Flags: review- → review?(pmoore)
Comment on attachment 8497496 [details] [diff] [review] Clean up some pyflakes & PEP8 warnings in buildbotcustom Awesome, first class work!! :D
Attachment #8497496 - Flags: review?(pmoore) → review+
Comment on attachment 8497496 [details] [diff] [review] Clean up some pyflakes & PEP8 warnings in buildbotcustom remote: https://hg.mozilla.org/build/buildbotcustom/rev/a60fd97801ce
Attachment #8497496 - Flags: checked-in+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Merged to production, and deployed.
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: