Closed Bug 1155968 Opened 9 years ago Closed 9 years ago

xpcom/idl-parser/ code should follow the flake8 convention

Categories

(Core :: XPCOM, defect)

x86_64
Linux
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox40 --- affected
firefox42 --- fixed

People

(Reporter: Sylvestre, Assigned: bkudryavtsev, Mentored)

References

Details

(Whiteboard: [good first bug][lang=Python])

Attachments

(13 files, 3 obsolete files)

2.53 KB, patch
khuey
: review+
Details | Diff | Splinter Review
16.75 KB, patch
khuey
: review+
Details | Diff | Splinter Review
818 bytes, patch
khuey
: review+
Details | Diff | Splinter Review
1.56 KB, patch
khuey
: review+
Details | Diff | Splinter Review
6.90 KB, patch
khuey
: review+
Details | Diff | Splinter Review
4.13 KB, patch
khuey
: review+
Details | Diff | Splinter Review
3.92 KB, patch
khuey
: review-
Details | Diff | Splinter Review
3.69 KB, patch
khuey
: review+
Details | Diff | Splinter Review
3.33 KB, patch
khuey
: review+
Details | Diff | Splinter Review
1.27 KB, patch
khuey
: review+
Details | Diff | Splinter Review
5.35 KB, patch
khuey
: review+
Details | Diff | Splinter Review
1.63 KB, patch
khuey
: review+
Details | Diff | Splinter Review
1.00 KB, patch
khuey
: review+
Details | Diff | Splinter Review
Run on the Firefox source code, the following line shows a bunch of warnings. Nothing critical but it would be nice to remove them:
$ flake8 --max-line-length=1000 xpcom/idl-parser/

That should be pretty easy to fix for a beginner in Python.
One patch per kind of bug.
Blocks: flake8
I would like to work on this.
Attachment #8600669 - Flags: review?(dougt)
Comment on attachment 8600669 [details] [diff] [review]
bug1155968_removeflake8warnings.diff

Sorry Boris but as said
"One patch per kind of bug."
Attachment #8600669 - Flags: review?(dougt)
Oh, I see. Will fix. Should I have separate patches for separate files?
(In reply to Boris Kudryavtsev [:bkudryavtsev] from comment #4)
> Oh, I see. Will fix. Should I have separate patches for separate files?
No, one patch per kind of error.
Attachment #8600669 - Attachment is obsolete: true
Attachment #8601289 - Flags: review?(dougt)
khuey is probably a better reviewer for XPIDL stuff.
Attachment #8601289 - Flags: review?(dougt) → review?(khuey)
Attachment #8601290 - Flags: review?(dougt) → review?(khuey)
Attachment #8601293 - Flags: review?(dougt) → review?(khuey)
Attachment #8601295 - Flags: review?(dougt) → review?(khuey)
Attachment #8601819 - Flags: review?(dougt) → review?(khuey)
Comment on attachment 8601290 [details] [diff] [review]
rev1 - bug1155968_missingblanklines.diff

Review of attachment 8601290 [details] [diff] [review]:
-----------------------------------------------------------------

FWIW I think the PEP 8 two lines thing here is kind of silly, but ok, consistency wins.
Attachment #8601290 - Flags: review?(khuey) → review+
There are a couple more patches to come. Don't mark this one fixed just yet.
Comment on attachment 8604968 [details] [diff] [review]
rev1 - bug1155968_indentations.diff

Review of attachment 8604968 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/idl-parser/header.py
@@ +436,1 @@
>         fd.write('\\')

Er, I think you reindented the wrong thing here.
Attachment #8604968 - Flags: review?(khuey) → review-
Is this more like it?
Attachment #8604991 - Flags: review?(khuey)
Comment on attachment 8604991 [details] [diff] [review]
rev2 - bug1155968_indentations.diff

Review of attachment 8604991 [details] [diff] [review]:
-----------------------------------------------------------------

Yup.
Attachment #8604991 - Flags: review?(khuey) → review+
Boris, you can now request the checkin.

Just add the keyword checkin-needed in the bug.
Assignee: nobody → boriskk.work
Attachment #8608493 - Flags: review?(khuey)
Attached patch rev1 - bug1155968_initfix.diff (obsolete) — Splinter Review
Attachment #8608494 - Flags: review?(khuey)
Comment on attachment 8608494 [details] [diff] [review]
rev1 - bug1155968_initfix.diff

Review of attachment 8608494 [details] [diff] [review]:
-----------------------------------------------------------------

Why is this ok?  What happens if no iface is found?
Attachment #8608494 - Flags: review?(khuey) → review-
Attached patch rev2 - bug1155968_initfix.diff (obsolete) — Splinter Review
Attachment #8613086 - Flags: review?(khuey)
Comment on attachment 8613086 [details] [diff] [review]
rev2 - bug1155968_initfix.diff

Review of attachment 8613086 [details] [diff] [review]:
-----------------------------------------------------------------

This is still going to throw an exception, because None has no location property.
Attachment #8613086 - Flags: review?(khuey) → review-
I am confused on how to fix this. The PEP8 warning I get is: F821 undefined name 'c'.
(In reply to Boris Kudryavtsev [:bkudryavtsev] from comment #29)
> I am confused on how to fix this. The PEP8 warning I get is: F821 undefined
> name 'c'.

Yeah, it's complaining that if we take that exception branch we'll try to get c.location before c is defined.  You should just remove the c.location parameter from that IDLError instantiation.
Attachment #8608494 - Attachment is obsolete: true
Attachment #8613086 - Attachment is obsolete: true
Attachment #8614238 - Flags: review?(khuey)
Boris, I think you can now request the checkin. For this, add checkin-needed in the keyword area.
Flags: needinfo?(boriskk.work)
Should this be run through try?
Flags: needinfo?(boriskk.work)
Keywords: checkin-needed
(In reply to Boris Kudryavtsev [:bkudryavtsev] from comment #33)
> Should this be run through try?

yeah can we get a try run here ? thanks!
Flags: needinfo?(boriskk.work)
Keywords: checkin-needed
I am currently unable to do a try run. Can someone else do it? Thanks.
Flags: needinfo?(boriskk.work)
This doesn't need to go through try.  Just land it.
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: