Closed Bug 1348360 Opened 7 years ago Closed 7 years ago

update_job_priority.py inadvertently uses '#noqa' for the entire file, hiding errors

Categories

(Tree Management Graveyard :: Treeherder: SETA, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

Details

Attachments

(1 file)

In one of the docstrings [1] `# flake8: noqa` is used, which actually enables no-qa mode for the entire file, not just that line. See:
http://flake8.pycqa.org/en/latest/user/ignoring-errors.html

In fact, noqa wasn't needed for that line anyway, since we disable line length checks.

As such there are several linter errors that are being hidden:

treeherder/seta/update_job_priority.py:12:1: F401 'copy' imported but unused
treeherder/seta/update_job_priority.py:14:1: F401 'json' imported but unused
treeherder/seta/update_job_priority.py:16:1: F401 'os' imported but unused
treeherder/seta/update_job_priority.py:17:1: F401 'time' imported but unused
treeherder/seta/update_job_priority.py:54:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:104:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:126:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:129:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:144:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:192:23: E127 continuation line over-indented for visual indent

[1] https://github.com/mozilla/treeherder/blob/e328bff65d442d2dd7380bd73a303a50138f12a7/treeherder/seta/update_job_priority.py#L121
Attachment #8848584 - Flags: review?(rwood)
Comment on attachment 8848584 [details] [review]
[treeherder] mozilla:rm-noqa > mozilla:master

Thanks for taking care of this!
Attachment #8848584 - Flags: review?(rwood) → review+
Commits pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/8ff5ee631ed900700afc63ae3438c97b57705ea7
Bug 1348360 - Fix flake8 linter errors in update_job_priority.py

These were hidden by the use of `# flake8: noqa`.

treeherder/seta/update_job_priority.py:12:1: F401 'copy' imported but unused
treeherder/seta/update_job_priority.py:14:1: F401 'json' imported but unused
treeherder/seta/update_job_priority.py:16:1: F401 'os' imported but unused
treeherder/seta/update_job_priority.py:17:1: F401 'time' imported but unused
treeherder/seta/update_job_priority.py:54:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:104:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:126:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:129:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:144:1: E302 expected 2 blank lines, found 1
treeherder/seta/update_job_priority.py:192:23: E127 continuation line over-indented for visual indent

https://github.com/mozilla/treeherder/commit/cfc8870e98e039b898d9e92c16f5b2669a99cf8e
Bug 1348360 - Remove 'flake8: noqa' from update_job_priority.py

Since it isn't required on this line as line length checks are disabled,
and in fact disables flake8 for the entire file rather than just the
one line.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: