Closed Bug 1452212 Opened 7 years ago Closed 7 years ago

Fix any relevant issues found by pylint

Categories

(Tree Management :: Treeherder, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

(Depends on 2 open bugs)

Details

Attachments

(1 file)

Whilst looking into pylint's `--py3k` mode (to help stop bug 1330474 regressing as people make contributions towards it), I experimented with the standard pylint mode, and found a number of issues it reports are actually real bugs. We probably won't run the non `--py3k` mode pylint in CI (since it's too slow; 4 minutes to check treeherder/ and tests/), but we might as well fix a few other issues while we're here.
Depends on: 1452213
Depends on: 1452220
Depends on: 1452230
Depends on: 1452238
Depends on: 1452249
Depends on: 1452252
Depends on: 1452304
Depends on: 1452306
Depends on: 1452311
Depends on: 1452420
Attachment #8966006 - Flags: review?(cdawson)
Summary: Fix any relevant issues found by eslint → Fix any relevant issues found by pylint
Comment on attachment 8966006 [details] [review] Link to GitHub pull-request: https://github.com/mozilla/treeherder/pull/3419 Awesome cleanup!!
Attachment #8966006 - Flags: review?(cdawson) → review+
Commits pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/08437cfbf2bf876e311f9beb10c9056a778cee7a Bug 1452212 - Fix some of the pylint 'bad-continuation' warnings The others were too nitpicky so were left as-is. https://github.com/mozilla/treeherder/commit/17f1b69eaf15e5b7df8c1183dc3fb6753c4a0aa2 Bug 1452212 - Pass logging arguments as function parameters Specify string format arguments as logging function parameters, to avoid evaluating them if the log level isn't high enough. Fixes pylint 'logging-not-lazy' and 'logging-format-interpolation'. https://github.com/mozilla/treeherder/commit/6eaf49ab436a660da3e3ad8c05475a77d3378ea6 Bug 1452212 - Remove unused variables As reported by pylint 'unused-variable'. https://github.com/mozilla/treeherder/commit/3940509ee7614c77783437857fd3c7c342687fc5 Bug 1452212 - Remove superfluous parens after keywords Fixes pylint `superfluous-parens`. https://github.com/mozilla/treeherder/commit/dfb91271f08a06fa52bb8bc671ee5c2bebc96057 Bug 1452212 - Add missing raw string annotations Fixes pylint `anomalous-backslash-in-string`. https://github.com/mozilla/treeherder/commit/3edd5fdc990702e36135da3f1716ad29b6838752 Bug 1452212 - Remove superfluous whitespace Fixes pylint `bad-whitespace`. https://github.com/mozilla/treeherder/commit/b6bea909e9630a9bf609e47002a139db47f06005 Bug 1452212 - Fix PulsePublisher docstring Fixes pylint `pointless-string-statement`. https://github.com/mozilla/treeherder/commit/82c81cdfbe6176e62ddb0ebdb23e6eca79858683 Bug 1452212 - Fix over-indentation Fixes pylint `bad-indentation`. https://github.com/mozilla/treeherder/commit/eb5b9fe9adf8bfc2ab93618a4b2cc3d88798bed8 Bug 1452212 - Remove ObjectScalar's redundant __init__ method Fixes pylint `useless-super-delegation`. https://github.com/mozilla/treeherder/commit/b3ceeef5977cb58a2db4352329a6b425eb77008d Bug 1452212 - Remove duplicate imports These are all imported at the top of the file already. Fixes pylint `reimported`. https://github.com/mozilla/treeherder/commit/3310083cb1021718f46f6e33a4d3633744375507 Bug 1452212 - Use unicode literals in test_text.py Fixes pylint: ``` tests/etl/test_text.py:34,0: Anomalous Unicode escape in byte string: '\U'. String constant might be missing an r or u prefix. (W1402: anomalous-unicode-escape-in-string) ``` https://github.com/mozilla/treeherder/commit/a33a22cd1fb6b4998fbd1067386c11a49d4a7758 Bug 1452212 - Don't use len() to check if sequences are empty Fixes pylint `len-as-condition`. https://github.com/mozilla/treeherder/commit/3b6f6d3c4ce198524de9cdcbcd80229ba39e099f Bug 1452212 - Remove unnecessary lambda expressions Fixes pylint `unnecessary-lambda` and some of `deprecated-lambda`. https://github.com/mozilla/treeherder/commit/487b9081dc4752ee4deb654ec0d1c5d17f2d2184 Bug 1452212 - Use logger.warning() instead of logger.warn() Since the latter is deprecated: https://stackoverflow.com/a/15655674
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: