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)

enhancement
Points:
1

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)

+++ 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
No longer depends on: 1344853
Blocks: 1344855
No longer blocks: 1344855
Keywords: good-first-bug
When i run "./mach lint -l flake8 toolkit/components/telemetry",i get 0 errors, 0 warnings.
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)
@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
Please assign this bug to me.
Flags: needinfo?(alessio.placitelli)
Attachment #8846435 - Attachment is obsolete: true
Please provide the review ?
Flags: needinfo?(alessio.placitelli)
Assignee: nobody → paavininanda
Flags: needinfo?(alessio.placitelli)
Attachment #8846469 - Flags: review?(alessio.placitelli)
Please use the review field, when attaching a new patch, to request a review.
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-
Attached patch bug1344854.patch (deleted) — Splinter Review
Attachment #8846469 - Attachment is obsolete: true
Attachment #8847052 - Flags: review?(alessio.placitelli)
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+
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
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: