Closed Bug 1622677 Opened 5 years ago Closed 2 years ago

dom/bindings: Make it flake8 compliant

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox108 fixed)

RESOLVED FIXED
Tracking Status
firefox108 --- fixed

People

(Reporter: Sylvestre, Assigned: banang.eb, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [lang=python])

Attachments

(2 files, 5 obsolete files)

+++ This bug was initially created as a clone of Bug #1622676 +++

Filling as a good first bug to learn workflows.

As the change is easy, it is mostly to learn how to contribute to Firefox.

To work on this, remove this line:
https://searchfox.org/mozilla-central/source/.flake8#7

To run the linter:
$ ./mach lint -l flake8 dom/bindings

To run the autofix:
$ ./mach lint -l flake8 --fix dom/bindings

Then, the remaining thing should be fixed by hand.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/tools/docs/contribute/how_to_contribute_firefox.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

Depends on D78616

Assignee: nobody → kandpalnehu
Status: NEW → ASSIGNED
Attachment #9156594 - Attachment description: Bug 1622677 - Remove dom/bindings to make it flake8 compliant.r=Sylvestre → Bug 1622677 - Make dom/bindings flake8 compliant.r=Sylvestre

Depends on D79622

Depends on D80348

Attachment #9157900 - Attachment is obsolete: true
Attachment #9157901 - Attachment is obsolete: true
Attachment #9156594 - Attachment is obsolete: true
Attachment #9156594 - Attachment is obsolete: false
Attachment #9157900 - Attachment is obsolete: false
Attachment #9157901 - Attachment is obsolete: false

Depends on D80349

Attachment #9159931 - Attachment is obsolete: true
Attachment #9157900 - Attachment is obsolete: true
Attachment #9156594 - Attachment is obsolete: true

Chocos, please resubmit https://phabricator.services.mozilla.com/D80349
with an up to date version of mozphab.
We had a bug (bug 1648915)

thanks

Attachment #9157901 - Attachment is obsolete: true

This good-first-bug hasn't had any activity for 6 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: kandpalnehu → nobody
Status: ASSIGNED → NEW

--
user: Mark Kipyegon Koskei <mkipyegon@outlook.com> r?Sylvestre
branch 'default'
changed .flake8
changed Cargo.lock
changed dom/bindings/Configuration.py
changed dom/bindings/parser/tests/test_union.py

Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
Assignee: nobody → banang.eb
Status: NEW → ASSIGNED
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a431037d8232 Make dom/bindings flake8 compliant. r=sylvestre

I'm really sorry, but I think there's an issue with the patch I submitted for this. The line I removed frrom exclude was the one highlighted in the link but it wasn't dom/bindings, so there are still unresolved linter errors as of now. Can I continue to amend this now it's been pushed?

Flags: needinfo?(sledru)

yeah, please submit a new patch :)

Flags: needinfo?(sledru)

Thanks, sorry again!

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Attachment #9289624 - Attachment is obsolete: true
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/02b8e04c764c Make dom/bindings flake8 compliant. r=sylvestre

Backed out for causing multiple failures related to WebIDL.

Push with failures

Failure log for build bustages
Failure log for mbu jobs
Failure log for wp jobs

Backout link
snippet from build bustages failure log

