testing/web-platform: Make it flake8 compliant
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Tracking
(firefox83 fixed)
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: pfischbeck, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=python])
Attachments
(1 file, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
Details |
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#52
To run the linter:
$ ./mach lint -l flake8 testing/web-platform/
To run the autofix:
$ ./mach lint -l flake8 --fix testing/web-platform/
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.
Comment 1•4 years ago
|
||
I tried to work on this ticket in Ubuntu but after running ./mach lint -l flake8 testing/web-platform/ i see the following:
...
mozilla/src/src/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 17, in <module>
from pip._internal.index import PackageFinder
ImportError: cannot import name 'PackageFinder'
Unable to install correct version of flake8
Try to install it manually with:
$ pip install -U --require-hashes -r /mozilla/src/src/tools/lint/python/flake8_requirements.txt
error: problem with lint setup, skipping flake8
Error running mach:
['lint', '-l', 'flake8', 'testing/web-platform/']
...
The details of the failure are as follows:
mozlint.errors.LintersNotConfigured: No linters registered! Use LintRoller.read
to register a linter.
File "mozilla/src/src/tools/lint/mach_commands.py", line 85, in lint
return cli.run(*runargs, **lintargs)
File "mozilla/src/src/python/mozlint/mozlint/cli.py", line 228, in run
num_procs=num_procs
File "/home/theo/Desktop/mozilla/src/src/python/mozlint/mozlint/roller.py", line 248, in roll
raise LintersNotConfigured
How do i fix it?
Should i follow any specific process to register a linters?
Comment 2•4 years ago
|
||
Running ./mach clobber python fixed the issue so i will provide a fix soon.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
Change is complete now. I only face problems to push the revisions to phabricator.
Running moz-phab submit 534249::534612 returns
warning: Watchman unavailable: watchman exited with code 1
FileNotFoundError: [WinError 206] The filename or extension is too long
Run moz-phab again with '--trace' to show debugging output
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit
I also tried moz-phab self-update and it returned the following message
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\mozilla-build\python3\Scripts\moz-phab.exe\moz-phab.exe' -> 'C:\mozilla-build\python3\Scripts\moz-phab.exe\moz-phab-temp.exe'
Run moz-phab again with '--trace' to show debugging output
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit
Is this a configuration issue? Could somebody help me solve it?
Reporter | ||
Comment 4•4 years ago
|
||
Bugzilla isn't the place to ask for help. Please ask your questions here:
https://chat.mozilla.org/#/room/#introduction:mozilla.org
good luck!
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
This also enables py3 linting for testing/web-platform. The external testing/web-platform/tests is excluded from linting.
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•