Enable flake8 rule E502: "the backslash is redundant between brackets"

RESOLVED FIXED in Firefox 55

Status

()

enhancement
P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Dexter, Assigned: fedepad, Mentored)

Tracking

({good-first-bug})

Trunk
mozilla55
Points:
1
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [measurement:client][lang=python])

Attachments

(1 attachment)

Reporter

Description

2 years ago
+++ This bug was initially created as a clone of Bug #1344831 +++

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 E502 rule: "the backslash is redundant between brackets"

1) Remove the E502 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

2 years ago
No longer depends on: 1344831
Reporter

Updated

2 years ago
Blocks: 1344833
Reporter

Updated

2 years ago
No longer blocks: 1344833
Reporter

Updated

2 years ago
Keywords: good-first-bug
Assignee

Comment 1

2 years ago
Done.

Tests passed.
Pushing for review.
Comment hidden (mozreview-request)
Reporter

Comment 3

2 years ago
mozreview-review
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

This looks good. Please make sure that this also passes xpcshell tests, both locally and on try servers. You can try locally by issuing the "./mach test toolkit/components/telemetry/unit" command.

For the try server part, select "Trigger a try build" from the Automation menu here on MozReview. Then pick a few platforms (linux, windows, macos) and only enable xpcshell tests.
Attachment #8846897 - Flags: review?(alessio.placitelli) → review+
Assignee

Comment 4

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

I already ran the tests locally before pushing for review using "./mach test", which according to the commit it selects the right tests to run.
The tests all passed.
I re-ran using your command and it runs the same tests as with just "./mach test".
Just a minor thing, your line to trigger the tests should be:
"./mach test toolkit/components/telemetry/tests/unit" and not "./mach test toolkit/components/telemetry/unit": a missing "tests" directory.
I will trigger a try build here now.
Assignee

Comment 5

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

I cannot trigger a try build here, the fields in Automation are greyed out for me, which means probably I don't have the rights to do it.
If you have, could you in case trigger it? Otherwise I don't know how to do it ;)
Assignee

Comment 6

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

It looks like the try builds were successfull.
What are the next steps for this?
Thanks!

Comment 7

2 years ago
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s 0c12b9761ea4 -d a6c7a9fcfc29: rebasing 382075:0c12b9761ea4 "Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r=Dexter" (tip)
merging toolkit/components/telemetry/.flake8
warning: conflicts while merging toolkit/components/telemetry/.flake8! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Reporter

Comment 8

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

Please rebase your commit.
Assignee

Comment 9

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

Ok! I see from the documentation (http://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/firefoxworkflow.html?highlight=rebase) I should do:

hg up my-bookmark
hg pull
hg rebase -d inbound
hg push -r . inbound


Is that correct? Do I also need to do 

hg histedit

in between (right before pushing) as mentioned in the doc?
And is it correct to push to inbound or should be pushed to review?

Thanks!
Reporter

Comment 10

2 years ago
mozreview-review-reply
Comment on attachment 8846897 [details]
Bug 1344832 - Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter

https://reviewboard.mozilla.org/r/119884/#review121920

You should rebase on [autoland](http://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/firefoxworkflow.html?highlight=rebase#autolanding), and then push to review again. There's no need to push/rebase to inbound, as we're planning to land this patch using MozReview anyway, not manually :)
Comment hidden (mozreview-request)
Reporter

Updated

2 years ago
Assignee: nobody → federico_padua
Status: NEW → ASSIGNED

Comment 12

2 years ago
Pushed by alessio.placitelli@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e0a87984f613
Enable flake8 rule E502: "the backslash is redundant between brackets". r+dexter r=Dexter

Comment 13

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e0a87984f613
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.