[task 2022-12-17T09:59:42.629Z] 09:59:42     INFO -  gmake[4]: Entering directory '/builds/worker/workspace/obj-build/dom/bindings'
[task 2022-12-17T09:59:42.631Z] 09:59:42     INFO -  /builds/worker/workspace/obj-build/_virtualenvs/build/bin/python -m mozbuild.action.webidl /builds/worker/checkouts/gecko/dom/bindings
[task 2022-12-17T09:59:42.632Z] 09:59:42    ERROR -  Traceback (most recent call last):
[task 2022-12-17T09:59:42.632Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py", line 8837, in __init__
[task 2022-12-17T09:59:42.633Z] 09:59:42     INFO -      self.parser = yacc.yacc(
[task 2022-12-17T09:59:42.634Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/third_party/python/ply/ply/yacc.py", line 3317, in yacc
[task 2022-12-17T09:59:42.635Z] 09:59:42     INFO -      raise YaccError('Unable to build parser')
[task 2022-12-17T09:59:42.635Z] 09:59:42     INFO -  ply.yacc.YaccError: Unable to build parser
[task 2022-12-17T09:59:42.636Z] 09:59:42     INFO -  During handling of the above exception, another exception occurred:
[task 2022-12-17T09:59:42.637Z] 09:59:42    ERROR -  Traceback (most recent call last):
[task 2022-12-17T09:59:42.638Z] 09:59:42     INFO -    File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
[task 2022-12-17T09:59:42.639Z] 09:59:42     INFO -      return _run_code(code, main_globals, None,
[task 2022-12-17T09:59:42.639Z] 09:59:42     INFO -    File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
[task 2022-12-17T09:59:42.640Z] 09:59:42     INFO -      exec(code, run_globals)
[task 2022-12-17T09:59:42.641Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/action/webidl.py", line 20, in <module>
[task 2022-12-17T09:59:42.642Z] 09:59:42     INFO -      sys.exit(log_build_task(main, sys.argv[1:]))
[task 2022-12-17T09:59:42.642Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/action/util.py", line 18, in log_build_task
[task 2022-12-17T09:59:42.643Z] 09:59:42     INFO -      return f(*args, **kwargs)
[task 2022-12-17T09:59:42.644Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/python/mozbuild/mozbuild/action/webidl.py", line 16, in main
[task 2022-12-17T09:59:42.645Z] 09:59:42     INFO -      manager.generate_build_files()
[task 2022-12-17T09:59:42.645Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/dom/bindings/mozwebidlcodegen/__init__.py", line 290, in generate_build_files
[task 2022-12-17T09:59:42.646Z] 09:59:42     INFO -      self._parse_webidl()
[task 2022-12-17T09:59:42.647Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/dom/bindings/mozwebidlcodegen/__init__.py", line 380, in _parse_webidl
[task 2022-12-17T09:59:42.647Z] 09:59:42     INFO -      parser = WebIDL.Parser(self._cache_dir, lexer=None)
[task 2022-12-17T09:59:42.647Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py", line 8850, in __init__
[task 2022-12-17T09:59:42.647Z] 09:59:42     INFO -      logger.reportGrammarErrors()
[task 2022-12-17T09:59:42.647Z] 09:59:42     INFO -    File "/builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py", line 7040, in reportGrammarErrors
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -      raise WebIDLError("\n".join(self.errors), [])
[task 2022-12-17T09:59:42.648Z] 09:59:42    ERROR -  WebIDL.WebIDLError: error: /builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py:7437: Syntax error in rule 'PartialInterfaceMembers'
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  /builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py:7653: Syntax error. Expected ':'
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  /builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py:7764: Syntax error in rule 'SEMICOLON'
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  /builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py:7783: Syntax error. Expected ':'
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  /builds/worker/checkouts/gecko/dom/bindings/parser/WebIDL.py:7833: Syntax error. Expected ':'
[task 2022-12-17T09:59:42.648Z] 09:59:42    ERROR -  gmake[4]: *** [Makefile:54: webidl.stub] Error 1
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/dom/bindings'
[task 2022-12-17T09:59:42.648Z] 09:59:42     INFO -  gmake[4]: Target 'export' not remade because of errors.
[task 2022-12-17T09:59:42.648Z] 09:59:42    ERROR -  gmake[3]: *** [/builds/worker/checkouts/gecko/config/recurse.mk:99: dom/bindings/export] Error 2
[task 2022-12-17T09:59:42.649Z] 09:59:42     INFO -  gmake[4]: Nothing to be done for 'export'.
[task 2022-12-17T09:59:42.649Z] 09:59:42     INFO -  gmake[5]: Entering directory '/builds/worker/workspace/obj-build/config/makefiles/xpidl'
Flags: needinfo?(sledru)
Flags: needinfo?(banang.eb)

Apologies, I think this is related to some of the docstrings in WebIDL.py that were over the character limit per line. As I wasn't previously familiar with WebIDL, I did not realise these were being automatically parsed and should not be modified. I will revert the relevant changes and exclude the file from flake8 linting.

Flags: needinfo?(banang.eb)
Flags: needinfo?(sledru)
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e6777bf48ad3 Make dom/bindings flake8 compliant. r=sylvestre
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: