Closed
Bug 1186388
Opened 10 years ago
Closed 8 years ago
Make a PEP8 linter run on every commit
Categories
(Firefox OS Graveyard :: Gaia::UI Tests, defect)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: jlorenzo, Unassigned)
Details
Attachments
(1 file)
We have a linter for JS, but we also sometimes leaves nits for the reviewer. Having a linter for Python that enforces PEP8 would be useful.
| Reporter | ||
Comment 1•10 years ago
|
||
I started to look into it. Here are the steps to make this happen:
1. Choose a linter
2. Create a TC task running on it on stage environment
3. Fix all the PEP 8 errors found (or configure the linter to ignore some of them specifically)
4. Turn on the TC task on the production environment
5 (bonus). Make the linter commenting on the GitHub PR directly.
1. Choose a linter
[1] lists some linters. I tried:
* pep8 doesn't verify the case of variables and classes => Not OK
* flake8 regroups pep8, pyflakes and pep8-naming. It's easy to parse. It does verify the naming.
* pylint does more than linting but can be harder to parse. It find more issues in our current code base, and these findings are pertinent. I think we can go with that one.
2. Create the task
See this example[2].
3. Fix all the PEP 8 errors found
That will be a long thing to deal with. I'd suggest to make the changes in many small PRs and see the improvements along the PRs.
4. Turn on the TC task on the production environment
You'll have to update [2] to make it appear on TH.
5. Make the linter commenting on the GitHub PR directly
We can parse the result of the parser, and push the details to [3]
[1] http://stackoverflow.com/questions/5611776/what-are-the-comprehensive-lint-checkers-for-python/7925369#7925369
[2] https://github.com/mozilla-b2g/gaia/blob/01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c/tests/taskcluster/tasks/jshint.yml
[3] https://developer.github.com/v3/pulls/comments/#create-a-comment
Comment 2•10 years ago
|
||
Comment 3•8 years ago
|
||
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•