Closed
Bug 1344854
Opened 8 years ago
Closed 8 years ago
Enable flake8 rule F841: "local variable XXX is assigned to but never used"
Categories
(Toolkit :: Telemetry, enhancement, P3)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: Dexter, Assigned: paavininanda, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [measurement:client][lang=python])
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Dexter
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1344853 +++
In bug 1332651 we landed flake8 initial support to lint Python files in the Telemetry directory, by disabling all the detected problems.
This bug is about enabling the F841, "local variable XXX is assigned to but never used":
1) Remove the F841 rule from the .flake8 file in https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry
2) Run "./mach lint -l flake8 toolkit/components/telemetry".
3) Fix the reported problems
Reporter | ||
Updated•8 years ago
|
Keywords: good-first-bug
Assignee | ||
Comment 1•8 years ago
|
||
When i run "./mach lint -l flake8 toolkit/components/telemetry",i get 0 errors, 0 warnings.
Assignee | ||
Comment 2•8 years ago
|
||
I would like to work on this bug. Can someone explain what i am supposed to do next ? Because my .flake8 file (the one my local machine) already has no dependence on F841 and the command "./mach lint -l flake8 toolkit/components/telemetry" is running properly.
Flags: needinfo?(alessio.placitelli)
Comment 3•8 years ago
|
||
@Pavini, please check the .flake8 file present at /source/toolkit/components/telemetry
there you will find F841 rule, you need to remove that then run "./mach lint -l flake8 toolkit/components/telemetry"
from the root of the project. You will find certain errors, try to remove those
Assignee | ||
Comment 4•8 years ago
|
||
Assignee | ||
Comment 6•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8846435 -
Attachment is obsolete: true
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → paavininanda
Flags: needinfo?(alessio.placitelli)
Reporter | ||
Updated•8 years ago
|
Attachment #8846469 -
Flags: review?(alessio.placitelli)
Reporter | ||
Comment 8•8 years ago
|
||
Please use the review field, when attaching a new patch, to request a review.
Reporter | ||
Comment 9•8 years ago
|
||
Comment on attachment 8846469 [details] [diff] [review]
added one variable extra_count which was earlier removed by mistake from gen-event-data.py
Review of attachment 8846469 [details] [diff] [review]:
-----------------------------------------------------------------
This patch doesn't remove the F841 rule from the .flake8 file. Please do that and make sure that the linting doesn't produce any error.
Also change the commit message to be:
Bug 1344854 - Enable flake8 rule F841: "local variable XXX is assigned to but never used". r?dexter
::: toolkit/components/telemetry/gen-event-data.py
@@ +32,5 @@
>
> def write_extra_table(events, output, string_table):
> table_name = "gExtraKeysTable"
> extra_table = []
> + extra_count = 0
This isn't missing from the code, it's probably the consequence of some change you made locally.
@@ +40,5 @@
> for e in events:
> extra_index = 0
> extra_keys = e.extra_keys
> if len(extra_keys) > 0:
> + extra_index = extra_count
You don't need to change that.
Attachment #8846469 -
Flags: review?(alessio.placitelli) → review-
Assignee | ||
Comment 10•8 years ago
|
||
Attachment #8846469 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8847052 -
Flags: review?(alessio.placitelli)
Reporter | ||
Comment 11•8 years ago
|
||
Comment on attachment 8847052 [details] [diff] [review]
bug1344854.patch
Review of attachment 8847052 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks! I'll take care of landing this ;)
Attachment #8847052 -
Flags: review?(alessio.placitelli) → review+
Reporter | ||
Comment 12•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/5a8529ec2ec2bd6335a2e91e2c399f9c83b22c2a
Bug 1344854 - Enable flake8 rule F841: "local variable XXX is assigned to but never used". r=dexter
Comment 13•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•8 years ago
|
status-firefox54:
affected → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•